all groups > sql server programming > june 2007 >
You're in the

sql server programming

group:

IS there something wrong with this proc?


Re: IS there something wrong with this proc? Aaron Bertrand [SQL Server MVP]
6/13/2007 4:55:13 PM
sql server programming:
(a) do NOT name stored procedures with sp_ prefix
(b) are you sure @Event_ID is valid? How do you know "nothing happens"? Do
you see a 1 row(s) affected message, a 0 row(s) affected message, or no
message?
(c) does this table have any triggers?

--
Aaron Bertrand
SQL Server MVP
http://www.sqlblog.com/
http://www.aspfaq.com/5006




[quoted text, click to view]

Re: IS there something wrong with this proc? Aaron Bertrand [SQL Server MVP]
6/13/2007 5:01:46 PM
[quoted text, click to view]

To that end, is it possible that there is a copy of this stored procedure in
the master database?

IS there something wrong with this proc? Antonio
6/13/2007 8:40:23 PM
This is really weird but for some reason when i run this nothing
happens except for the message saying it was added. would really
appreciate someone taking a look at this. Thanks.

USE [EventCalendar]
GO
/****** Object: StoredProcedure [dbo].[sp_EditSingleEvent] Script
Date: 06/13/2007 15:15:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[sp_EditSingleEvent]
-- Add the parameters for the stored procedure here
@apeDate smalldatetime,
@apEvent nvarchar(250),
@who nvarchar (50),
@Event_ID int,
@message nvarchar (200)OUTPUT,
@_type int

AS

Begin
Set @Message = 'Hasnt added yet'
UPDATE apEvent
SET apeDate=@apeDate, apEvent=@apEvent, Who=@Who, _type=@_type
WHERE Event_ID = @Event_ID
Set @message = 'its added'
END
Re: IS there something wrong with this proc? Vt
6/13/2007 9:46:36 PM
Hi

You not printing the @message variable,

USE [EventCalendar]
GO
/****** Object: StoredProcedure [dbo].[sp_EditSingleEvent] Script
Date: 06/13/2007 15:15:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[sp_EditSingleEvent]
-- Add the parameters for the stored procedure here
@apeDate smalldatetime,
@apEvent nvarchar(250),
@who nvarchar (50),
@Event_ID int,
@message nvarchar (200)OUTPUT,
@_type int

AS

Begin
Set @Message = 'Hasnt added yet'
UPDATE apEvent
SET apeDate=@apeDate, apEvent=@apEvent, Who=@Who, _type=@_type
WHERE Event_ID = @Event_ID
Set @message = 'its added'



print @message



END

Regards
Vt
Knowledge is power;Share it
http://oneplace4sql.blogspot.com

[quoted text, click to view]

AddThis Social Bookmark Button