LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
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.


Back to: Top of message | Previous page | Main SAS-L page