Try as i might, i NEVER remember how to do this:
UPDATE table1
SET snakesOnAPlane = t2.data
FROM table1 t1
JOIN table2 t2 ON t2.row1 = t1.row1
WHERE t1.row3 = 'helloWorld'
Sharing some of the useful snippets of code i stumble across with the world. It will mostly be Android, cloud computing, ColdFusion, SQL, Amazon AWS and other web technologies. If you like what you read or it helps, drop in a comment and say so, it will be appreciated.
29 September 2008
22 September 2008
SQL Transaction
bit like in cfmx here's a useful bit of t-sql / sql for rolling back on error.
BEGIN TRAN
insert into ()--....sql goes here
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN
END
COMMIT TRAN
It's not perfect but it seems to work...sometimes....if the wind is blowing north, and it's a wednesday.
BEGIN TRAN
insert into ()--....sql goes here
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN
END
COMMIT TRAN
It's not perfect but it seems to work...sometimes....if the wind is blowing north, and it's a wednesday.
Subscribe to:
Posts (Atom)