Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Insert/Update memo/varchar fields

Author  Topic 

pal52
Starting Member

1 Post

Posted - 2008-12-05 : 04:34:42
Hi

I have an app which uses memo fields for free hand entry of information. The free hand information may well contain characters that have a meaning to SQL command strings, how do I get my information into the field?

Regards

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2008-12-05 : 04:59:54
If you mean, the information you need to insert is having sql key words, then I don't think is a problem. An insert like this shouldn't be a problem,
INSERT into TableA values
('select * from taba','truncate table taba')
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2008-12-05 : 05:02:45
If you use stored procedures with input parameters reserved characters /words will be treated as strings and the same as any other.
You could also have a function in your app which checks the strings for characters (e.g apostrophe) you want to exclude which removes them then pass into parameter.
Go to Top of Page
   

- Advertisement -