943,735 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 1904
  • C# RSS
Jun 8th, 2009
0

How can I generate sql script with data in sql server 2000?

Expand Post »
Please any one help me...
I want to insert data automatically to the table while installing an application. how can i do this? Can I generate sql script for this???


Regards
Jineesh
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
jineesh is offline Offline
20 posts
since Jun 2009
Jun 8th, 2009
0

Re: How can I generate sql script with data in sql server 2000?

Click to Expand / Collapse  Quote originally posted by jineesh ...
Please any one help me...
I want to insert data automatically to the table while installing an application. how can i do this? Can I generate sql script for this???


Regards
Jineesh

It depends on how big is the data you are dealing with. For example few lines can be inserted handy written script.

Few hundred lines can be inserted from script-generated sql script like:
C# Syntax (Toggle Plain Text)
  1. declare @crlf varchar(2)
  2. set @crlf = char(13)+char(10)
  3. select 'insert into tab1 (a,b,c) values (''' +a+''','''+b+''','''+c''');'+crlf;
  4. from tab1
  5. where /* add filter here*/

for 1000+ you can store data into Excel table and import it very simple way (see http://horizon.leadhoster.com/?content=tipstricks topic Fast and simple import data from Excel table into SQL server ) or XML and process data on the server within stored procedure or with XQuery http://blogs.msdn.com/mrorke/ see Dynamic XQuery Expressions.

Finally for 100000+ I would reccommend you distribute whole database file (mdf+ldf) and during installation just unpack it and attach (works perfectly!).
Reputation Points: 10
Solved Threads: 9
Junior Poster
VIeditorlover is offline Offline
137 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Automatically detect RSS feed available in a website...
Next Thread in C# Forum Timeline: real-time value of "value"





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC