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
 General SQL Server Forums
 New to SQL Server Programming
 Managing SQL Scripts etc

Author  Topic 

abuhassan

105 Posts

Posted - 2008-10-23 : 08:20:11
Hi

I was wondering what is the best way to manage all the sql scripts that are created etc, and do version control on the scripts etc, i have a database i have developed over time been adding scripts for procedures, views etc how can i manage them all? how can i generate all the scripts as an out put for each function, procedure, view, tables etc as individual files so that i can manage each script?
what would be the best way? is there a sort fo a best practise in doing that?

basically i wanted to generate all the scripts in seperate files with the headings of the procedure and function as the file names e.g. "validationProc" is the name of the validation stored procedure i want to generate SQL script in file with thats as the file name i.e. "validationProc", i want to do this for all the scripts, tables, views etc,?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 08:33:50
the best way is to use a version control tool like VSS or SVN where you willstore all scripts and make changes and add it to central repository before applying. this enables you to see versions of changes from repository and even get an earlier version whenever you want.We use Visual Source Safe (VSS) for that.
Go to Top of Page

abuhassan

105 Posts

Posted - 2008-10-23 : 08:39:58
How do i get all the individual scripts i.e. "basically i wanted to generate all the scripts in seperate files with the headings of the procedure and function as the file names e.g. "validationProc" is the name of the validation stored procedure i want to generate SQL script in file with thats as the file name i.e. "validationProc", i want to do this for all the scripts, tables, views etc,?"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 09:54:49
if you dont have script files with you, why not script all of them from sql mangement studio object explorer/enterprise manager?
Go to Top of Page

abuhassan

105 Posts

Posted - 2008-10-23 : 12:08:44
do i have to do them individualy is there no way of writing a script that will do all that for you?
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-10-23 : 12:34:38
For SQL 2000, you can script them all to one file or one file per object within Enterpise Manager. Right click on the object go to all taks, generate SQL scripts. You can select any objects you want. On the options tab, select one file for all or one file per object. Just installed SQL 2005 TODAY and don't want to mislead you on that version but I'm sure it's doable there as well. HTH.

Terry
Go to Top of Page
   

- Advertisement -