Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Script To Create INSERT statements

By PeterLivesey,

The following script allows for the scripting of data into insert statement.
The user only needs to set the tablename and a query for the data they require scripted and run.

Note the script takes into account autonumber primary keys and removes them from the insert statement.

Also Note that this script will only work on tables with a Single Primary key and not on either heaps or compound keys.

This script meets my needs but could probably be improved feel free to send me any updates.

Total article views: 439 | Views in the last 30 days: 2
 
Related Articles
FORUM

Monitoring script

script

FORUM

Script

Need Automated Script

FORUM

drop script

drop script

FORUM

Script component

Script component

Tags
miscellaneous    
t-sql    
 
Contribute