August 1, 2011 at 3:40 pm
hi need to assign this value DATEADD(S,-59, DATEADD(s,-1,DATEADD(M,1, DATEADD(D, 1 - DATEPART(D, GETDATE()), DATEDIFF(D, 0, GETDATE())))) ) to the parameter in execute sql task in ssis.
I need to ececute following store proc
---- Exec [dbo].[PartitionSwap] 'metadata', '2011-08-31 23:59:00.000'.
I got this value 2011-08-31 23:59:00.000 by the epression DATEADD(S,-59, DATEADD(s,-1,DATEADD(M,1, DATEADD(D, 1 - DATEPART(D, GETDATE()), DATEDIFF(D, 0, GETDATE())))) ) .
I want to use above expression to the parameter of the store proc. WIll anyone help that would be great.
August 1, 2011 at 4:11 pm
DATEADD(S,-59, DATEADD(s,-1,DATEADD(M,1, DATEADD(D, 1 - DATEPART(D, GETDATE()), DATEDIFF(D, 0, GETDATE())))) )
how can assign are use above expression in expression builder in execute sql task.
any help that would be soooooooooo great
August 1, 2011 at 4:22 pm
sravnmaganti (8/1/2011)
hi need to assign this value DATEADD(S,-59, DATEADD(s,-1,DATEADD(M,1, DATEADD(D, 1 - DATEPART(D, GETDATE()), DATEDIFF(D, 0, GETDATE())))) ) to the parameter in execute sql task in ssis.I need to ececute following store proc
---- Exec [dbo].[PartitionSwap] 'metadata', '2011-08-31 23:59:00.000'.
I got this value 2011-08-31 23:59:00.000 by the epression DATEADD(S,-59, DATEADD(s,-1,DATEADD(M,1, DATEADD(D, 1 - DATEPART(D, GETDATE()), DATEDIFF(D, 0, GETDATE())))) ) .
I want to use above expression to the parameter of the store proc. WIll anyone help that would be great.
Try this
Exec [dbo].[PartitionSwap]
@p1='metadata',
@p2= 'SELECT DATEADD(S,-59, DATEADD(s,-1,DATEADD(M,1, DATEADD(D, 1 - DATEPART(D, GETDATE()), DATEDIFF(D, 0, GETDATE())))) )
'.
August 2, 2011 at 2:12 am
I want to use above expression to the parameter of the store proc. WIll anyone help that would be great.
YOu can define a local variable inside the proc and assign this expression to this variable, I do not understand why do you want to pass expression as parameter that is not possible since same thing can be done inside the proc
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply