Viewing 15 posts - 196 through 210 (of 1,464 total)
Ah, I missed the fact that you are using SQL 2012.
The other option is to just force the AnchorDate to DTO (knowing that SQL assumes that it is UTC)
February 22, 2022 at 3:14 pm
You can also use the AT TIME ZONE functionality for the test
/*
Queries tested on SQL Server 2012 with default timezone of Eastern Standard Time.
*/
DECLARE @ComparisonDateAsDTO datetimeoffset(7) =...
February 22, 2022 at 9:12 am
This is easily achieved with a cross-tab query
CREATE TABLE #Animal (ID int, Animal varchar(20), Number int, [Year] int);
INSERT INTO #Animal ( ID, Animal, Number, [Year] )
VALUES (...
February 19, 2022 at 1:36 pm
This is very easy to achieve using the LAG function
February 16, 2022 at 2:47 pm
Depending on the actual data in the xml as well as the xml structure of the various records, you find storage improvements by storing the xml as [n]varchar(max).
February 16, 2022 at 6:53 am
Here is a link to a post by Drew Allen https://www.sqlservercentral.com/forums/reply/2031829 which covers islands
February 10, 2022 at 6:02 am
You have not provided any usable data or a base query to be able to test against.
The following code should get you moving in the right direction
WITH...
February 1, 2022 at 5:20 pm
Hi. Thanks for the response.
"On a side note, you declare @Size as bigint."
I am showing my lack of understanding 🙂
What would you suggest?
When assigning values to a string data...
February 1, 2022 at 1:42 pm
The following code should do the trick
SUBSTRING(part, LEN(part) - CHARINDEX('-', REVERSE(part)) -1, 2)
February 1, 2022 at 10:25 am
HAVING SUM([FileSize]) > 104857600 - This returns 15 ROWS
What is the value of [SumOfFileSize] for the 15 rows? How many of them are greater than 10485760000?
Based on...
February 1, 2022 at 10:19 am
There is no issue with letting SQL generate the PK name for the temp table.
That said, there is no guarantee that your script will run any faster when running 2...
February 1, 2022 at 10:08 am
That's a rather selfish thing to do.
Rather leave your question up, and feed back with what you did to resolve it.
That way, other people can learn from your efforts.
January 29, 2022 at 5:58 am
January 29, 2022 at 5:52 am
You need to include your variable assignment in the query
SELECT @NUM_RECORDS = COUNT(*)
FROM DBO.DataImportFileImportHistory AS T1
WHERE T1.FILENAME = @FILENAME;
January 29, 2022 at 5:47 am
A simplified query to return dateStamp as datetime, and wkStamp as 1st day of teh week.
You can then use the value in wk_stamp to do your grouping by
January 28, 2022 at 3:59 pm
Viewing 15 posts - 196 through 210 (of 1,464 total)