0

I am migrating a database from MS SQL Server 2008 to MS SQL Server 2012. I heard that the TRANSACT SQL statements in the 2012 version expects a semicolon at the end of every statement. Since it is not possible to modify every sql file one by one, is there any parsers or add ons available to rectify this?

Please let me know if any other options are available for this requirement.

DeeJay007
  • 469
  • 4
  • 30
  • I do not think there is any big difference in syntax requirements for semicolons between those two versions. – Vojtěch Dohnal Oct 02 '14 at 10:02
  • possible duplicate of [When should I use semicolons in SQL Server?](http://stackoverflow.com/questions/710683/when-should-i-use-semicolons-in-sql-server) – Tanner Oct 02 '14 at 10:28
  • 2
    Microsoft have said it is going to be mandatory in future, but it hasn't enforced it across the board yet. It has been listed as a "depreciated engine feature" on MSDN since [SQL Server 2008](http://msdn.microsoft.com/en-us/library/ms143729%28v=sql.100%29.aspx), but even on 2014 you can write statements without them still. – Bridge Oct 02 '14 at 10:28

2 Answers2

1

the semicolon it is a 'suggestion' related to standard SQL language; the standard SQL language says that you should terminate the statements with a semicolon.

this is true for 2008 and 2008R2 also: you should terminate statements (should you will to write standard compliant statements) and you can do so if you chose to.
it was not mandatory and it is still not mandatory; you can terminate with a semicolon as SQL standard suggest but it is your choice.

there is some exception like the CTE statement or the merge statement; the termination of almost all other statemens is optional.

don't start to work just because 'i heard that...'.

Paolo
  • 2,224
  • 1
  • 15
  • 19
1

According to Deprecated Database Engine Features in SQL Server 2014, the mandating of semicolons is deferred to a future version of SQL Server, as yet unnamed.

I honestly can't see them ever actually pulling the trigger on this one, precisely for the reason you have encountered. The non-use of the semicolon is just too ingrained and would be an absolute deal-breaker.

md4
  • 1,609
  • 11
  • 13
  • 1
    I was on a course run by Itzik Ben-Gan last year and the first character he would always type in the query window would be a semi-colon. He seemed to be of the opinion that it is better to be safe as it might get enforced. – whytheq Oct 02 '14 at 10:43