Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
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 June 23rd, 2006, 03:54 PM
Authorized User
 
Join Date: Feb 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to savan_thakkar Send a message via Yahoo to savan_thakkar
Default How to Generate SQL Script alongwith Data

Hi,
I want to generate SQL Script of an SQL Server 2000 database along with the records in all the tables. But I did not find any option for that.
Any help will be heartly appreciated...
Thanks...

Savan
__________________
Savan
 
Old June 26th, 2006, 01:38 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can do this with Mysql, Postgresql but its not a standard feature of MS-SQL. Some external apps may do this. MS only provides the backup/restore option. Or you could write your own process to do this.

 
Old June 29th, 2006, 02:39 PM
Authorized User
 
Join Date: Feb 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to savan_thakkar Send a message via Yahoo to savan_thakkar
Default

Can you please suggest me any tool or any other way I can do this??

Savan
 
Old July 4th, 2006, 01:52 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Off hand I don't know of any tools that do this. I wrote my own once but it was not extensive enough to encompas everything. But I did not retain the code for it, it wasn't complete anyway.

The first step in my stored procedure scripted all the table create scripts into a text file (without primary key or identities).
The next step created insert statements from the data into another file.
Then the indexes and foreign keys were created into a seperate file but you could put it all in one with go statments between.
Then another step created all the stored procedures from a given database.
The procedure could be run for multiple databases to get the rest of the info.

It was a bit incomplete and bug prone and needed tweeks to make it work. It would take a lot of work to cover all possible permutations I just went far enough to cover my needs.

To do this process you have to read the info from the system tables.
It requires reasonably advanced knowledge of MSSQL to do.









Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Source Tools to generate XML from SQL data ethanhunt XML 0 May 7th, 2008 02:55 PM
Generate SQL Script shaileshk SQL Server 2000 3 September 6th, 2005 03:12 PM
How to generate SQL querries mistry_bhavin General .NET 1 August 12th, 2004 11:42 AM
How to generate data reports gandhichirag Pro VB 6 0 July 5th, 2004 08:08 AM





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