Viewing 15 posts - 2,896 through 2,910 (of 13,879 total)
Something like this, which isn't very efficient. Better to stored your dates as dates if that's an option.
WHERE DATEADD(MONTH,12,CAST(CAST(data AS char(8)) AS date)) < GETDATE()John
John, I...
March 5, 2020 at 3:22 pm
You can potentially shortcut John's method. If you add or subtract 10000 to an INT date held as YYYYMMDD, you are effectively adding or subtracting a year.
(If one of your...
March 5, 2020 at 3:14 pm
there are 2 things - historically we've been told to use table variables as they can "sometimes" be in memory (no one has ever given me details on when...
March 5, 2020 at 3:07 pm
This is interesting ... I usually head from table variables to temp tables. Are you finding improvements across the board (ie, for all temp tables), or just in certain scenarios?
March 5, 2020 at 12:48 pm
That's some bad code there Mike. I've seen some similar, but add a couple UNION statements and all with in an SSRS report. Talk about slow code.
I've also...
March 4, 2020 at 9:40 pm
The date which appears in your subject will depend entirely on the date on which the job is run. In words: "Give me the date for Sunday of the preceding...
March 4, 2020 at 9:23 pm
I wasn't sure if running this package weekly if that function would update automatically every week
GETDATE() updates every time you call it.
March 4, 2020 at 9:05 pm
Actually for the week of February 23rd
again I really appreciate the help
Oops, I meant Feb.
Change your DECLARE @Sub line as follows:
DECLARE @Sub NVARCHAR(255)
...
March 4, 2020 at 9:04 pm
So ... if the job ran today, would you like the subject to be
'Transfer Report for the week of 23 March to 29 March'
?
March 4, 2020 at 8:52 pm
Thanks Phil I appreciate it how would I get it to say for the week of 23 to 29th?
Please define the logic for determining the numbers to use.
March 4, 2020 at 8:41 pm
My apologies. This is better:
DECLARE @FilePath NVARCHAR(MAX) = N'C:\inetpub\ftpuser\WESA\ftpwashingtondc\DCWeeklyEmail\';
DECLARE @Filenames NVARCHAR(MAX);
DECLARE @EmailAddress VARCHAR(MAX);
SET @EmailAddress = '?';
SET @Filenames = @FilePath + N'dc_weekly' + N'.csv';
DECLARE @Sub NVARCHAR(255) = CONCAT('Example...
March 4, 2020 at 8:25 pm
Modify the line
@Subject = 'Transfer Report',
to
@Subject = CONCAT('Transfer Report for the week of ', CONVERT(CHAR(10), GETDATE(), 101)),
and see whether that is getting you close to what you need.
March 4, 2020 at 8:14 pm
When I send e-mails from SSIS, I usually use an ExecuteSQL task which runs sp_send_dbmail (link).
If you configure this, you have all the control you should ever need.
If you...
March 4, 2020 at 8:05 pm
Viewing 15 posts - 2,896 through 2,910 (of 13,879 total)