Viewing 15 posts - 196 through 210 (of 1,468 total)
Also, be aware that UNION will be much slower that UNION ALL, as it will only return a DISTINCT result, which requires an additional sort operation
March 3, 2022 at 2:03 pm
You could find all of the columns sys.columns, but there is no way to know which ones are alligned.
So, as far as I know, you have to do it manually.
select...
March 3, 2022 at 9:24 am
As a perf update, you can use the following code for extracting Title.
C.x.value( '(title/text())[1]', 'varchar(100)' )
I am not an XML expert, but this was a tip that...
March 1, 2022 at 3:56 pm
I seem to recall a rule in place that if 3 posts for the same user are flagged as spam, the user automatically gets disabled. Is that rule still in...
March 1, 2022 at 8:55 am
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
Viewing 15 posts - 196 through 210 (of 1,468 total)