Incorrect syntax near means the parser met a word it did not expect, and a low compatibility level is one cause. This post reproduces the error, shows how to read and raise the level, and covers the other common causes.
SQL SERVER – Transaction and Local Variables – Swap Variables – Update All At Once Concept
Two ideas with examples: transactions have no effect on local variables, and an UPDATE applies all its changes at once, which lets you Swap Variables in one go.
SQL SERVER – Introduction to CLR – Simple Example of CLR Stored Procedure
An introduction to CLR in SQL Server 2005 and later, with a simple CLR Stored Procedure built in Visual Studio that prints the current system datetime.
SQL SERVER – Retrieve – Select Only Date Part From DateTime – Best Practice – Part 2
Which way to select only date part from DATETIME is faster? After more tests on large tables, I now suggest the DATEADD and DATEDIFF method over CONVERT.
SQL SERVER – Get Common Records From Two Tables Without Using Join
Sachin wanted common records from two tables without writing a join condition. Imran Mohammed shows how INTERSECT in SQL Server 2005 does it.
Closure Table: Read and Validate Hierarchy Paths
A closure table stores ancestor and descendant paths. Read those relationships efficiently and compare them with the authoritative parent edges.
SQL SERVER – Downgrade Database to Previous Version
Can you downgrade database files from SQL Server 2005 to 2000? No tool does it. Install the old version, recreate the schema and move the data yourself.







