Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Trigger Syntax
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00845644
Message ID:
00845660
Views:
20
This message has been marked as the solution to the initial question of the thread.
>set @tcAction=" "

Use single quotes.

-Mike

>I'm missing something in this trigger defination, if I click the Check Syntax button I get a message that everything is OK, but when I click the apply button, I'm getting a message saying:
>
>---------------------------
>Microsoft SQL-DMO (ODBC SQLState: 42S22)
>---------------------------
>Error 2714: Invalid column name ' '.
>---------------------------
>OK
>---------------------------
>
>
>Here is my tigger code I'm trying to put in.
>
>
>CREATE TRIGGER [Audit_Update] ON dbo.meetings
>  FOR UPDATE
>AS
>declare @tcAction varchar(500)
>set @tcAction=" "
>
>if update(begintime) or update(RoomID)
>     begin
>	if update(Begintime)
>                            set @tcAction='Scheduled Time/Date Changed  '
>	if Update(RoomID)
>                            set @tcAction=@tcAction+'Room Changed'
>	  INSERT INTO meeting_Audit (meetingnumber,begintime,endtime,patientID,roomid,actualRoomID,ScheduledBy,BlockMember,LastAuditForm,LastAuditBy)
>                            (SELECT meetingnumber,begintime,endtime,patientID,roomid,actualRoomID,ScheduledBy,BlockMember,@tcAction,dbo.get_login_name()
>		from deleted)
>    end
>
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform