Date: Fri, 28 Jan 2005 10:45:53 -0800
Reply-To: "Pardee, Roy" <pardee.r@GHC.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Pardee, Roy" <pardee.r@GHC.ORG>
Subject: Re: Random Sample from a SQL Server Database
Content-Type: text/plain; charset="us-ascii"
Or send SQL like this: (from
http://www.sqlteam.com/item.asp?ItemID=8747)
Select top 3 percent *
From my_table
Order by newid() ;
I've never done it, myself, but it should work...
HTH,
-Roy
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sigurd Hermansen
Sent: Friday, January 28, 2005 10:28 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Random Sample from a SQL Server Database
dmka:
1. write a test program that takes a 3% random sample from a SAS dataset
library
(use SAS PROC SURVEYSELECT, or, if base only, ranuni());
2. replace LIBNAME sas dataset reference in above with a connection
string to a table in SQL Server; Sig
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
dmka
Sent: Thursday, January 27, 2005 11:07 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Random Sample from a SQL Server Database
SAS Users:
I would like to take a 3% random sample from a SQL Server Data base. I
access the data bases through the SQL pass through facility (Proc SQL
through an OLEDB connection). How could I accomplish this?
Thanks,
Doyle.
|