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 2012 Forums
 Transact-SQL (2012)
 SP Backup Help...

Author  Topic 

tooba
Posting Yak Master

224 Posts

Posted - 2014-02-01 : 23:49:26
Hi Guys,

I want to know, is there a way I can BackUp all Store Procedure in .txt? I know how to do manually app SP but I want to schedule
a job everyday Backup all SP and create new .txt file. Any help would be great appreciate.

Thank You.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-02-02 : 01:49:13
whats the need for this to be done daily? DOnt you have a version control system like VSS/SVN/TFS?
ANyways the way to so this is to use sys.sql_modules catalog view and create file based on definition column. You can use OPENROWSET or bcp or similar methods to export it to text
see

http://visakhm.blogspot.in/2012/03/advantages-of-using-syssqlmodules-view.html

http://visakhm.blogspot.in/2013/10/different-ways-to-export-sql-server.html


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -