473,738 Members | 8,397 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 6044
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
1326
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
22144
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
9560
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
4276
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
9712
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
4279
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
3660
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
13668
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
9712
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
8969
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
8788
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,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
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...
0
4570
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
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.