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 ««123»»

Unique constraints Expand / Collapse
Author
Message
Posted Wednesday, July 29, 2009 7:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 27, 2012 8:42 AM
Points: 7, Visits: 90
Agreed. Put needs some correction before running because of strong tags... got it wrong, so I tried it on local server. It DOES need correction before running...
Post #761507
Posted Wednesday, July 29, 2009 7:28 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, September 4, 2014 8:53 AM
Points: 127, Visits: 125
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '<'.


Agree with others, i'm so used to taking things verbatim that i kinda wondered if it was a trick question, either way my "needs correction" answer was wrong
Post #761535
Posted Wednesday, July 29, 2009 7:31 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, February 4, 2011 7:20 AM
Points: 977, Visits: 1,499
I had the correct answer selected, then looked it over 1 last time and saw the tags. I changed my answer and promptly got it wrong. To be fair though, if I had thought about it for just another 10 seconds, I would have ignored the tags. They are not in the newsletter.

Tom Garth
Vertical Solutions

"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers
Post #761536
Posted Wednesday, July 29, 2009 7:32 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Friday, May 24, 2013 5:20 AM
Points: 660, Visits: 558
Not wanting to be antagonistic or anything, but given the question and answers (ie, what the question is trying to get across), and the fact that the STRONG tag is a well known HTML tag, it doesn't take much to figure it's a badly formatted question as opposed to intended.

I did actually get it 'right', but I suppose the simple fact is that the code will not run as is, and so anyone that answers "The code needs changing" should be awarded a point until the QotD is updated...


--------
I love deadlines. I like the whooshing sound they make as they fly by. -Douglas Adams
Post #761538
Posted Wednesday, July 29, 2009 7:33 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, September 4, 2014 6:11 AM
Points: 237, Visits: 137
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '<'.

So I think it's the last answer, query need some correction before compile!!!!!
Post #761539
Posted Wednesday, July 29, 2009 7:36 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, September 12, 2014 7:18 PM
Points: 1,324, Visits: 1,693
The <strong> tags are clearly an issue with the CMS here; I've seen it in a few other code samples. I don't know if the preview works with them where the final renderer doesn't or if some people thinks they work and aren't previewing what they write, or if the code is being run through a context highlighter that isn't fully compatible with this CMS, or something else. So I knew that should be ignored.

But I still got it wrong. I said the table wouldn't be created. Why? Because I foolishly expect consistency. Most of my development is small-scale, so I usually use SSMS to design my tables and manage my indexes. When you try to create an index > 900bytes in SSMS, it says that indexes can't be over 900 bytes, and won't let you go any further.

So I accept getting this wrong, because I've learned (once again) that Microsoft's GUI tools are NOT consistent with the capabilities of their underlying engines. Maybe the lesson will stick this time...

---below here is a <strong> tag check; please ignore it---
EDIT: the <strong> tag certainly works in forum posts...
Post #761548
Posted Wednesday, July 29, 2009 7:37 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, September 12, 2012 2:33 PM
Points: 291, Visits: 236
In retrospect, I think it's obvious what the intent of the question was. The problem is that everyone who has EVER answered a question here knows that subtle technicalities like this are the usual gotchas.

There are NOT 2 correct answers! Those who got it right with the "warning message" only got the correct answer by ignoring the obvious correct answer in favor of overlooking what SQL would not overlook!

What a waste of a good question about constraints.
Post #761551
Posted Wednesday, July 29, 2009 7:45 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, September 4, 2014 6:11 AM
Points: 237, Visits: 137
without the < strong> it is rather obvious that the table would still be created but a warning will be given.
As long as you insert/update so combined they are smaller then 900bytes.
I choose the because of < strong> , thought i was to think about names of tables! .. so that you had the include [ ]

Create table [< strong>sales2]
(
COL1 varchar(20) not null,
COL2 varchar(600) not null,
COL3 varchar(400) not null,
date datetime not null,
Unique clustered (COL2, COL3)
)
Same as getting a error when using create table a e instead of create table [a e]

At least when giving a question make sure that the question is right!
Please remove question because a lot of people would have it right!
Post #761560
Posted Wednesday, July 29, 2009 8:03 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 1:39 PM
Points: 922, Visits: 197
The tags did throw me off and I answered that the code will need to be modified. Too bad the question had this error because it was making a good point about indexes.
Post #761580
Posted Wednesday, July 29, 2009 10:55 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, July 7, 2014 8:58 AM
Points: 654, Visits: 400
I didn't see any tags in the question -- perhaps someone corrected it after y'all noted a problem?

In any case, don't forget to 'drop table sales' after executing the code in your scratch database and seeing the warning .
Post #761802
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse