Solved

Using sp_executeSQL in SQL 2008 Express give missing module error

Posted on 2011-02-20
8
1,790 Views
Last Modified: 2012-05-11
Hi there,

I compiling a SPROC that calls sys.sp_executeSQL in SQL 2008 Express edition. It compiles but I get this error...

The module 'InsertRecords' depends on the missing object 'sys.sp_executeSQL'. The module will still be created; however, it cannot run successfully until the object exists.

If I look at Sys, I cant see the sproc there any ideas. Please dont tell me this is an Express issue and thats its only available in the professional edition...

thanks M
0
Comment
Question by:MickyMc
8 Comments
 
LVL 6

Expert Comment

by:AkAlan
Comment Utility
I'm looking at SQL 2008 and I don't see sys.sp_executeSQL either so that probably isn't the issue.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
>>I compiling a SPROC that calls sys.sp_executeSQL in SQL 2008 Express edition<<
That is because it is called sp_executesql, just remove the "sys." and you should be fine.
0
 
LVL 32

Expert Comment

by:ewangoya
Comment Utility
use
dbo.sp_executesql
0
 

Author Comment

by:MickyMc
Comment Utility
sorry ewanqoya, I used dbo but it didnt work. I can get it to work if I use Master.sys.sp_executesql but I havnt seen this syntax used in any of the examples?  Have I to grant permissions or something
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
Comment Utility
>>I can get it to work if I use Master.sys.sp_executesql <<
Please read what I stated:
That is because it is called sp_executesql, just remove the "sys." and you should be fine.

Incidentally it is not "Master", but "master".   This is important in case you have a CS install.

You need to verify that you have access/permission to sp_executesql in the master database.
0
 

Author Comment

by:MickyMc
Comment Utility
Yes acperkins. This is what I also think is the problem. What rights roles do I need to give to my user to use the sp_executesql. My user has a role of dbo. Thanks
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
Just that the user belongs to the Public role.
0
 

Author Closing Comment

by:MickyMc
Comment Utility
thanks all
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now