473,782 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Procedure, error when executing (

Hi everyone,

first time here, so I'm sorry if this has been covered already ages
ago. :(

I am trying to learn T-SQL and Stored Procedures and bought the book
on these topics by Djan Sunderic, Publisher McGraw Hill/Osborne. I'm
already stuck on my first Stored Procedure and getting error messages
that I cannot understand. I've already tried Google and Microsoft
online to no avail. I do have the .NET Framework on my system and use
it for programming in C# sometimes and by the looks of the error, it's
something to do with that? Please note I am only using SQL Server
Express.

Here is the first Stored Procedure:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO

CREATE PROCEDURE ap_Hello
AS
BEGIN
SET NOCOUNT ON;

SELECT 'Hello world'
SELECT * from dbo.EqType
END
GO

The error in its entirety is this:

Msg 6522, Level 16, State 1, Procedure ctrd_DDL_PROCED URE_EVENTS_vb,
Line 1
A .NET Framework error occurred during execution of user defined
routine or aggregate 'ctrd_DDL_PROCE DURE_EVENTS_vb' :
System.Unauthor izedAccessExcep tion: Access to the path 'c:
\server_login.l og' is denied.
System.Unauthor izedAccessExcep tion:
at System.IO.__Err or.WinIOError(I nt32 errorCode, String
maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize, FileOptions
options)
at System.IO.Strea mWriter.CreateF ile(String path, Boolean append)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append,
Encoding encoding, Int32 bufferSize)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append)
at VbTriggers.Trig gers.trigger_DD L_PROCEDURE_EVE NTS()
..
The statement has been terminated.

Can anyone assist please? :(

Many thanks in advance,
Lara

Feb 20 '07 #1
3 6045
Further to my last post, there is no c:
\server_login.l og file. Where is it supposed to be and how would I
set SQL Server to look there (if this would solve the problem)?

Thanks again everyone!

Feb 20 '07 #2


"Goog79" <ra************ @gmail.comwrote in message
news:11******** **************@ v45g2000cwv.goo glegroups.com.. .
Hi everyone,

first time here, so I'm sorry if this has been covered already ages
ago. :(
The stored proc itself looks fine.

But it's the .NET Framework that's giving the error. You may want to look
to a newsgroup that focuses on NET for more help.

>
I am trying to learn T-SQL and Stored Procedures and bought the book
on these topics by Djan Sunderic, Publisher McGraw Hill/Osborne. I'm
already stuck on my first Stored Procedure and getting error messages
that I cannot understand. I've already tried Google and Microsoft
online to no avail. I do have the .NET Framework on my system and use
it for programming in C# sometimes and by the looks of the error, it's
something to do with that? Please note I am only using SQL Server
Express.

Here is the first Stored Procedure:
The error in its entirety is this:

Msg 6522, Level 16, State 1, Procedure ctrd_DDL_PROCED URE_EVENTS_vb,
Line 1
A .NET Framework error occurred during execution of user defined
routine or aggregate 'ctrd_DDL_PROCE DURE_EVENTS_vb' :
System.Unauthor izedAccessExcep tion: Access to the path 'c:
\server_login.l og' is denied.
System.Unauthor izedAccessExcep tion:
at System.IO.__Err or.WinIOError(I nt32 errorCode, String
maybeFullPath)
at System.IO.FileS tream.Init(Stri ng path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIB UTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileS tream..ctor(Str ing path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize, FileOptions
options)
at System.IO.Strea mWriter.CreateF ile(String path, Boolean append)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append,
Encoding encoding, Int32 bufferSize)
at System.IO.Strea mWriter..ctor(S tring path, Boolean append)
at VbTriggers.Trig gers.trigger_DD L_PROCEDURE_EVE NTS()
.
The statement has been terminated.

Can anyone assist please? :(

Many thanks in advance,
Lara
>--
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com http://www.greenms.com
Feb 20 '07 #3
Goog79 (ra************ @gmail.com) writes:
I am trying to learn T-SQL and Stored Procedures and bought the book
on these topics by Djan Sunderic, Publisher McGraw Hill/Osborne. I'm
already stuck on my first Stored Procedure and getting error messages
that I cannot understand. I've already tried Google and Microsoft
online to no avail. I do have the .NET Framework on my system and use
it for programming in C# sometimes and by the looks of the error, it's
something to do with that? Please note I am only using SQL Server
Express.

Here is the first Stored Procedure:

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFI ER ON
GO

CREATE PROCEDURE ap_Hello
AS
BEGIN
SET NOCOUNT ON;

SELECT 'Hello world'
SELECT * from dbo.EqType
END
GO

The error in its entirety is this:

Msg 6522, Level 16, State 1, Procedure ctrd_DDL_PROCED URE_EVENTS_vb,
Line 1
A .NET Framework error occurred during execution of user defined
routine or aggregate 'ctrd_DDL_PROCE DURE_EVENTS_vb' :
System.Unauthor izedAccessExcep tion: Access to the path 'c:
\server_login.l og' is denied.
Do you get this error when you run the procedure or when you create
it? My guess is for the latter, because this looks like an error from
a DDL trigger. If it happens when you run the procedure, I assume that
there is something interesting in that table or view.

DDL triggers does not come out of the blue. I would guess that this is
a database that came with the book. Why they would include a DDL trigger
that writes to disk, I don't know. But maybe you inherited it from
someone who already had used it for exercises in the book?

There is nothing built-in in SQL Server that would write to this file.

A DDL trigger is a trigger that fires at operations like creating tables,
procedures etc. DDL = Data Definition Language.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 20 '07 #4

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

Similar topics

0
1328
by: M Wells | last post by:
Hi All, I don't know if this is a truly esoteric question, or not, but I'm wondering how (or even if) you handle a timeout on a transaction within a stored procedure executed in a Stored Procedure? A theoretical example of the stored procedure (sadly, I'm not allowed to post the actual code):
3
22146
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my application server can talk to the database. I've determined the failure occurs when the the following statement is executed: cstmt.execute(); (due to the failure of println statements placed afterwards). I get the following error after trying to...
4
9562
by: shyner | last post by:
Hi Everyone, I've been battling this for two days with no luck. I'm using SQL Server 2000. Here's the mystery: I've got a stored procedure that takes a single varchar parameter to determine how the result set is sorted. Here it is: CREATE PROCEDURE spDemo @SortField varchar(30)
0
4278
by: Rhino | last post by:
I've written several Java stored procedures now (DB2 V7.2) and I'd like to write down a few "best practices" for reference so that I will have them handy for future development. Would the experts here agree with the following? Would they add any other points? 1. If the shop standard calls for logging of application errors, a stored procedure should log any error that it encounters immediately upon detecting it and then return to the...
1
9713
by: Raquel | last post by:
This is a stored procedure that resides on Mainframe and gets executed on the client by connecting to the mainframe through DB2 connect. It was executing fine till yesterday when I executed a table change and successfully Rebound the package associated with the stored procedure. Since then, it is giving a strange problem. When the client executes the program that calls the stored procedure SP1, the stored procedure does not get executed...
2
4281
by: Rhino | last post by:
I am getting an sqlcode of -927 when I execute SQL within a COBOL stored procedure in DB2 OS/390 Version 6 on OS/390. I have looked at the error message for that condition and tried everything I could think of to resolve the problem but nothing works. The stored proc is running in the DB2 Stored Procedures Address Space and both the client and the proc have DSNELI linked into their load modules. The client and proc are running in TSO via...
5
3661
by: Timppa | last post by:
Hi, Could anyone help me with my problem ? Environment: Access 2000 and Sql Server 2000. I have a stored procedure as follows: DROP table1 SELECT alias1.field1,alias2.field2,table2.field6 INTO table1
1
13669
by: deepdata | last post by:
Hi, I am trying to fetch data from db2 (express version) database by calling stored procedure. I have tried to use both cursor and for loop but still i am getting error. --======Start procedure============= Create PROCEDURE get_timedout_scripts (
7
9716
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason for this being to stop the user thinking the application has frozen when in fact it is just waiting for a long SP to complete. Another reason for doing it like this is that I also have had a problem in the past where the SP takes longer than the...
0
9641
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
9480
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
10080
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
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6735
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
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.