View Single Post
Old September 11th, 2006, 06:49 AM
dparsons dparsons is offline
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

quote:Originally posted by mike_remember

This won't be possible if you use text command to insert the data, i.e. "insert into ........". This can be done if you use a stored procedure to insert the data.

So the suggestion is to create a simple stored procedure and insert the data with apostrophe.


Thats an incorrect statement, you can pass SQL commands such as scripts is describing without creating a Stored Procedure. The problem here is the ('), that is a reserved character in TSQL as it defines the bounds for data that is being placed in X column (where strings are concerned).

The Answer here is to replace the (') with a special character (e.g. the ASCII equivelant) and that will correct the problem.

"The one language all programmers understand is profanity."