472,371 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

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_IDENTIFIER 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_PROCEDURE_EVENTS_vb,
Line 1
A .NET Framework error occurred during execution of user defined
routine or aggregate 'ctrd_DDL_PROCEDURE_EVENTS_vb':
System.UnauthorizedAccessException: Access to the path 'c:
\server_login.log' is denied.
System.UnauthorizedAccessException:
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize, FileOptions
options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append,
Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at VbTriggers.Triggers.trigger_DDL_PROCEDURE_EVENTS()
..
The statement has been terminated.

Can anyone assist please? :(

Many thanks in advance,
Lara

Feb 20 '07 #1
3 5932
Further to my last post, there is no c:
\server_login.log 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.googlegr oups.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_PROCEDURE_EVENTS_vb,
Line 1
A .NET Framework error occurred during execution of user defined
routine or aggregate 'ctrd_DDL_PROCEDURE_EVENTS_vb':
System.UnauthorizedAccessException: Access to the path 'c:
\server_login.log' is denied.
System.UnauthorizedAccessException:
at System.IO.__Error.WinIOError(Int32 errorCode, String
maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess
access, Int32 rights, Boolean useRights, FileShare share, Int32
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String
msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize, FileOptions
options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append,
Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at VbTriggers.Triggers.trigger_DDL_PROCEDURE_EVENTS()
.
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_IDENTIFIER 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_PROCEDURE_EVENTS_vb,
Line 1
A .NET Framework error occurred during execution of user defined
routine or aggregate 'ctrd_DDL_PROCEDURE_EVENTS_vb':
System.UnauthorizedAccessException: Access to the path 'c:
\server_login.log' 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****@sommarskog.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
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...
3
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...
4
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...
0
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...
1
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...
2
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...
5
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...
1
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...
7
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...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.