SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 is too long. Maximum length is 128.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 06/25/2013 :  10:24:43  Show Profile  Reply with Quote
hi
have this sql for an ssis package but getting the following error
Msg 103, Level 15, State 4, Line 1
The identifier that starts with 'INSERT INTO [dbo].[SSISLog]
           ([EventType]
           ,[PackageName]
           ,[TaskName]
           ,[EventCode]' is too long. Maximum length is 128.


here is my code
"INSERT INTO [dbo].[SSISLog]
           ([EventType]
           ,[PackageName]
           ,[TaskName]
           ,[EventCode]
           ,[EventDescription]
           ,[PackageDuration]
           ,[ContainerDuration]
           ,[InsertCount]
           ,[UpdateCount]
           ,[DeleteCount]
           ,[Host])

VALUES
(
'OnPostExecute',
'"+@[System::PackageName]+"', 
'"+@[System::TaskName]+"', 
0,
'"+@[System::SourceDescription]+"',
"+ (DT_STR, 6, 1252)DATEDIFF("ss", @[System::StartTime] , GETDATE() ) + ",  
"+ (DT_STR, 6, 1252)DATEDIFF("ss", @[System::ContainerStartTime] , GETDATE() ) + ", 
411,
2,
12,
'"+ @[System::MachineName] +"'
)
"


anyone any ideas why this is happening

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/25/2013 :  10:30:23  Show Profile  Reply with Quote
where are you putting this statement? in Execute sql task?

you may be better off creating a variable and setting this as the expression for it and set its EvaluateAsExpression property true

Then in Execute sql task for the SourceType use Variable option and map it to above created variable

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 06/25/2013 :  10:33:09  Show Profile  Reply with Quote
ya putting it into execute task. have never ever done this before and was following the following tutorial
http://consultingblogs.emc.com/jamiethomson/archive/2005/06/11/SSIS_3A00_-Custom-Logging-Using-Event-Handlers.aspx
Go to Top of Page

rjhe22
Constraint Violating Yak Guru

254 Posts

Posted - 06/25/2013 :  11:01:31  Show Profile  Reply with Quote
getting this error now any ideas
[Execute SQL Task] Error: Executing the query "INSERT INTO [dbo].[SSISLog]
([EventType..." failed with the following error: "Conversion failed when converting the varchar value '"+ (DT_STR, 6, 1252)DATEDIFF("ss", @[System::StartTime] , GETDATE() ) + "' to data type int.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/26/2013 :  02:22:39  Show Profile  Reply with Quote
your dynamic string is wrong. it should be


"INSERT INTO [dbo].[SSISLog]
           ([EventType]
           ,[PackageName]
           ,[TaskName]
           ,[EventCode]
           ,[EventDescription]
           ,[PackageDuration]
           ,[ContainerDuration]
           ,[InsertCount]
           ,[UpdateCount]
           ,[DeleteCount]
           ,[Host])

VALUES
(
'OnPostExecute',
'"+@[System::PackageName]+"', 
'"+@[System::TaskName]+"', 
0,
'"+@[System::SourceDescription]+"',
DATEDIFF(ss, " + (DT_STR, 6, 1252)@[System::StartTime] + " , GETDATE() ),  
DATEDIFF(ss," +  (DT_STR, 6, 1252)@[System::ContainerStartTime] + ", GETDATE() ), 
411,
2,
12,
'"+ @[System::MachineName] +"'
)
"


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000