November 24, 2018 at 6:41 pm
Comments posted to this topic are about the item The funny WHERE
November 25, 2018 at 12:03 am
Good question, thanks Steve.
...
November 25, 2018 at 7:57 am
Great question. Although preferable, this is one of the reasons why you "must look eye" when variables and columns are named the same.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 25, 2018 at 8:02 am
Should say: I get all rows for all statuses where oh.OrderTotal > 0
November 25, 2018 at 8:26 am
Jonathan AC Roberts - Sunday, November 25, 2018 8:02 AMShould say: I get all rows for all statuses where oh.OrderTotal > 0
My thought exactly!
π
November 25, 2018 at 10:29 pm
Nice one to start the week on, thanks Steve
____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
βlibera tute vulgaris exβ
November 26, 2018 at 6:33 am
Jonathan AC Roberts - Sunday, November 25, 2018 8:02 AMShould say: I get all rows for all statuses where oh.OrderTotal > 0
Yep, this had me staring at the question for a minute trying to figure out a correct answer.
Be still, and know that I am God - Psalm 46:10
November 26, 2018 at 8:18 am
Or an error in our primary database since it is case sensitive. π Good question Steve.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 26, 2018 at 8:28 am
Sean Lange - Monday, November 26, 2018 8:18 AMOr an error in our primary database since it is case sensitive. π Good question Steve.
Slightly envious Sean, having a "primary" database is really a luxury these days π
π
November 26, 2018 at 8:37 am
Eirikur Eiriksson - Monday, November 26, 2018 8:28 AMSean Lange - Monday, November 26, 2018 8:18 AMOr an error in our primary database since it is case sensitive. π Good question Steve.Slightly envious Sean, having a "primary" database is really a luxury these days π
π
haha. Probably not all that well worded. The database with the most activity would be more correct.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 26, 2018 at 8:51 am
Sean Lange - Monday, November 26, 2018 8:37 AMhaha. Probably not all that well worded. The database with the most activity would be more correct.
Legacy systems and DBAs with one database, been there but so long ago, not certain that all the dinosaurs had even turned into oil by then,
π
November 26, 2018 at 9:15 am
Sean Lange - Monday, November 26, 2018 8:18 AMOr an error in our primary database since it is case sensitive. π Good question Steve.
To clarify (not sure if you meant "database" literally, or meaning the instance/server): there would be a parse-error on Instances where the Instance-level Collation is either case-sensitive or binary. This is due to declaring the variable as "@status" but referencing it in the WHERE clause as "@Status". Individual DB default Collations are irrelevant here since variable names are controlled by the Instance-level Collation.
Take care, Solomon...
SQL# — https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
Sql Quantum Lift — https://SqlQuantumLift.com/ ( company )
Sql Quantum Leap — https://SqlQuantumLeap.com/ ( blog )
Info sites — Collations • Module Signing • SQLCLR
November 26, 2018 at 9:21 am
Solomon Rutzky - Monday, November 26, 2018 9:15 AMSean Lange - Monday, November 26, 2018 8:18 AMOr an error in our primary database since it is case sensitive. π Good question Steve.To clarify (not sure if you meant "database" literally, or meaning the instance/server): there would be a parse-error on Instances where the Instance-level Collation is either case-sensitive or binary. This is due to declaring the variable as "@status" but referencing it in the WHERE clause as "@Status". Individual DB default Collations are irrelevant here since variable names are controlled by the Instance-level Collation.
Take care, Solomon...
Well that is interesting. Didn't realize that but makes sense. The instance collation is binary as is each database on the instance.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 β Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
November 26, 2018 at 9:24 am
nice and easy one to start the week,
ta
---------------------------------------------------------------------------------------
The more you know, the more you know that you dont know
November 26, 2018 at 9:41 am
Sean Lange - Monday, November 26, 2018 9:21 AMSolomon Rutzky - Monday, November 26, 2018 9:15 AMSean Lange - Monday, November 26, 2018 8:18 AMOr an error in our primary database since it is case sensitive. π Good question Steve.To clarify (not sure if you meant "database" literally, or meaning the instance/server): there would be a parse-error on Instances where the Instance-level Collation is either case-sensitive or binary. This is due to declaring the variable as "@status" but referencing it in the WHERE clause as "@Status". Individual DB default Collations are irrelevant here since variable names are controlled by the Instance-level Collation.
Take care, Solomon...
Well that is interesting. Didn't realize that but makes sense. The instance collation is binary as is each database on the instance.
Ah, so to further clarify (since you are equating "binary" and "case-sensitive" collations), please see my post: No, Binary Collations are not Case-Sensitive
Take care, Solomon...
SQL# — https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
Sql Quantum Lift — https://SqlQuantumLift.com/ ( company )
Sql Quantum Leap — https://SqlQuantumLeap.com/ ( blog )
Info sites — Collations • Module Signing • SQLCLR
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply