Viewing 15 posts - 361 through 375 (of 1,468 total)
Are you truly still using SQL 7 or SQL 2000?
March 2, 2020 at 11:24 am
Is there a way to specify a column name for the IN section of code to keep it dynamic? Otherwise, every time there is a new value in the...
February 6, 2020 at 3:50 pm
SELECT
acc
, COUNT(*) AS numOfAcc
, COUNT(DISTINCT token) AS numOfTokenPerAcc
FROM
dbo.Test1
GROUP BY acc
February 2, 2020 at 5:38 am
Based on your sample data, this returns the same result.
WITH cteData AS (
SELECT t.tid, t.b, t.E, seq.st, seq.nd
FROM...
January 30, 2020 at 10:16 am
Man! You are so right! This is going to be totally liberating for me!
To commemorate my new found joyous method for doing my job without being a bottleneck,...
January 30, 2020 at 6:01 am
To add to what Grant has stated, I agree that "new" voices are a bonus on any forum but I have seen some "new" people come in with...
January 30, 2020 at 4:20 am
My apologies. I wanted to Quote Jeff's answer, but accidentally hit the REPORT link instead. Are Admins/Mods able to please undo my error
This was the post (copied from my mail)
To...
January 30, 2020 at 4:18 am
Declare @DBID Int Set @DBID = DB_ID ()
Checkpoint
DBCC DROPCLEANBUFFERS WITH NO_INFOMSGS
DBCC FLUSHPROCINDB (@DBID) WITH NO_INFOMSGS
That will clear execution plans and data from memory, which would...
January 29, 2020 at 2:00 pm
NOLOCK and READUNCOMMITTED only affect reads. This proc is doing inserts and updates, so it MAY have an impact if all other procs use NOLOCK/READ UNCOMMITTED.
My gut says that changing...
January 20, 2020 at 4:24 am
You are formatting your input string with style 101, and then asking SQL to interpret it as style 100.
You need to match your style to your input string
January 14, 2020 at 5:20 pm
Take a look at the SQL CONVERT function for formatting the dates for display.
But PLEASE PLEASE PLEASE do not save the dates as varchar. You will be opening yourself...
January 14, 2020 at 4:42 pm
I like the simplicity of finding the February 29 dates, then subtracting that DesNorton posted. But it didn't calculate correctly when I used the start date of 01/01/2019 end...
January 13, 2020 at 5:07 pm
This can be made more dynamic with a function that gets the FEB29 days
CREATE FUNCTION dbo.GetLeapYearDates(@Date1 AS date, @Date2 AS date)
RETURNS TABLE WITH SCHEMABINDING
AS
RETURN
WITH
...
January 11, 2020 at 7:26 am
If something isn't a set, it often helps to turn it into a set. Here's an example:
DECLARE @val1 nvarchar(40) = 'Hello';
DECLARE @val2 nvarchar(40) = 'Treacle';
DECLARE @val3...
January 11, 2020 at 6:52 am
Here is another option
DECLARE @val1 nvarchar(40) = 'Hello';
DECLARE @val2 nvarchar(40) = 'Treacle';
DECLARE @val3 nvarchar(40) = NULL;
DECLARE @val4 nvarchar(40) = 'Rhubarb';
DECLARE @nth int = 2;
WITH cteNonNullData AS (
...
January 11, 2020 at 6:50 am
Viewing 15 posts - 361 through 375 (of 1,468 total)