Jump to content

Archived

This topic is now archived and is closed to further replies.

stockton

update on duplicate in mssql

Recommended Posts

I believe that one can do something like

INSERT ....... ON DUPLICATE UPDATE field = field in mssql

Is this true and if so what is the correct format?

Share this post


Link to post
Share on other sites

That's MySQL specific syntax. I believe it does not exist im MSSQL

Share this post


Link to post
Share on other sites

Thank you, no wonder I could not find it.

Share this post


Link to post
Share on other sites

Is there something similar one could use in MSSQL to achieve the same purpose?

Share this post


Link to post
Share on other sites

As Mchl said, UPDATE INTO (or the longer INSERT INTO  ON DUPLICATE....) is MySQL specific, and as far as I know, nothing like it exists in MSSQL.

 

 

You can either use two queries, or you can use a stored procedure.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.