Solved

Using sp_executeSQL in SQL 2008 Express give missing module error

Posted on 2011-02-20
8
1,979 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

735 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