30,581 reputation
877128
bio website
location United Kingdom
age
visits member for 3 years, 6 months
seen 9 hours ago

Email: stackoverflowmartinsmith@gmail.com


Dec
11
reviewed Approve Is there a SELECT statement to subtract rows of the same column?
Dec
11
answered Is there a SELECT statement to subtract rows of the same column?
Dec
11
comment Update statement is giving an invalid column name error, even though the column exists
The only way I can see this happening at execution time is if you are creating a temp table of the same name outside the stored procedure. Example sqlfiddle.com/#!6/e937d/1
Dec
10
comment Update statement is giving an invalid column name error, even though the column exists
Correct answer to what? You still haven't provided an example of this happening. I copy and paste the code that you have provided into a SQL Fiddle and it works fine. sqlfiddle.com/#!6/80711/1
Dec
10
comment Incorrect query results for execution plan, unsure of exact cause of problem
Looks like I didn't recall correctly
Dec
10
comment Incorrect query results for execution plan, unsure of exact cause of problem
@DanRoberts the top is superfluous anyway as you have the filter on row_number. IIRC SQL Server does have logic to realise that no rows after 25 will contribute to the result so it won't carry on processing additional ones.
Dec
10
comment Incorrect query results for execution plan, unsure of exact cause of problem
What's the query? What do you order by to get the "first" page of results?
Dec
9
revised Statistics. Are multicolumn histograms possible?
rolled back to a previous revision
Dec
9
revised Statistics. Are multicolumn histograms possible?
added 543 characters in body
Dec
9
comment Update statement is giving an invalid column name error, even though the column exists
Except if you have a temp table with the same name in a different scope (higher up the call stack) you might get this I suppose. Or maybe if you are on an ancient version such as 2000.
Dec
9
comment Update statement is giving an invalid column name error, even though the column exists
When ran inside a stored procedure that code shouldn't throw that error. The table doesn't exist at first so all referencing statements should be subject to deferred compile. Please provide a full example that reproduces the issue.
Dec
9
revised Query to convert the count to million or thousands
Save a sort
Dec
8
revised Query to convert the count to million or thousands
deleted 303 characters in body
Dec
8
comment Query to convert the count to million or thousands
Presumably the second /1000 should be dividing by a million. Also 1000000 falls through to the else in error.
Dec
8
revised Query to convert the count to million or thousands
added 732 characters in body
Dec
8
revised Query to convert the count to million or thousands
added 94 characters in body
Dec
8
answered Query to convert the count to million or thousands
Dec
8
comment Estimated rows very wrong when using declared variables
Those are variables not parameters.
Dec
8
revised What is the difference between <> All and Not In
added 22 characters in body
Dec
7
answered Reset Key Names to Defaults?