This SQL-sentence will first of all create a table (destinationtable) containing variable1, variable2 and variable3. Into the destinationtable it will make a tablesample from 10 percent of the observations in the soucetable.

SELECT [variable1]
into [databse].[schema].[destinationtable]
from [database].[schema].[sourcetable]
tablesample (10 percent)

You could eg. use tempdb (a temporary database in Microsoft SQL-server) to store the sample.

Leave a Reply

Your email address will not be published. Required fields are marked *