473,387 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 6007
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...

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.