Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Create Insert data script for views Expand / Collapse
Author
Message
Posted Monday, March 04, 2013 11:23 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 9:12 PM
Points: 215, Visits: 542
Dear All

For one table I need to create insert statemetn with data. For this I used SSMS-Task -Generate script - Data only it creates inserts will all the rows.

But i need only few selected rows.Hence created a view and tried the same thing but it does not generate insert script with data.


I am doing somthing wrong?

Regards
Post #1426606
Posted Tuesday, March 05, 2013 1:46 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 9:12 PM
Points: 215, Visits: 542
I have acheved it using a new table instead of view

Is there any better way?
Post #1426642
Posted Tuesday, March 05, 2013 1:48 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, April 17, 2014 9:33 AM
Points: 6,754, Visits: 12,854
Krishna1 (3/4/2013)
Dear All

For one table I need to create insert statemetn with data. For this I used SSMS-Task -Generate script - Data only it creates inserts will all the rows.

But i need only few selected rows.Hence created a view and tried the same thing but it does not generate insert script with data.


I am doing somthing wrong?

Regards


INSERT INTO newtable (columnlist) SELECT columnlist FROM oldtable WHERE...


“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1426644
Posted Tuesday, March 05, 2013 4:36 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, April 02, 2014 9:12 PM
Points: 215, Visits: 542
Thanks. That what i have done,

Select coumn list fom table into newtable where ....

Post #1426743
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse