Click here to Skip to main content
15,906,295 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a multiline command
SQL
ALTER DATABASE smso SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO 
restore database smso from disk=@disk with replace ,move 'smso' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\smso.mdf', move 'smso_log' to 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\smso_log.ldf'
GO
ALTER DATABASE smso SET MULTI_USER


i want to write a SP for this command
problem is, if i create a SP then it reads only first line of command ie (ALTER DATABASE smso SET SINGLE_USER WITH ROLLBACK IMMEDIATE), not the whole command,
help me to write
Posted
Comments
hitech_s 8-Oct-11 3:08am    
create PROCEDURE SaveTwoTable
(
//parameters you want to pass to stored procedure
)
AS
BEGIN
//your queries
END
indrish 8-Oct-11 9:00am    
Means ur Concept is that multiple users can restore the same database.
if this, then please u used the Users id.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900