Viewing 15 posts - 1,231 through 1,245 (of 2,645 total)
Although I believe in Christmas spirit, I don't think giving them the answer is really going to help them in the long run. :/
I don't think you can come...
December 24, 2019 at 12:16 am
SELECT p.ID PRODUCT_ID,
p.PRODUCT_NAME,
o.ID ORD_ID,
...
December 23, 2019 at 9:59 pm
It could be that you are not limiting the maximum amount of memory available to SQL Server?
If you right-click on the server in the SSMS object explorer, then on the...
December 23, 2019 at 4:54 pm
I can't see how you know exactly where to split the number, for example, how would you know if tbl2 number 1234050360 is 1234-050360 or 123405-0360?
If you are sure you...
December 23, 2019 at 3:03 pm
Do you have an index on CQRReportInstance(ReportInstanceId) ?
If you use INSENSITIVE when you create the cursor it will make a copy of the data used by the cursor in tempdb...
December 23, 2019 at 2:35 pm
This *was* good advice back in 2005, but now on SQL Server 2012 and above, table variables can be indexed, are dynamically indexed by default and fully accessible by...
December 21, 2019 at 10:55 pm
Of course, that recommendation also comes with the warning that if the hashbytes are different, then the rows are guaranteed to be different. However (and you know...
December 20, 2019 at 3:49 pm
First, if you add a few new-lines the query becomes readable:
SELECT t.PartNumber,
t.CompanyName,
...
December 20, 2019 at 2:41 am
Of course, that recommendation also comes with the warning that if the hashbytes are different, then the rows are guaranteed to be different. However (and you know this but...
December 20, 2019 at 12:29 am
SELECT CONCAT('
SELECT ''', QUOTENAME(t.TABLE_SCHEMA), '.', QUOTENAME(t.TABLE_NAME), ''' [TABLE_NAME], COUNT(*) COUNT
FROM (SELECT ',x.c, '
FROM...
December 19, 2019 at 11:13 pm
Hi..thanks so much. just one question, what does the x.c in the select statement mean to infer?
That's just the list of columns from the cross apply "x(C)", you can...
December 19, 2019 at 8:24 pm
So it's for staging tables on your database, not your application tables?
December 19, 2019 at 8:23 pm
SELECT CONCAT('
SELECT ',x.c, '
FROM ',QUOTENAME(t.TABLE_SCHEMA), '.', QUOTENAME(t.TABLE_NAME),'
GROUP BY ', x.c, '
HAVING COUNT(*) > 1;')
FROM INFORMATION_SCHEMA.TABLES t
CROSS APPLY (VALUES(STUFF((SELECT ',' + QUOTENAME(c.COLUMN_NAME)
...
December 19, 2019 at 7:48 pm
Hi, I have a TVF that pulls column details from sys.tables so that it can produce some dynamic sql to generate a hashbyte.
This needs to be dynamic as it...
December 19, 2019 at 1:45 pm
Yes I agree, it is going to perform worse.
Wouldn't it be a hoot if the optimizer fooled everyone? That IS the nature of CTEs. No one will actually...
December 18, 2019 at 10:37 pm
Viewing 15 posts - 1,231 through 1,245 (of 2,645 total)