Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating SQL Server table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01655887
Message ID:
01655902
Views:
49
>I was about to post same thing as Borislav, was a minute to late... Anyways, SQL generates two "cursors" you can use in the OUTPUT, inserted and deleted, the first one represents the new (inserted) values and the second one represent the old (deleted) values, it is easy to see in this sample code:
>
>

>declare @test table (pk int, event varchar(10), EventTime datetime)
>
>insert into @test (pk, event, EventTime) values (1, 'Start', '')
>
>update @test set eventtime = getdate() output deleted.pk, deleted.eventtime, inserted.eventtime where pk = 1
>

Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform