HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

how to create backup for stored procedure,trigger and functions of a database in sql server 2008?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
storedtrigger2008createserversqlproceduredatabaseforhow

Problem

I'm having 2 databases in 2 different servers(.246 and .252). I need to create backup for all stored procedures, triggers and function from 252 server and restore it in 246 server.database name in both server is transcredit. around 500SP are there in 252 server. can anyone help me?

Solution

I guess you have framed your question to somewhat misleading.

You want to script out all stored procedures, triggers and functions from one server and create them on the new server.

Option 1 : USING SSMS

OPTION 2 : USING TSQL - sys.sql_modules with sys.objects

Context

StackExchange Database Administrators Q#67951, answer score: 6

Revisions (0)

No revisions yet.