Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

COLLATION Expand / Collapse
Author
Message
Posted Wednesday, November 3, 2010 9:50 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 24, 2013 9:59 PM
Points: 1,354, Visits: 1,299
Michael Poppers (11/3/2010)

Yes, he might have been better off listing the possible choice as
SELECT CONVERT(char, SERVERPROPERTY('collation','MyDatabaseName'))

and perhaps that was his intention .

Agreed. I work in a training organization and consider myself a quiz expert. Writing many quiz applications and writing the actual quizzes too. I can say with 100% certainty that it was a bad distractor because anyone that knows how to use the convert command would know that you don't put the Database name as the second parameter. You can then remove that possible answer as one that you should select.

It could have been offered as
SELECT SERVERPROPERTY('collation','MyDatabaseName')

and just leave off the Convert portion.
Post #1015374
Posted Wednesday, November 3, 2010 10:20 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232, Visits: 1,046
Michael Poppers (11/3/2010)
[quote] and perhaps that was his intention .


Good point. It could have been his attention from the start.

It would not be the first time the QOTD was differant from what the Author thought he had posted.

Post #1015404
Posted Wednesday, November 3, 2010 10:39 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:47 AM
Points: 13,110, Visits: 11,940
I will jump on the bandwagon of not getting the convert to char but will point out that I never like code that just uses the default size for datatypes. I don't like to have to stop and think (or more likely lookup) what the default size is for a given datatype.

This is so much easier to read exactly what is being returned:
SELECT CONVERT(char(30), DATABASEPROPERTYEX('AdevntureWorks', 'Collation'))



_______________________________________________________________

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 Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1015416
Posted Wednesday, November 3, 2010 11:16 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:24 AM
Points: 21,248, Visits: 14,951
Thanks for the question



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1015444
Posted Wednesday, November 3, 2010 12:56 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 11:32 AM
Points: 13,310, Visits: 10,175
Nice question, thanks.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1015511
Posted Tuesday, November 9, 2010 1:43 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 6:54 AM
Points: 1,032, Visits: 1,295
Good question. I learned fn_helpcollations function & its usage.

Thanks
Post #1017663
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse