Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 event log error

Author  Topic 

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2013-04-12 : 07:24:26
im creating an event log and am getting the following error
Msg 102, Level 15, State 1, Line 8
Incorrect syntax near ','.
at this line
"+(DT_STR,6,1252) DATEDIFF("ss",@[System::StartTime], GETDATE())+",

any ideas why i copied it from a tutorial

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2013-04-12 : 07:34:19
try removing " " from "ss"

mohammad.javeed.ahmed@gmail.com
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2013-04-12 : 07:37:45
hi
tried that and still the same error
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2013-04-12 : 07:38:49
is that the full statement?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2013-04-12 : 10:06:58
no this is it
INSERT INTO dbo.SSISLog (EventType,PackageName,TaskName EventCode,EventDescription,PackageDuration,ContainerDuration,InsertCount,UpdateCount,DeleteCount, Host)
VALUES (
'OnPostExecute',
"'+ @[System::PackageName] + '",
"'+ @[System::SourceName] + '",
0,
",
"+(DT_STR,6,1252) DATEDIFF("ss",@[System::StartTime], GETDATE())+",
"+(DT_STR,6,1252)DATEDIFF("ss",@[System::ContainerStartTime], GETDATE())+",
"+(DT_STR,4,1252 )@[User::InsertCount] +",
"+(DT_STR,4,1252 )@[User::UpdateCount] +",
"+(DT_STR,4,1252 )@[User::DeleteCount] +",
"'+@[System::MachineName] +'"
)
"
Go to Top of Page
   

- Advertisement -