Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2005, 06:22 PM
aji aji is offline
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to create insert sql

Hi.

I need to select data from a table and create a sql file with the insert statements using the data selected , What's the best way to do this?
 
Old June 13th, 2005, 05:53 PM
Authorized User
 
Join Date: Apr 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why? Particularly if there is a large volume of data, most databases have facilities to generate and consume something like a deliited text file rather efficiently. Unless you have a tool that generates such a script (Toad may), this woul require some development effort on your part.

Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC
 
Old June 14th, 2005, 12:15 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Do you want to create a script of insert statments based on current data in a table? If so, supply the table structure.

 
Old June 23rd, 2005, 06:39 PM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In MsSQLServer
Try SELECT * FROM TABLE1 FROM TABLE1 WHERE 1=2

 
Old June 23rd, 2005, 06:41 PM
Registered User
 
Join Date: Jun 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

By MS SQL SERVER
Try

select * into table2 from table1 where 1=2






Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i create VBA code to Insert a Module? stylin99 Excel VBA 1 January 18th, 2008 10:01 PM
need help w/create trigger by an insert operation jnt SQL Server 2000 2 December 14th, 2006 07:31 PM
How to create insert statements? mooreeasyvibe Excel VBA 0 August 31st, 2005 06:00 AM
What is the syntax of create table and insert stat method Access 1 June 27th, 2005 02:29 PM
Create Insert Trigger byron SQL Server 2000 6 November 19th, 2003 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.