April 22, 2010 at 2:24 am
The insert statement has a syntax that is unacceptable to SQL Server 2005. So why wasn't it stated as being compatible with SQL Server 2008 and later only?
We should get our points back.
Kenneth Spencer
You never know: reading my book: "All about your computer" might just tell you something you never knew!
lulu.com/kaspencer
April 22, 2010 at 3:10 am
[font="Verdana"]
kaspencer (4/22/2010)
The insert statement has a syntax that is unnacptable to SQL Server 2005. So why wasn't it stated as being compatible with SQL Server 2008 and later only?We should get our points back.
Kenneth Spencer
Digesting loss of points, is if not Very Tough but at least, it is Tough, I think.
It’s frequent in case QODs, so be brave, as me lost last day’s points.;-)
[/font]
April 22, 2010 at 3:11 am
I got this right, but only because the question was on ROLLBACK and I gambled on the INSERT statement being an mistake/typo. I didn't know that it would run OK as is on SQL Server 2008, so I did learn something. It should have been stated which version this applied to.
April 22, 2010 at 3:18 am
My answer is ERROR
as insert query given me error. moreover yes Rollback can rollback pages truncated by TRUNCATE.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ','.
Thanks
April 22, 2010 at 3:34 am
So I learnt about a new feature of the INSERT statement in SQL 2008.
Definitely use feature that when systems finally upgraded to SQL 2008.
Perhaps I should have paid closer attention at the title of the QOD to give me a hint, rather than the obvious syntax error based on current SQL version I generally use.
------
Robert
April 22, 2010 at 3:38 am
I also learned something today. For the 1st time, I made the mistake of pressing enter after a single letter 's' in Sql Server 2005.
The 's' was automagically turned into 'SELECT'. Same for 'i' and 'd'. Does everybody know this, or I am the only one left in the wagon? 😀
April 22, 2010 at 3:43 am
Open Minded (4/22/2010)
I also learned something today. For the 1st time, I made the mistake of pressing enter after a single letter 's' in Sql Server 2005.The 's' was automagically turned into 'SELECT'. Same for 'i' and 'd'. Does everybody know this, or I am the only one left in the wagon? 😀
Are you sure this was SQL Server 2005? It sounds suspiciously like the IntelliSense feature that was introduced in SQL Server 2008. Or do you have a third party IntelliSense tool installed?
April 22, 2010 at 3:54 am
good to learn of this new syntax change, should have specified SQL 2008 though.
---------------------------------------------------------------------
April 22, 2010 at 3:56 am
Hugo Kornelis (4/22/2010)
Open Minded (4/22/2010)
I also learned something today. For the 1st time, I made the mistake of pressing enter after a single letter 's' in Sql Server 2005.The 's' was automagically turned into 'SELECT'. Same for 'i' and 'd'. Does everybody know this, or I am the only one left in the wagon? 😀
Are you sure this was SQL Server 2005? It sounds suspiciously like the IntelliSense feature that was introduced in SQL Server 2008. Or do you have a third party IntelliSense tool installed?
My apologies. It seems I had installed 'SSMS Tools Pack' a week ago or so? Then I forgot about it...On closer look at the page, it was for 'an Add-In for Microsoft SQL Server Management Studio (Express)'.
April 22, 2010 at 4:05 am
insert into a (b) values (1), (2), (3)
The above statement will result in the error mentioned below in case u use any other version of SQL other than SQL 2008
Incorrect syntax near ','.
So the questions should be generic enough to be compatible with all the available versions of SQL.
April 22, 2010 at 4:06 am
Useful, if only to learn about the new INSERT syntax
April 22, 2010 at 4:33 am
Hugo Kornelis (4/22/2010)
Good question. Not sure why it's worth 2 points; knowing that TRUNCATE can be rolled back should be elementary knowledge.Abrar Ahmad_ (4/22/2010)
[font="Verdana"]Goodish, easy hunt. but for the only SQL Server 2008 users.:-D[/font]Why is it only for SQL 2008 users? You are not supposed to answer by running the code, but to guess based on your knowledge. If you follow announcements and read articles, you know about the new INSERT syntax in SQL2008. (But it would have been better if the words "SQL Server 2008" had been included somewhere in the question).
I toyed with the idea of including 2008 in there, but I felt it gave better challenge if the code couldn't be run.
Anyhow I see how hard it is to get a "perfect" question in there. Takes a lot of thinking.
April 22, 2010 at 4:36 am
Tom Brown (4/22/2010)
Useful, if only to learn about the new INSERT syntax
Cool, I'm glad many of you had a chance to learn 2 things in this question. I headr you to not make this version specific without telling you about it so I won't be this to death and answer all other posts about this.
April 22, 2010 at 4:41 am
Christian Buettner-167247 (4/22/2010)
The following setting will cause the error:
SET IMPLICIT_TRANSACTIONS ON
If this is turned on, the create table statement will also be rolled back, causing the error.
Thanks I hadn't considered that one.
April 22, 2010 at 4:43 am
Thanks for your question as well. As you already indicated, it is hardly possible to cover all cases any time. Keep up the good work!
Best Regards,
Chris Büttner
Viewing 15 posts - 16 through 30 (of 87 total)
You must be logged in to reply to this topic. Login to reply