Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Update all fields in table

Author  Topic 

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2009-05-28 : 12:58:09
Having a bit of trouble getting this simple on right LOL...

All I need to do is take on field in all rows of a table
and multiply by 12, and some fields are null....

thanks,

Zath

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-28 : 13:08:38
[code]UPDATE Table
SET field1=field1*12,
filed2=filed2*12,...
[/code]
Go to Top of Page

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2009-05-28 : 13:11:40
Yea, I knew it was something simple like that.
I was trying to take into account the null fields but didn't have to.

Thanks,

Zath
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-28 : 13:17:09
yup...no need as multiplying by null yields only null
Go to Top of Page
   

- Advertisement -