December 18, 2001 at 8:52 am
(SQL 2000 SP1)
Basically I have been asked to find a way to create a new stored procedure in a different database.
I have got as far as creating a stored procedure from a stored procedure using the following code.
CREATE procedure b as
declare @SQLString nvarchar(500)
set @SQLString =N'CrEATE procedure a as select * from sysfiles'
EXECUTE sp_executesql @SQLString
But I need the stored procedure to be created in a different database, Any ideas anyone?
Steven
December 18, 2001 at 8:56 am
Found the solution just after posting the
question
If I execute the sp_executesql command from the destinaction database it works eg.
EXECUTE northwind..sp_executesql @SQLString
Steven
December 18, 2001 at 10:04 am
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy