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 4, 2013 11:23 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, April 27, 2014 7:55 PM
Points: 218, Visits: 556
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 5, 2013 1:46 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, April 27, 2014 7:55 PM
Points: 218, Visits: 556
I have acheved it using a new table instead of view

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


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 9:56 AM
Points: 7,120, Visits: 13,491
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 5, 2013 4:36 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Sunday, April 27, 2014 7:55 PM
Points: 218, Visits: 556
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