Errors: “INSERT EXEC statement cannot be nested.” and “Cannot use the ROLLBACK statement within an INSERT-EXEC statement.” How to solve this?

This is a common issue when attempting to ‘bubble’ up data from a chain of stored procedures. A restriction in SQL Server is you can only have one INSERT-EXEC active at a time. I recommend looking at How to Share Data Between Stored Procedures which is a very thorough article on patterns to work around … Read more

Bulk load data conversion error (truncation)

It’s picking up the commas within the comments field as delimiters, because the delimiters are not consistent. The best solution is to insure that all fields are wrapped with double quotes and set FIELDTERMINATOR to ‘”,”‘. Alternately, replace the commas with something unlikely to be in the comments (like ~) and set FIELDTERMINATOR = ‘~’.

Using RegEx in SQL Server

You do not need to interact with managed code, as you can use LIKE: As your expression ends with + you can go with ‘%[^a-z0-9 .][^a-z0-9 .]%’ EDIT:To make it clear: SQL Server doesn’t support regular expressions without managed code. Depending on the situation, the LIKE operator can be an option, but it lacks the flexibility that regular expressions provides.

Sql query to insert datetime in SQL Server

You will want to use the YYYYMMDD for unambiguous date determination in SQL Server. If you are married to the dd-mm-yy hh:mm:ss xm format, you will need to use CONVERT with the specific style. 5 here is the style for Italian dates. Well, not just Italians, but that’s the culture it’s attributed to in Books Online.