July 5, 2016 at 5:44 pm
I can't seem to figure out how to add a variable that uses a table for its value.
I'd like to use
SELECT DATEADD(HH, -1,MAX(LastModifiedDate)) FROM TicketsTable
As my variable.
Currently I use something like DATEADD(DAY, -2,MAX(GETDATE())
Seems like it should be super simple...but I'm just not getting it.
More details on the task.
I pull data from a ticketing database into a reporting database. I pull this data nightly. My variable pulls system time - 2 days. If I can pull the Last Modified Date from the Reporting database tickets tables it would reduce the resource cost dramatically and allow me to run it dynamically instead of every night.
Thank you,
July 5, 2016 at 5:53 pm
dirkdirden (7/5/2016)
I can't seem to figure out how to add a variable that uses a table for its value.I'd like to use
SELECT DATEADD(HH, -1,MAX(LastModifiedDate)) FROM TicketsTable
As my variable.
Currently I use something like DATEADD(DAY, -2,MAX(GETDATE())
Seems like it should be super simple...but I'm just not getting it.
More details on the task.
I pull data from a ticketing database into a reporting database. I pull this data nightly. My variable pulls system time - 2 days. If I can pull the Last Modified Date from the Reporting database tickets tables it would reduce the resource cost dramatically and allow me to run it dynamically instead of every night.
Thank you,
It's all explained, by way of example, here[/url].
July 5, 2016 at 5:58 pm
Holy Crap baskets that is a lot of steps for such a seemingly easy task.
I'll give it a shot.
July 5, 2016 at 6:21 pm
It's explained in detail & perhaps that makes it seem a lot. It really isn't.
Basically, you need a variable. You run an execute SQL task and map the results of executing the query to the variable. Job done.
July 6, 2016 at 8:08 pm
dirkdirden (7/5/2016)
Holy Crap baskets that is a lot of steps for such a seemingly easy task.
Goes right along with the Holy Snappin' Ducksh!t that you have to fill those baskets with and is a good reason why I try to avoid SSIS at almost any cost. Certainly, there are those that will disagree.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy