February 21, 2010 at 3:33 pm
A good question.
It took me a while to work out because it relies on the fact that ','+d.Colors doesn't have a column name so that for xml path just concatenates the two comma-prefixed colors rather than generating a subelement for each, and I have never used that feature (I've always wanted subelements on the rare occassions I've used for xml) so it didn't click quickly.
Tom
February 23, 2010 at 9:08 am
Good Question
I got it right but for the wrong reason's(process of elimination) in my opinion.
I must say I am not a fan of the image since I could not copy the SQL and format it(not run it) to my liking.
February 25, 2010 at 1:06 am
bc_ (2/19/2010)
Here is the actual code
It is very interesting to see a proportional font (looks like Arial) on the screenshot 🙂 Do you really use that font for everyday coding instead of a fixed-width font (e.g. Courier New)?
February 25, 2010 at 7:37 am
[font="Arial Black"]ARIAL BLACK[/font]
is there an advantage to using a fixed width font? or is it personal preference?
[font="Arial Narrow"]bc[/font]
February 25, 2010 at 7:45 am
I would say fixed width makes it easier to indent your code since every character fits in a same size block. For me, that's the only reason, it's mere personal preference beyond that. Not sure if others have other reasons why?
February 25, 2010 at 11:38 am
paul.goldstraw (2/25/2010)
I would say fixed width makes it easier to indent your code since every character fits in a same size block. For me, that's the only reason, it's mere personal preference beyond that. Not sure if others have other reasons why?
I'm not sure there are any fixed width fonts that let me use even a full range of eurpean latin-based alphabets, let alone Cyrillic and Arabic too, and certainly not Japanese, Chinese, Korean and various Indian alphabets. Since I have worked mostly in a fairly international environments, and want to work usually in Unicode, this tends to force me onto variable width fonts. Of course it then makes sense to use fixed width (measured in inches or metres or whatever) tabs, rather than letting tabs represent a number of characters from the margin.
Tom
February 26, 2010 at 2:15 am
bc_ (2/25/2010)
is there an advantage to using a fixed width font? or is it personal preference?
Fixed-width fonts allow to adjust and beautify a piece of code easily.
Simple example (Courier New):
[font="Courier New"]CREATE TABLE #TEST_TABLE
( Id INT NOT NULL IDENTITY,
Customer_Id INT NOT NULL,
Customer_Name VARCHAR(100) NOT NULL,
Invoice_Id INT NULL,
Invoice_Total MONEY NULL,
Invoice_Tax MONEY NULL,
Discount_Percent NUMERIC(5,2) NULL
)[/font]
With Arial Black, this code will look like:
[font="Arial Black"]CREATE TABLE #TEST_TABLE
( Id INT NOT NULL IDENTITY,
Customer_Id INT NOT NULL,
Customer_Name VARCHAR(100) NOT NULL,
Invoice_Id INT NULL,
Invoice_Total MONEY NULL,
Invoice_Tax MONEY NULL,
Discount_Percent NUMERIC(5,2) NULL
)[/font]
Alignment is not as good as before, and (it's more important) another developer will see a total mess when he/she opens the code in his/her SSMS. I think the developer will not be happy 🙂
Delphi, Clarion, Visual Studio, Query Analyzer, SSMS, PL/SQL Developer - all of these use fixed-width fonts by default...
March 22, 2010 at 3:02 am
Fatal Exception Error (2/23/2010)
Good QuestionI got it right but for the wrong reason's(process of elimination) in my opinion.
I must say I am not a fan of the image since I could not copy the SQL and format it(not run it) to my liking.
Don't see why you'd consider that the wrong reason - worked just as well for me.
To (badly?) quote Sherlock Holmes (or Sir A. C. Doyle if you prefer)
"Once you have elimiated the impossible, then whatever is left, however improbable, must be the answer"...
Kelsey Thornton
MBCS CITP
March 22, 2010 at 3:14 am
Tom.Thomson (2/25/2010)
paul.goldstraw (2/25/2010)
I would say fixed width makes it easier to indent your code since every character fits in a same size block. For me, that's the only reason, it's mere personal preference beyond that. Not sure if others have other reasons why?I'm not sure there are any fixed width fonts that let me use even a full range of eurpean latin-based alphabets, let alone Cyrillic and Arabic too, and certainly not Japanese, Chinese, Korean and various Indian alphabets. Since I have worked mostly in a fairly international environments, and want to work usually in Unicode, this tends to force me onto variable width fonts. Of course it then makes sense to use fixed width (measured in inches or metres or whatever) tabs, rather than letting tabs represent a number of characters from the margin.
I always use the "so-called"(?) fixed-width fonts in code and eschew tabs like the plague.
The latter is a klingon from an ancient Fortran compiler which would crash if it saw a tab anywhere EXCEPT as the very first character on a line. I still hate tabs in code as my colleagues will no doubt attest. 🙂
The only place where I use tabs is in word-processed documentation (where it *is* better).
Kelsey Thornton
MBCS CITP
March 30, 2010 at 8:38 am
The poor UNION statement, abused again 🙁
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply