You are here: Re: Stored Procedure, error when executing ( « MsSQL Server « IT news, forums, messages
Re: Stored Procedure, error when executing (

Posted by Erland Sommarskog on 02/20/07 22:39

Goog79 (rachellara1979@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, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация