Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing files in SQL Server

Status
Not open for further replies.

bhargava

MIS
May 3, 2001
26
IN
hi all

I have a SQL database and I am to store large text files without images into the database and for the same purpose I have declared the field to be of 'ntext' type. Since I am storing formatted text it very often contains text like the text below.

Everything goes fine until '(single quotes) are detected, and once detected they start giving problem and nothing is inserted saying incorrect syntax.

Now how do I overcome this problem.

Pls. help



-------------
"The first thing that you should know about WDDX is that, while it was originally developed by Allaire, it is not something that exists only for Allaire products like ColdFusion. It was designed as an "open" solution that can be used by many different products. ' (----here the problem begins----) It can also be used to pass information between types of applications–in fact, that may be the most interesting thing about it.' In this section, you'll see what an actual WDDX Packet looks like and how to serialize and deserialize the Packet in several different programming languages.

-------------
 
What we do is replace the single quotes with apostropies "`" in the client before storing the data to the server.
 
If you replace the single quotes with 2 single quotes, SQL Server will recognize it and it will be a single quote in the imported data. Just open the text files in word and do a find and replace. Replace ' with '' Ruairi

Could your manufacturing facility benefit from real time process monitoring? Would you like your employees to be able to see up to the minute goal and actual production?
For innovative, low cost solutions check out my website.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top