SQL Server - copy stored procedures from one db to another

Oak picture Oak · May 22, 2012 · Viewed 151k times · Source

I am new to SQL, and what I needed to do was to combine 2 .mdf databases into one. I did that using SQL Server 2008 Manager - Tasks > Import/Export tables.The tables and views were copied successfully, but there are no Stored procedures in the new database. Is there any way to do that?

Answer

Jaimal Chohan picture Jaimal Chohan · May 22, 2012
  • Right click on database
  • Tasks
  • Generate Scripts
  • Select the objects you wish to script
  • Script to File
  • Run generated scripts against target database