﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by bitbucket  / SET Options - 2 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 02:45:09 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Oops; those damned semi-colons get in everywhere;!!Luckily I chose to ignore it after thinking "they wouldn't do that, would they??" :-D</description><pubDate>Fri, 05 Apr 2013 08:59:02 GMT</pubDate><dc:creator>WWDMark</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>+1 on the semi-colon being illegal after GO</description><pubDate>Wed, 13 Feb 2013 16:35:04 GMT</pubDate><dc:creator>Andre Ranieri</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>nice one.... thanks for question.... we can create table name with double quotes.... and coulumn name also....:-)manikandan.psGo as fast as possible.</description><pubDate>Thu, 24 Jan 2013 00:43:57 GMT</pubDate><dc:creator>manik123</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>+1</description><pubDate>Tue, 15 Jan 2013 13:53:13 GMT</pubDate><dc:creator>asifkareem</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]Toreador (12/5/2012)[/b][hr]Shame about the endless complaints about the semi-colon (does nobody ever read the thread before adding to it?)The easy way to have avoided confusion as to whether the syntax error was intended is to do what I did, and fail to notice it was there :-)[/quote]:doze:</description><pubDate>Wed, 05 Dec 2012 04:09:39 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Shame about the endless complaints about the semi-colon (does nobody ever read the thread before adding to it?)The easy way to have avoided confusion as to whether the syntax error was intended is to do what I did, and fail to notice it was there :-)</description><pubDate>Wed, 05 Dec 2012 01:57:41 GMT</pubDate><dc:creator>Toreador</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>nice basic question neglecting ':' part</description><pubDate>Tue, 04 Dec 2012 23:17:02 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Good Question Ron. Thanks for posting. Its always good to revise our basics :-)</description><pubDate>Tue, 04 Dec 2012 21:28:59 GMT</pubDate><dc:creator>Lokesh Vij</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Nice Question That ";" made a small black mark on the question :)</description><pubDate>Tue, 04 Dec 2012 21:27:59 GMT</pubDate><dc:creator>Samith C</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]okbangas (12/3/2012)[/b][hr]Wrong answer marked as correct. SQL Server will return the following error message:[code]Msg 102, Level 15, State 1, Line 5Incorrect syntax near ';'.[/code]Semicolon is not allowed after go.[/quote]+1</description><pubDate>Tue, 04 Dec 2012 20:19:10 GMT</pubDate><dc:creator>prvmine</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Thanks Ron.</description><pubDate>Tue, 04 Dec 2012 19:24:59 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Great question Ron, thanks!</description><pubDate>Tue, 04 Dec 2012 13:51:09 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]ma-516002 (12/4/2012)[/b][hr]Got it wrong, because I thought it is a trick question since "GO;" will throw an error and the table will not be created.[/quote]Agreed. If the SQL is executed with the semi-colon an error will be thrown and the table will not be created.</description><pubDate>Tue, 04 Dec 2012 12:39:37 GMT</pubDate><dc:creator>seankyleprice</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote]BLAH!  Why can't I ever read question writers minds?Too often the surprise questions leave me sitting there going... did he mean for the ; to throw the error or not.Obviously now it's that he didn't mean for that.  Of course I had to guess which way his devious mind was going.Steve should at least fix the question for the later comers.[/quote]Sad to have to ferret out the syntax typos and get to question the author meant.  Sometimes the syntax errros are the question and sometimes not??  And I'm a bad guesser.</description><pubDate>Tue, 04 Dec 2012 10:36:35 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]mtassin (12/4/2012)[/b][hr]I get this if I run the script.Msg 102, Level 15, State 1, Line 8Incorrect syntax near 'GO'.If I remove the semi-colon from the GO, it works.[/quote]BLAH!  Why can't I ever read question writers minds?Too often the surprise questions leave me sitting there going... did he mean for the ; to throw the error or not.Obviously now it's that he didn't mean for that.  Of course I had to guess which way his devious mind was going.Steve should at least fix the question for the later comers.</description><pubDate>Tue, 04 Dec 2012 10:31:15 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>I get this if I run the script.Msg 102, Level 15, State 1, Line 8Incorrect syntax near 'GO'.If I remove the semi-colon from the GO, it works.</description><pubDate>Tue, 04 Dec 2012 10:27:48 GMT</pubDate><dc:creator>mtassin</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>I picked the right answer because I did think the semicolon was a typo from Ron.Great question about options, but keep in mind that naming DB objects with reserved words is not a good practice.Saludos,</description><pubDate>Tue, 04 Dec 2012 10:13:47 GMT</pubDate><dc:creator>EL Jerry</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]Hugo Kornelis (12/4/2012)[/b][hr]I had to make a guess as to the author's intention and preparation.Did he actually try the code himself? In that case, it is a nasty trick question, because everything in the question distracts from the syntax error (semicolon after GO) that causes the batch to fail and the table to not be created. . . .[/quote]I did not expect a trick question from Ron and the rest was easy.Thanks, Ron.</description><pubDate>Tue, 04 Dec 2012 09:03:13 GMT</pubDate><dc:creator>Revenant</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]Hugo Kornelis (12/4/2012)[/b][hr]I picked the wrong option. If I had checked the submitter of the question, I probably would have picked the right option - I don't think I ever saw an intentional trick question from Ron.[/quote]I did see Ron was the submitter and I still picked the wrong option.  I thought to myself, "It's not like him to write an intentional trick question but it's not like him to create a blatent typo either."  Other than this snag, I liked the question.</description><pubDate>Tue, 04 Dec 2012 08:27:12 GMT</pubDate><dc:creator>Rose Bud</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]bitbucket-25253 (12/4/2012)[/b]3.  I can only guess, but was using a brand new lap top when submitting the question and typing the QOD rather than a cut and paste from SSMS, and somehow or other I pressed the semi-colon key.[/quote]Are programmers (including the ones who write SQL code) the only people who think retyping something is less hassle than cut and paste, I wonder? :-)</description><pubDate>Tue, 04 Dec 2012 08:22:32 GMT</pubDate><dc:creator>paul.knibbs</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]okbangas (12/3/2012)[/b][hr]Wrong answer marked as correct. SQL Server will return the following error message:[code]Msg 102, Level 15, State 1, Line 5Incorrect syntax near ';'.[/code]Semicolon is not allowed after go.[/quote]So hard to tell why anyone would post a QOTD without actualy running the SQL.... :crazy:Of course like Hugo said... had I looked at who posted the question I would have known....:-P</description><pubDate>Tue, 04 Dec 2012 07:34:10 GMT</pubDate><dc:creator>SanDroid</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]bitbucket-25253 (12/4/2012)[/b][hr]My apologies to all ..... 1.  I did test the code multiple times ... 2.  When testing the [b];[/b] was NOT present.3.  I can only guess, but was using a brand new lap top when submitting the question and typing the QOD rather than a cut and paste from SSMS, and somehow or other I pressed the semi-colon key.4.  Poor excuse on my part for the error so let me say again: [b]My apologies to all[/b][/quote]We're all human Ron.  Apology not needed but certainly accepted. ;-)</description><pubDate>Tue, 04 Dec 2012 07:22:20 GMT</pubDate><dc:creator>Dave62</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>My apologies to all ..... 1.  I did test the code multiple times ... 2.  When testing the [b];[/b] was NOT present.3.  I can only guess, but was using a brand new lap top when submitting the question and typing the QOD rather than a cut and paste from SSMS, and somehow or other I pressed the semi-colon key.4.  Poor excuse on my part for the error so let me say again: [b]My apologies to all[/b]</description><pubDate>Tue, 04 Dec 2012 07:11:26 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Saw the semicolon after the GO and thought to myself - this will not execute, therefore table will not be created.Over and above that, this is a good question about behaviour when QUOTED IDENTIFIERS is ON vs. OFF</description><pubDate>Tue, 04 Dec 2012 07:04:05 GMT</pubDate><dc:creator>Stewart "Arturius" Campbell</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]Hugo Kornelis (12/4/2012)[/b][hr]I had to make a guess as to the author's intention and preparation.Did he actually try the code himself? In that case, it is a nasty trick question, because everything in the question distracts from the syntax error (semicolon after GO) that causes the batch to fail and the table to not be created.Of did he forget to execute the code? In that case, it is an unintended trick question, because I can assume that the semicolon after the GO was an oversight and the author wanted us to focus on the ability to create a table name using reserved words (not a recommended good practice, by the way).... [/quote]Another possibility is that Ron did in fact try the code but then added the semicolon when submitting the question to SSC without re-testing.  Possibly a good lesson here about minor touch up editing without testing.</description><pubDate>Tue, 04 Dec 2012 06:45:28 GMT</pubDate><dc:creator>Dave62</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Nice question apart from teh semi-colon.Some interesting discussion about the default.  BoL contradicts itself firmly here - the SET QUOTED_IDENTIFIER page has said the default is ON at least since SQL 2005, while the SET OPTIONS page says it is OFF.  I believe that the fact is that it's one of those options like ANSI_WARNINGS where the default in the engine is OFF but the default applied by most connection methods is ON, but unlike ANSI_WARNINGS MS hasn't documented this in BoL (you will only finnd ANSI_WARNINGS off if you connect using DBLIBRARY, it's on by default for the native ODBC and OLE-DB drivers.It's rather surprising this error has managed to remain on the SET QUOTED_IDENTIFIER page in BoL for so many years.It's quite surprising too that more of these SET options which can be set off to get non-standard behavious have not been deprecated.  There are features which just don't work when they are OFF - for example if QUOTED_IDENTIFIER is OFF tables with indexes on computed columns behave badly.</description><pubDate>Tue, 04 Dec 2012 04:39:21 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Dont' know what everyone else got but on SS 2008 I got:Msg 102, Level 15, State 1, Line 5Incorrect syntax near ';'.Looks like another fine QotD!</description><pubDate>Tue, 04 Dec 2012 04:22:09 GMT</pubDate><dc:creator>(Bob Brown)  </dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Thanks man. Reall Great</description><pubDate>Tue, 04 Dec 2012 03:43:30 GMT</pubDate><dc:creator>Dineshbabu</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Nice question on what quoted identifiers can let you get away with, shame about the extra ';' which means the table isn't created. :-)</description><pubDate>Tue, 04 Dec 2012 03:20:19 GMT</pubDate><dc:creator>Gazareth</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Good question and Hugo raises some good points too.My mistake in not getting a point today for being too literal with my interpretation of the question</description><pubDate>Tue, 04 Dec 2012 02:50:45 GMT</pubDate><dc:creator>Stuart Davies</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]dineshbabus (12/4/2012)[/b][hr]Please refer this URL. It says by default IT will be ON.http://msdn.microsoft.com/en-us/library/ms174393(SQL.105).aspx[/quote][code="sql"]-- Default for user options is 0-- See http://msdn.microsoft.com/en-us/library/ms189631.aspx-- Flag values are at http://msdn.microsoft.com/en-us/library/ms176031.aspx-- e.g. QUOTED_IDENTIFER is 256SELECT    c.value_in_use FROM sys.configurations AS cWHERE    c.name = N'user options';-- Show database-level defaultsSELECT     name, is_quoted_identifier_onFROM sys.databases AS d;-- Is QUOTED_IDENTIFIER on for the current connection?-- A value of 256 means yes-- See http://msdn.microsoft.com/en-us/library/ms177525.aspxSELECT @@OPTIONS &amp; 256;[/code]Try connecting via sqlcmd instead of using SSMS.  It does not SET QUOTED_IDENTIFIER ON unless you specify the -I switch, see [url]http://msdn.microsoft.com/en-us/library/ms162773.aspx[/url][img]http://www.sqlservercentral.com/Forums/Attachment12797.aspx[/img]</description><pubDate>Tue, 04 Dec 2012 02:24:09 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]dineshbabus (12/4/2012)[/b][hr]I Opened a new SQL Server Management Studio and tried the create statement without any set options. Query works fine. Can you explain in detail?[/quote]SQL Server Management Studio is a client application which (by default) issues SET QUOTED_IDENTIFIER ON when connecting.  It depends on how you have your SSMS configured, of course:[img]http://www.sqlservercentral.com/Forums/Attachment12796.aspx[/img]</description><pubDate>Tue, 04 Dec 2012 02:07:42 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>I had to make a guess as to the author's intention and preparation.Did he actually try the code himself? In that case, it is a nasty trick question, because everything in the question distracts from the syntax error (semicolon after GO) that causes the batch to fail and the table to not be created.Of did he forget to execute the code? In that case, it is an unintended trick question, because I can assume that the semicolon after the GO was an oversight and the author wanted us to focus on the ability to create a table name using reserved words (not a recommended good practice, by the way).I picked the wrong option. If I had checked the submitter of the question, I probably would have picked the right option - I don't think I ever saw an intentional trick question from Ron.</description><pubDate>Tue, 04 Dec 2012 02:02:48 GMT</pubDate><dc:creator>Hugo Kornelis</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Got it wrong, because I thought it is a trick question since "GO;" will throw an error and the table will not be created.</description><pubDate>Tue, 04 Dec 2012 01:57:28 GMT</pubDate><dc:creator>ma-516002</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Please refer this URL. It says by default IT will be ON.http://msdn.microsoft.com/en-us/library/ms174393(SQL.105).aspx</description><pubDate>Tue, 04 Dec 2012 01:00:19 GMT</pubDate><dc:creator>Dineshbabu</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>I Opened a new Sql server management studio and tried the create statement without any set options. Query works fine.can you xplain in detail?</description><pubDate>Tue, 04 Dec 2012 00:55:47 GMT</pubDate><dc:creator>Dineshbabu</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>[quote][b]dineshbabus (12/3/2012)[/b][hr]By Default "Quoted Identifier" Will be ON. Eventhoug if we didn't set any options. the syntax will work fine. Please correct me if i'm wrong.[/quote]The default is OFF (see [url]http://msdn.microsoft.com/en-us/library/ms190707(v=sql.105).aspx[/url] and [url]http://msdn.microsoft.com/en-us/library/ms191203(v=sql.105).aspx[/url]).However, most client applications SET QUOTED_IDENTIIFIER ON when they connect.</description><pubDate>Tue, 04 Dec 2012 00:06:37 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>By Default "Quoted Identifier" Will be ON. Eventhoug if we didn't set any options. the syntax will work fine.Please correct me if i'm wrong.</description><pubDate>Mon, 03 Dec 2012 23:25:32 GMT</pubDate><dc:creator>Dineshbabu</dc:creator></item><item><title>RE: SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Wrong answer marked as correct. SQL Server will return the following error message:[code]Msg 102, Level 15, State 1, Line 5Incorrect syntax near ';'.[/code]Semicolon is not allowed after go.</description><pubDate>Mon, 03 Dec 2012 22:15:17 GMT</pubDate><dc:creator>okbangas</dc:creator></item><item><title>SET Options - 2</title><link>http://www.sqlservercentral.com/Forums/Topic1392225-1222-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/options/94221/"&gt;SET Options - 2&lt;/A&gt;[/B]</description><pubDate>Mon, 03 Dec 2012 20:11:23 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item></channel></rss>