Quote:>> I have a stored procedure I want to write that changes a field [sic]
in the DB based on a variable column name. <<
Don't write code this way. What you are saying is that "I have no idea
what this procedure will do until some user -- present or future --
decides for me!"
Look at your attempted code -- you have no idea what column (NOT field!)
will be changed, nor any idea what data type the target is, so you have
to use VARCHAR(n) and hope the automatic casting will do this correctly
for you. You don't even know which table will be affected.
Look up coupling and cohesion in your old software engineering books.
This is not the way to write a module.
Now, the question I have been asking at the end of most of my posts (and
getting angry reactions to): What is your first or most used programming
language? Does it have features that support what you were trying to do
Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!