Hai all....
I want to insert a data into the database only if the data is not present already....
If it is i'll just skip the insert statement........
How am i go about it.............
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vijaya KadiyalaPosted Feb 19, 2009, 11:44 AM
Hi
With MERGE you can avoid lot of coding around this. Yes simple thing is using Select but you need to place this logic in T-SQL block in order meet his requirement. If we go with MERGE then its not required to have it in T-SQL.
Thanks
Vijaya Kadiyala
Http
://dotnetvj.blogspot.comLisaPosted Feb 17, 2009, 4:42 AM
why complicating using merge
you can always check for the record in the database based on id, name ... if found leave it else insert into the database
Thanks,
Lisa
Len La SalaPosted Feb 9, 2009, 7:39 PM
Just another way to do it
Vijaya KadiyalaPosted Feb 5, 2009, 3:02 PM
Hi
Check out the below link
http://sqlserver-tips.blogspot.com/2006/09/mimicking-merge-statement-in-sql.html
Thanks
Vijaya Kadiyala
http
://dotnetvj.blogspot.comVijaya KadiyalaPosted Feb 5, 2009, 3:02 PM
Hi
Check out the below link
http://sqlserver-tips.blogspot.com/2006/09/mimicking-merge-statement-in-sql.html
Thanks
Vijaya Kadiyala
http
://dotnetvj.blogspot.comPosted Feb 2, 2009, 11:46 PM
But i beleive the option is for sql server 2008....But i am using sql server 2005.....
How am i go about it.........
Vijaya KadiyalaPosted Feb 2, 2009, 1:30 PM
You can use MERGE feature of SQL Server
Check out the below link
http://www.sqlservercurry.com/2008/05/sql-server-2008-merge-statement.html
Thanks -- VJ