By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,413 Members | 1,594 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,413 IT Pros & Developers. It's quick & easy.

Constraint on existing table, multiple columns

P: 6
I need to add a constraint to every varchar column in an entire database to not allow '<script>' to be inserted or updated. Any resource you know of that would explain how I would go about this? I was thinking to program it with a stored procedure. Something like, get a table name, get all the varchar columns in that table, build the constraint statement on the fly, execute the statement, go to the next table. If I had that, then I could save that stored procedure and change it to accomodate dropping the constraint, when needed, to perform maintenance that would conflict.
Feb 9 '09 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
Looks like you're thinking of creating a stored proc that you can execute and avoid creating the script on every table.

Yes, your technique would do. It's a one-time thing anyway...

-- CK
Feb 13 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.