954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

VB-MySQL Check if exist then insert

I have created a very long code on my app for checking if a record exist then insert.

Is it possible for a single SQLString to check if records exist then update or insert?

Sorta like

IF NOT EXISTS (SELECT column1 FROM table WHERE column1 = 'sample1')
THEN
(INSERT INTO table(column1,column1,column1) VALUES('sample','sample','sample'))
END IF
yorro
Junior Poster
121 posts since Aug 2009
Reputation Points: 8
Solved Threads: 7
 

@yorro : Is it possible for a single SQLString to check if records exist then update or insert?

Use Stored-Procedure.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Note that my mySQL does not work, does anyone have a sample code for a mySQL with a condition of IF EXIST before inserting?

yorro
Junior Poster
121 posts since Aug 2009
Reputation Points: 8
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: