Microsoft Technology, .Net, BizTalk, Sharepoint & etc.

Liedong(Ken) Zheng, Senior SharePoint Developer at SIMPLOT

Posts Tagged ‘SQL’

Generate insert script from existing data table

Posted by ken zheng on June 3, 2009

You can generate a create table script from SQL 2005 but there is no oob to generate an insert script.

Here is the link to create a sp which will generate script for you.
http://vyaskn.tripod.com/code/generate_inserts_2005.txt.

Check out the My code library to see any script can be used in your project.

Posted in SQL | Tagged: , | Leave a Comment »

How To Connect mdf in app_data

Posted by ken zheng on September 17, 2008

Sometime people would like to put mdf in APP_Data so they can zip the database with the code.

the connection string will look like

That’s fine for SQL Express installed but if you are running SQL 2005, you may get error to connect the database.
After a while try, I found you can see the mdf from Server Explorer -> Data Connections. Try to connect the server and have a look the property. you will see the connection string like

Data Source=.\SQLEXPRESS;AttachDbFilename=”C:\VS2008 Projects\Ajax2008\Ajax2008\App_Data\Northwind.mdf”;Integrated Security=True;User Instance=True

So after I added the User Instance=True, it works.

Posted in .Net, VS2008 | Tagged: | Leave a Comment »

SQL Server 2008 RTM IS Ready

Posted by ken zheng on August 7, 2008

http://msdn.microsoft.com/en-us/subscriptions/downloads/default.aspx Has Ent, Dev, Std, Web and Workgroup for subscriber downloads, can’t see Express or Ent Trial yet on the non subscriber pages.

Posted in SQL | Tagged: | Leave a Comment »