Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Data Generator

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-03-17 : 15:52:47
I want scripts to generate the test data in csv file.
Please suggests.

Thanks for your help in advance !

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-03-17 : 16:04:56
>>Please suggests.

I suggest you be a little more specific in what you want help with. Perhaps include some requirements or at least an actual question

Be One with the Optimizer
TG
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-03-17 : 16:39:26
I have a table which contains 10 records.I want that data to be generated in .csv format.


Table
----
Id Ename Role
--- ------ -------
1 Mac BAnalyst
2 sam PM
3 Mat TL
4 John Null

output in csv

1,Mac,BAnalyst
2,sam,PM
3,Mat,TL
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-03-17 : 17:16:30
so it is just a simple pull from an existing table? just use tools|options|query results|sql server|results-to-text to set the style to csv. Then say "output to file".

Or you can use BCP.
http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -