-4

I have a simple table with 3 columns

Installed by - some login name

Installed date - Date when bunch of scripts were run with any changes as part of that package

Version - version number when release was done

I am thinking below.

UPDATE Tablename
SET Version = '7.8.1' ;

In case above is not the correct way, How should I correctly update the version # column when release is done say when some scripts are installed today, version # needs to be updated lets say 7.8.1. Also this needs to work across all versions of SQL server from 2012 to 2019

2
  • hum... this seems like a very odd question.... update statement works on all SQL version (this is the very basic of TSQL) and it will update your column... is there something I don't get that add to the complexity behind your question ? Sep 7 at 15:45
  • @DominiqueBoucher: Agree simple, just wanted to make sure i am not breaking anything with the script i am going to use. Edited question with TSQL i am thinking
    – Newbie-DBA
    Sep 7 at 15:52
0

This "update" statement will update all rows with the provided values.

If this is what you need, then I would simply ask why you have this column on every single rows of this table...

You may want to think about adding a new table with the "version" column and update it only once.

Now to answer your question, yes this update statement is correct to change the value of the "Version" column to 7.8.1 for all rows.

Not the answer you're looking for? Browse other questions tagged or ask your own question.