Viewing 15 posts - 46 through 60 (of 241 total)
Why not just create a permanent Tally table? It's probably be useful in other situations. Just wondering...
--Vadim R.
June 13, 2019 at 3:27 pm
Right-click on .sql file; Properties; Click Change on Opens with.
I'm on Windows 7 thou.
--Vadim R.
June 12, 2019 at 10:09 pm
Did you Google for that error? It doesn't look like connected to xp_cmdshell. Are you using encryption?
--Vadim R.
June 12, 2019 at 8:00 pm
This?
WITH ExpiredCTE AS (
SELECT
CustomerID,
ExpiredDate = DateCreated
FROM #MYTABLE
WHERE EntryType = 'Expired'
)
SELECT *...
--Vadim R.
June 12, 2019 at 7:28 pm
It would be nice to have desired output based on sample data. It's not clear what should happen to customers that don't have 'Expired'. Are there multiple 'Expired' rows for...
--Vadim R.
June 12, 2019 at 6:49 pm
Checking for leap year is fairly easy:
DECLARE @Date AS DATE = '20120101'
IF ISDATE(CAST(YEAR(@Date) AS CHAR(4)) + '0229') = 1
PRINT 'Leap'
ELSE
PRINT 'Norm'
--Vadim R.
June 12, 2019 at 5:59 pm
Stored procedure is the way to go, I think. Why two SQL Server licenses if it's the same server?
--Vadim R.
June 12, 2019 at 4:35 pm
Can't you just concatenate Year?
When PeriodID = 'January'
THEN '1/31/' + CAST(YEAR(CURRENT_TIMESTAMP) AS CHAR(4))
--Vadim R.
June 12, 2019 at 4:08 pm
Something like this:
SELECT
c.session_id
,es.program_name
,es.login_name
...
--Vadim R.
June 11, 2019 at 9:37 pm
In the last paragraph of the article below, it says:
If a remote stored procedure calls RAISERROR with severity less than 20 and the remote stored procedure is scoped within a...
--Vadim R.
June 3, 2019 at 6:01 pm
Should be like this, me thinks:
EXEC sp_executesql @sql, N'@InterestID INT, @Approval BIT', @InterestID, @Approval
I didn't encounter 'Incorrect syntax near '01' thou.
--Vadim R.
May 31, 2019 at 10:27 pm
CAST and CONVERT ignore time zone, so just cast:
DECLARE @RDate DATETIMEOFFSET = '2018-07-31 00:00:00.0000000 +02:00';
SELECT CAST(@RDate AS DATE);
--Vadim R.
May 31, 2019 at 9:11 pm
Perhaps this article will be of help too:
https://www.sqlservercentral.com/articles/linking-to-the-previous-row
--Vadim R.
May 31, 2019 at 8:41 pm
No. Once deployed they stored in the ReportServer database's Catalog table.
--Vadim R.
May 23, 2019 at 8:26 pm
Viewing 15 posts - 46 through 60 (of 241 total)