Update in multiple lines SQL server 2008 + PHP

2

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

I have a structure similar to this, 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 would like to change the expiration date of each user, add another 30 days. I do not know how to change multiple lines, if they were only 5 it was easier. But there are 12 thousand.

How do I do it?

Thank you

    
asked by anonymous 21.08.2014 / 13:55

1 answer

2

You can use UPDATE with DATEADD .

UPDATE tabela SET vencimento = DATEADD(d, 30, vencimento)
    
21.08.2014 / 14:01