Found this http://xkcd.com/327/ Damn now I know what to name my children. ><
T-SQL Merge and Strongly Typed DataSets
Merge is a great new function in sql 2008 (other databases have had it for a while I know)
I'm currently working in a project where I mixed it with a strongly typed dataset. It saved me allot of time when it came to updating/inserting tabels
First off the MERGE command
The tabel Identification handel som user information about there Identification. (Face2Face)
First off i create a row with the incoming information.
[code=sql]
USING ( SELECT @Label as Label , @Info as Info, @Creator as Creator, @CreateDate as CreateDate, @PartyID as PartyID ) AS src
Then the magic.
ON (Identification.PartyID = [src].PartyID)
This will check with the destionation table if there is a row there that matches
if so Update else Insert
The whol thing...
MERGE Table USING ( SELECT @Label as Label , @Info as Info, @Creator as Creator, @CreateDate as CreateDate, @PartyID as PartyID ) AS src ON (Identification.PartyID = [src].PartyID) WHEN MATCHED THEN UPDATE SET Label = @Label , Info = @Info , CreateDate =@CreateDate , PartyID = @PartyID WHEN NOT MATCHED THEN INSERT ([Label] ,[Info] ,[Creator] ,[CreateDate] ,[PartyID]) VALUES (@Label ,@Info ,@Creator ,@CreateDate ,@PartyID) ;
This is run inte a stored procedure called IndentificationSave
So there you have a Save command
Next part Strongly typed DataSet
Hi, So you found this site. Great hope you find somehting you like. This is more of a test site and ref. Not large post no personal stuff.
The Development feeds These are note mine post but rather some from diffrent sites so I can have a quick view of whats cooking out there. I'l add some more and some local buffing in the future.
The feeds are: codeplex, asp.net, msdn, ajaxian.