Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using sp_executeSQL in SQL 2008 Express give missing module error

Posted on 2011-02-20
8
Medium Priority
?
2,151 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
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

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 1500 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

704 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