Sunday, February 19, 2012

Dynamic Sql to update a table row

Hi All MSSQL Experts-

I am facing a typical problem in one of my store procedure.

I am trying to update a table thru a dynamically generated SQL statement.

In my stored procedure I do all kinds of looping and manipultion to get this statement and execute like this:

mSQL = 'UPDATE TblSomeTable SET FldSomeFile=200 WHERE FldPK=100'
EXEC (mSQL)

This stuff has always worked for me, for Temporary tables, but some how does not seem to work on physical table. Am I doing something wrong? Missing something?

Any help will be greatly appreciated.

Best Wishes,Hi All-

Please never mind, the problem was with my field being int and the value I was trying to set it to was somethnig like 0.233, which eventually kept putting in there...

Regards

No comments:

Post a Comment