Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
T-SQL (SS2K8)
»
t-sql 2008 r2 error message
t-sql 2008 r2 error message
Rate Topic
Display Mode
Topic Options
Author
Message
wendy elizabeth
wendy elizabeth
Posted Sunday, January 27, 2013 9:13 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Wednesday, February 13, 2013 7:58 AM
Points: 137,
Visits: 159
This is the first time I am writing a trigger. I am getting the following error message on a sql server 2008 r2 database.
"Msg 102, Level 15, State 1, Procedure eRPT_Transaction_Audit, Line 15 Incorrect syntax near 'TRY'. I do not know what is wrong can you tell me what is wrong with the following sql:
USE DEV
GO
CREATE TRIGGER [dbo].[eRPT_Transaction_Audit] ON [dbo].[eRPT_Transaction_Tracking]
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
INSERT INTO [dbo].[eRPT_Transaction_Audit] (Package_name, Received_Date, Download_Date,
Acknowledge_Date, Response_Docs_Date, Error_Report_Date,
FDR_Report_Date, Close_Date, File_Location,Response_Code)
SELECT Package_name, Received_Date, Download_Date,
Acknowledge_Date, Response_Docs_Date, Error_Report_Date,
FDR_Report_Date, Close_Date, File_Location,Response_Code FROM INSERTED
END TRY
END
GO
also note in the trigger, I am not listing the identity key for the table
Post #1412134
ALZDBA
ALZDBA
Posted Sunday, January 27, 2013 1:35 PM
SSCertifiable
Group: General Forum Members
Last Login: Friday, May 17, 2013 6:25 AM
Points: 6,861,
Visits: 8,045
there is no catch block in your trigger. Is that how you intend it ? If so, don't use the try.
Johan
Jul 13
Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere
-
How to post Performance Problems
-
How to post data/code to get the best help
-
How to prevent a sore throat after hours of presenting ppt ?
"press F1 for solution", "press
shift
+F1 for urgent solution"
Need a bit of Powershell? How about
this
Who am I ?
Sometimes this is me
but
most of the time this is me
Post #1412148
Sean Lange
Sean Lange
Posted Monday, January 28, 2013 7:48 AM
SSCrazy Eights
Group: General Forum Members
Last Login: Friday, May 17, 2013 8:46 AM
Points: 8,547,
Visits: 8,204
Please don't cross post. direct all replies here.
http://www.sqlservercentral.com/Forums/Topic1412099-392-1.aspx
_______________________________________________________________
Need help? Help us help you.
Read the article at
http://www.sqlservercentral.com/articles/Best+Practices/61537/
for best practices on asking questions.
Need to split a string? Try Jeff Moden's
splitter
.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Post #1412442
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.