473,796 Members | 2,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Server 2005 MSDB Access

On my SQL Server, I have a stored proc called 'sp_exec_job' that
simply starts a job:

EXEC [msdb].[dbo].sp_start.job @JOB_NAME

When I run this from Management Studio, it works fine. Yea.

But, when I try to execute sp_exec_job from my .NET (C#) code (on the
same server as the SQL DB), I get the following error:

System.Data.Sql Client.SqlExcep tion: Could not find server 'msdb' in
sysservers. Execute sp_addlinkedser ver to add the server to
sysservers.
at System.Data.Sql Client.SqlConne ction.OnError(S qlException exception,
Boolean breakConnection )
at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)

Any ideas?
Jun 27 '08 #1
3 1894
Sorry, the above message is not correct (I pasted the wrong message).
This is the error I am getting...

System.Data.Sql Client.SqlExcep tion: EXECUTE permission denied on
object 'sp_start_job', database 'msdb', schema 'dbo'.
at System.Data.Sql Client.SqlConne ction.OnError(S qlException exception,
Boolean breakConnection )
at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)
Jun 27 '08 #2
On Apr 15, 10:20*am, cap...@gmail.co m wrote:
Sorry, the above message is not correct (I pasted the wrong message).
This is the error I am getting...

System.Data.Sql Client.SqlExcep tion: EXECUTE permission denied on
object 'sp_start_job', database 'msdb', schema 'dbo'.
at System.Data.Sql Client.SqlConne ction.OnError(S qlException exception,
Boolean breakConnection )
at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje *ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)
Never mind, i just gave my SQL user owner permissions on the msdb
database. Duh. Sorry to waste anyone's time.
Jun 27 '08 #3
Also, do not name your own stored procedure like "sp_xxxxxxx ", which is used
for system stored procedures.

<ca****@gmail.c omwrote in message
news:ae******** *************** ***********@f36 g2000hsa.google groups.com...
On Apr 15, 10:20 am, cap...@gmail.co m wrote:
Sorry, the above message is not correct (I pasted the wrong message).
This is the error I am getting...

System.Data.Sql Client.SqlExcep tion: EXECUTE permission denied on
object 'sp_start_job', database 'msdb', schema 'dbo'.
at System.Data.Sql Client.SqlConne ction.OnError(S qlException exception,
Boolean breakConnection )
at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion
exception, Boolean breakConnection )
at
System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje *ct
stateObj)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject
stateObj)
Never mind, i just gave my SQL user owner permissions on the msdb
database. Duh. Sorry to waste anyone's time.

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4482
by: John Mullan | last post by:
Hi I have a problem creating a backup in SQL Server 6.5. Although, the backup produced does restore ok, I want to stop this error message appearing everytime I make a backup. The error message is: " Can't allocate space for object 'sysbackupdetail' in database 'msdb' because the 'default' segment is full. If you ran out of space in Syslogs, dump the transaction log. Otherwise, use ALTER DATABASE or sp_extendsegment to increase the size...
0
2821
by: Chris Halcrow | last post by:
Hi I've spent ALL DAY trying to re-install SQL Server 2000 on Windows XP. I continually get the error 'cannot configure server' just at the end of the installation. I've tried the following: - Removing SQL server from 'Program Files' folder following an unsuccessful attempt to re-install, and entirely removing the registry entry 'HKEY_CURRENT_USER > SOFTWARE > Microsoft > MSSQLServer', as well as the corresponding entry under...
17
9240
by: Danieltbt05 | last post by:
just installed SQL server 2000 and using my client , i can't locate the server. I used SQL query analyzer to search but no servers were found. Error message is as below Server : Msg17,level 16, state1 SQL server does not exist or denied access.
21
28052
by: Peter Nurse | last post by:
I have just upgraded to SQL Server 2005 from SQL Server 2000. In Microsoft SQL Server Management Studio, when I click on database properties, I receive the following error:- Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation. (Microsoft SQL Server, Error: 468)
2
3582
by: PFI | last post by:
Hi, I recently installed SQL Server 2005 Enterprise Edition (9.0.1399) and I have problems on queries concerning system file manipulation... For example, when I try to increase the Log File of MSDB database : ALTER DATABASE msdb MODIFY FILE (NAME = 'MSDBLog', SIZE = 50MB)
1
5723
by: teddysnips | last post by:
Below is the script of a Job called "eFIMS_SendEmail" that I wish to run. The intention is that every day of the week the job will execute a SPROC at timed intervals. For example, the SundayRun schedule will run once every 1 hours from 00:30:00 to 23:59:59 However, the clients have stated that they want an interface to this to enable them easily to change the start time and frequency interval for each day. It's an easy matter for me...
2
1580
by: David C. Barber | last post by:
This updates a previous post. We have updated our SQL Server 2000 to new hardware by reinstalling SQL Server 2K to a new, dual processor server. We performed a full SQL backup of the entire server, and did a full restore onto the new hardware, which has the same server name and IP address. One difference has bitten us, however. When I perform an sp_who standard procedure call in VB6, the dbname field comes back with our database...
2
21135
by: m19peters | last post by:
We have a script that I had to rework a little bit for 2005 that does a full backup for every database on the server... For some reason on some nights the script does not backup all databases... Its like it skips over it for some reason... Output of the script below on the night in question was: Executed as user: NT AUTHORITY\SYSTEM. master (Message 0) Status is ONLINE dbname / dbdevice = master / SQLBUmaster (Message 0) Processed...
3
3262
by: Lee T. Hawkins | last post by:
I am having a number of problems over the last two full days trying to get an ASP.NET 2.0 application to connect to a SQL Server 2005 database... First off, I built this application w/ Visual Studio 2005 SP1 and had it working perfectly on my Windows XP machine on SQL Server 2005 Express. I decided to publish this application to a test development server (with both the SQL and IIS servers on the same box) running on: Windows Server...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10190
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4122
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.