Createing a Stored Proc from a Stored Proc

  • (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

  • 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

  • Thanks for the followup and good work.

    Steve Jones

    steve@dkranch.net

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply