Last post Apr 14, 2015 09:29 AM by peterthegreat
Apr 13, 2015 08:07 AM|peterthegreat|LINK
I want to update all the database table columns that have a & included.
For example: change Fridges & Freezers to Fridges & Freezers
main reason being my app substitutes & for & when inserting data, then problems occur while
i query multiple tables on the key value that has been manually entered with just the & syntax.
Apr 13, 2015 09:45 PM|Fei Han - MSFT|LINK
Thanks for your post.
sp_rename could help to change the name of a user-created object in the current database. The object can be a table, index, column, alias data type, or Microsoft .NET Framework
common language runtime (CLR) user-defined type. You could refer to the following code to rename the column.
EXEC sp_RENAME '[TableName]. OldColumnName' , ' NewColumnName', 'COLUMN'
Apr 14, 2015 09:29 AM|peterthegreat|LINK
That would add difficulties during query!
I note that you can insert manually the & sign though the system automatically alters encodes the syntax. Which is what happen in my case and cause a disruption.
I wonder if i should replace the encoded part with plain & in the string, to facilitate correct function.
Would this be a major security problem?