Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Generate individual scripts for DB objects

Author  Topic 

marcovan
Starting Member

2 Posts

Posted - 2009-01-13 : 05:19:25
Hi all,

I am trying to script all the Db objects (tables, stored procs, views etc) so that I can add them to our source control. I want to have individual files for each object.

My issue is when scripting the tables. When I did this in SQL Server 2000 (Enterprise Manager), and I selected individual file per object option - It created three files for each table: Create table (.Tab), Foreign key (.fky) and constraints (.kci).

Is there any way to do this in Management Studio (2005) ? It seems to throw everything into the one file but ideally I would like it in three separate files as mentioned above.

Thanks for any help you can provide.

Marc

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-13 : 10:16:56
Are you looking for this by Peso?

http://weblogs.sqlteam.com/peterl/archive/2008/10/24/How-to-script-out-all-your-objects-one-per-file.aspx
Go to Top of Page

marcovan
Starting Member

2 Posts

Posted - 2009-01-13 : 11:12:40
quote:
Originally posted by sodeep

Are you looking for this by Peso?

http://weblogs.sqlteam.com/peterl/archive/2008/10/24/How-to-script-out-all-your-objects-one-per-file.aspx



Thanks for the suggestion. Not quite what Im looking for as I don't think it scripts tables.....

I've managed to find a console app called 'ScriptDb'.
http://www.codeplex.com/ScriptDB

This seems to be what Im looking for as it scripts foreign keys, constraints and indexes into separate files for each table.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-13 : 11:39:53
My code does not script tables yet.
Views, stored procedures, functions and triggers.

Haven't had time to add tables.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -