Viewing 15 posts - 1,156 through 1,170 (of 7,191 total)
This should perform better than either a self-join or a recursive CTE. The first CTE isn't part of the solution - I just used it because I don't have a...
October 30, 2017 at 5:22 am
October 30, 2017 at 3:18 am
You could drop the CROSS and change the WHERE to ON. Same query, just avoiding the dreaded cross join syntax.
John
October 26, 2017 at 8:47 am
This is a problem with Management Studio, I think, not the database engine. Where are you running SSMS? Not on the server, I hope. In order to avoid situations like...
October 25, 2017 at 9:15 am
This is a SQL Server Agent job, right? What login does it run under?
The syslogins view has been deprecated for six versions now. You should use sys.server_principals instead. ...
October 25, 2017 at 8:21 am
You only found one?! My search yielded about 1,500,000 results.
Have you looked at the page_count column of dm_db_index_physical_stats?
John
October 25, 2017 at 7:35 am
I typed the name of this topic into my favourite search engine, and got all sorts of interesting results. You could have done the same, and had an answer in...
October 25, 2017 at 7:25 am
Sam
So you're taking the whole set and comparing the value of each column in each row to the values of each column in the previous row? The trouble...
October 25, 2017 at 7:09 am
David
Des's solution using dynamic SQL is right. The reason your solution fails is that you get a parse-time error. The query parser doesn't take account of control-flow logic...
October 25, 2017 at 5:37 am
October 25, 2017 at 5:25 am
What results were you expecting? Since no matter how you slice it, you have only one row in each partition, and you set the default value (the third parameter to...
October 25, 2017 at 5:20 am
October 25, 2017 at 5:13 am
If you need two rows per ID then you're going to need something like a CROSS JOIN or CROSS APPLY. But I'm afraid I still don't understand your requirement. Please...
October 25, 2017 at 4:24 am
Viewing 15 posts - 1,156 through 1,170 (of 7,191 total)