Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to generate test data

$
0
0

Hi

I need to generate some test data and would like to know if there are any built functions in SQL Server 2012 that let you do that apart from using loops. In PostgreSQL I use different built in functions to achieve that for example the following statement creates the test data for me, if any one can show me how I can do that using T-SQL

CREATE TABLE domain AS SELECT generate_series(1,100000) AS domain_id, substr('abcdefghijklmnopqrstuvwxyz',1, (random()*26)::integer) || '.com' AS domain_name;

And also I would like to know how do you get help on syntax in T-SQL, for example in PostgreSQL the following commands show you help etc so are there any similar commands in T-SQL ?

\h ALTER TABLE   ( Will show you full syntax for ALTER TABLE )

\dt  ( Will detail all the tables in the current Schema )

Thanks a lot

Rgds

T


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>