locked
Compiling a Stored Proc with sp_executeSQL give missing object 'sys.sp_executeSQL Error RRS feed

  • Question

  • Hi there,

    I have MS SQL Server 2008 Express and I have a sproc that uses sp_executeSQL.

    When I compile it, I get this error.  -

    missing object 'sys.sp_executeSQL'

    Any ideas on this. Is the SP only for the professional or can I add it into Express and I cant see it in the list of Sprocs under SYS.

    thanks Doriemik

    Sunday, February 20, 2011 8:26 PM

All replies

  • What will happen if you call it without sys, e.g.

    execute sp_ExecuteSQL @Command, @ParametesDefinition, @Parameters ?


    Premature optimization is the root of all evil in programming. (c) by Donald Knuth

    Naomi Nosonovsky, Sr. Programmer-Analyst

    My blog
    Sunday, February 20, 2011 9:27 PM
  • Hi,

    Have you got any progress?

    Based on my tests, I could run sys.sp_executeSQL in my stored procedure within SQL Server 2008 Express Edition. Could you please post your stored procedure script here?

    Here is a sample code that I use:

    CREATE PROC dbo.sp1
    AS
    BEGIN
    EXEC sys.sp_executeSQL N'SELECT @@VERSION'
    END;
    GO
    
    

    Please let us know if you have any question.

     


    Best Regards,
    Chunsong Feng

    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, February 28, 2011 10:20 AM