Solved

Using sp_executeSQL in SQL 2008 Express give missing module error

Posted on 2011-02-20
8
2,083 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Expert Comment

by:AkAlan
ID: 34938913
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
ID: 34939244
>>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:Ephraim Wangoya
ID: 34940042
use
dbo.sp_executesql
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:MickyMc
ID: 34940941
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
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 34942813
>>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
ID: 34942849
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
ID: 34949030
Just that the user belongs to the Public role.
0
 

Author Closing Comment

by:MickyMc
ID: 34956569
thanks all
0

Featured Post

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

635 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