Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 August 24th, 2005, 09:58 AM
Authorized User
 
Join Date: May 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shaileshk Send a message via Yahoo to shaileshk
Default Generate SQL Script

Hi


i have one problem in database to creating SQL script

i want to copy table strucure with table data


Pls help

shailesh kavathiya

shailesh kavathiya
http://www.kavathiya.20m.com
__________________
Shailesh Kavathiya
===============
Good Morning SMS
 
Old August 24th, 2005, 10:31 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you want to copy table structure and data across different databases or SQL Servers? If yes then use DTS,

Right click on your table in the Enterprise Manager-->All Tasks-->
Export Data

Then follow the DTS import/export wizard, select source datasource and destination data source, use copy tables and views (this will not copy any primary keys or indexes define on that table)..if you want to copy all the information select "Copy objects and data between SQL
Server databases". In the following wizrd uncheck copy all the objects and select only table you wanted to copy.

complete the wizard.


This will only work if you are transfering table between different databases or different sql server. if you want to copy the table into the same database

SELECT * INTO newtable
FROM existingtable

OR

You can generate sql script for the existing table, create a new table from that script and use the following SQL

INSERT INTO newtable
FROM existingtable





 
Old August 24th, 2005, 10:51 AM
Authorized User
 
Join Date: May 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shaileshk Send a message via Yahoo to shaileshk
Default

Hi

Thanks for reply

I want to upload my existing database to my web site server

in my server i dont have right to export database
only i have script file upload right

so only *.sql file upload in my MS Sql web server

help me how to create Script file with table data

thanks


shailesh kavathiya
http://www.kavathiya.20m.com
 
Old September 6th, 2005, 03:12 PM
Registered User
 
Join Date: Sep 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

shaileshk,
I understand you wanting to upload a .sql file, but when you get it to the server, how are you going to execute it? I think I know what you want to do, but I need more information...
For your database on the website, what do you use to access it, Enterprise Manager or Query Analyzer?

MecurioJ.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Generate SQL Script alongwith Data savan_thakkar SQL Server 2000 3 July 4th, 2006 01:52 PM
how generate ThePhileII-Load.sql once chinahyf BOOK: ASP.NET Website Programming Problem-Design-Solution 2 December 25th, 2005 09:18 PM
How to generate SQL querry ? mistry_bhavin ADO.NET 1 August 12th, 2004 01:15 PM
How to generate SQL querries mistry_bhavin General .NET 1 August 12th, 2004 11:42 AM





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