SQL SERVER backup database stored procedures, backup data stored procedures
SQL Server batch export Stored Procedure
In the query analyzer, right-click "database --" and choose "task". In the pop-up menu, select "generate script"
-- "" Next "--" select the database in which you want to store the stored procedure --"
"Next" -- select "Stored Procedure" and click "Next" --"
Select the name of the stored procedure you want to generate and click "Next".
Select save script to file, and select Save path --"
There is also a direct implementation through SQL statements:
Set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo alter procedure [dbo]. [dbBak] as begin declare @ sqlCommand NVARCHAR (1000) DECLARE @ dateTime NVARCHAR (20) SELECT @ dateTime = REPLACE (CONVERT (VARCHAR, GETDATE (), 111 ),'/', '') + REPLACE (CONVERT (VARCHAR, GETDATE (), 108), ':','') SET @ sqlCommand = 'backup DATABASE BLNBusyData to disk = 'd: \ DataBaseBakUp \ bln _ '+ @ dateTime + '. BAK ''' EXECUTE sp_executesql @ sqlCommandEND