Multi-line update SQL server 2008 + PHP

Asked

Viewed 387 times

2

How I can do multi-line updates with PHP on sql server?

I have a structure similar to that, but with many lines:

ID     nome      vencimento
11  |  Joao   |  20/02/2014      
12  |  Arthur |  21/02/2014
13  |  Ana    |  22/02/2014
14  |  Kelly  |  23/02/2014

I’d like to change each user’s due date, add another 30 days. I don’t know how to change multiple lines, if there were only 5 it would be easier. But there are 12 thousand.

How do I do ?

Thank you

1 answer

2


Can use a UPDATE with DATEADD.

UPDATE tabela SET vencimento = DATEADD(d, 30, vencimento)
  • Thank you very much, you helped me a lot.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.