I'm hoping to use the following update\insert method to speed up my application insert\updates:
UPDATE [Application_Type_Table]
SET ApplicationType='Test Value'
WHERE ID='1'
IF @@ROWCOUNT=0
INSERT INTO [Application_Type_Table] VALUES ('Test Value')
How would I do this with sql parameters? the rowcount function will be picked up as a parameter due to the @@.
sqlCommand.CommandText = _
"UPDATE [Application_Type_Table]" _
SET (SET ApplicationType=@TestValue" _
"WHERE ID=@RecordID IF @@ROWCOUNT=0 INSERT INTO [Application_Type_Table] VALUES (@TestValue)"
http://blogs.msdn.com/b/miah/archive/2008/02/17/sql-if-exists-update-else-insert.aspx