| | |
How can I generate sql script with data in sql server 2000?
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
•
•
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)
declare @crlf varchar(2) set @crlf = char(13)+char(10) select 'insert into tab1 (a,b,c) values (''' +a+''','''+b+''','''+c''');'+crlf; from tab1 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!).
![]() |
Similar Threads
- sql server 2000 and mysql (MySQL)
- generate sql script (ASP.NET)
- How to Retrieve THAI Language Data From SQL Server 2000 to string variable (Visual Basic 4 / 5 / 6)
- Execute an SQL Script in JDBC (Java)
- how to connect SQL server 2000 to vb.net? (VB.NET)
- How do I Backup the MS SQL server 2000 database file (mdf) to my local PC ? (MS SQL)
- vb.net and SQL Server 2000 (VB.NET)
- MS Access v/s MS SQL Server 2000 (MySQL)
Other Threads in the C# Forum
- Previous Thread: Automatically detect RSS feed available in a website...
- Next Thread: real-time value of "value"
| Thread Tools | Search this Thread |
.net access algorithm api array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop php picturebox pixelinversion platform post programming radians regex remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml





