dbTalk Databases Forums  

Scripting DataBase

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Scripting DataBase in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
HLong
 
Posts: n/a

Default Scripting DataBase - 07-04-2005 , 12:50 PM






Can someone explain how could I crate a script of a database? I want to save
a Table from a database, so I could play with it and be able to restore it
back as required. I have seen some databases saved as scripts, like
Northwin.sql. I have look for examples on how to create these scripts of the
tables or databases, but I haven't found anything.

Reply With Quote
  #2  
Old   
Andrew J. Kelly
 
Posts: n/a

Default Re: Scripting DataBase - 07-04-2005 , 01:03 PM






You open Enterprise Manager and right click on the database node and choose
"All Tasks" then "Generate SQL Script". From there you can choose which
objects to script and what options you need.

--
Andrew J. Kelly SQL MVP


"HLong" <HLong (AT) discussions (DOT) microsoft.com> wrote

Quote:
Can someone explain how could I crate a script of a database? I want to
save
a Table from a database, so I could play with it and be able to restore it
back as required. I have seen some databases saved as scripts, like
Northwin.sql. I have look for examples on how to create these scripts of
the
tables or databases, but I haven't found anything.



Reply With Quote
  #3  
Old   
HLong
 
Posts: n/a

Default Re: Scripting DataBase - 07-05-2005 , 11:55 AM



Yes, it works fine. However, I can't fine a way on scripting the data with
INSERT staments so the entire table or datable could be recreated. How could
I do this?

"Andrew J. Kelly" wrote:

Quote:
You open Enterprise Manager and right click on the database node and choose
"All Tasks" then "Generate SQL Script". From there you can choose which
objects to script and what options you need.

--
Andrew J. Kelly SQL MVP


"HLong" <HLong (AT) discussions (DOT) microsoft.com> wrote in message
news:A64615DA-88EB-4FE1-9438-21341262C15C (AT) microsoft (DOT) com...
Can someone explain how could I crate a script of a database? I want to
save
a Table from a database, so I could play with it and be able to restore it
back as required. I have seen some databases saved as scripts, like
Northwin.sql. I have look for examples on how to create these scripts of
the
tables or databases, but I haven't found anything.




Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Scripting DataBase - 07-05-2005 , 12:26 PM



There are tools out there to do this and young
Vyas(http://vyaskn.tripod.com/code.htm#inserts) has a series of statements
you can run also. It also begs the question that if you want to take the
structure AND the data then would a BACKUP not be more appropriate?



--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"HLong" <HLong (AT) discussions (DOT) microsoft.com> wrote

Quote:
Yes, it works fine. However, I can't fine a way on scripting the data
with
INSERT staments so the entire table or datable could be recreated. How
could
I do this?

"Andrew J. Kelly" wrote:

You open Enterprise Manager and right click on the database node and
choose
"All Tasks" then "Generate SQL Script". From there you can choose which
objects to script and what options you need.

--
Andrew J. Kelly SQL MVP


"HLong" <HLong (AT) discussions (DOT) microsoft.com> wrote in message
news:A64615DA-88EB-4FE1-9438-21341262C15C (AT) microsoft (DOT) com...
Can someone explain how could I crate a script of a database? I want to
save
a Table from a database, so I could play with it and be able to restore
it
back as required. I have seen some databases saved as scripts, like
Northwin.sql. I have look for examples on how to create these scripts
of
the
tables or databases, but I haven't found anything.






Reply With Quote
  #5  
Old   
Thomas
 
Posts: n/a

Default Re: Scripting DataBase - 08-24-2005 , 07:26 AM



Try www.sqlscripter.com to generate T-SQL data scripts.
Its free


"HLong" wrote:

Quote:
Yes, it works fine. However, I can't fine a way on scripting the data with
INSERT staments so the entire table or datable could be recreated. How could
I do this?

"Andrew J. Kelly" wrote:

You open Enterprise Manager and right click on the database node and choose
"All Tasks" then "Generate SQL Script". From there you can choose which
objects to script and what options you need.

--
Andrew J. Kelly SQL MVP


"HLong" <HLong (AT) discussions (DOT) microsoft.com> wrote in message
news:A64615DA-88EB-4FE1-9438-21341262C15C (AT) microsoft (DOT) com...
Can someone explain how could I crate a script of a database? I want to
save
a Table from a database, so I could play with it and be able to restore it
back as required. I have seen some databases saved as scripts, like
Northwin.sql. I have look for examples on how to create these scripts of
the
tables or databases, but I haven't found anything.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.