S
Shadowboxer
Here's what I need to do:
essentially I have a table in a SQL database that has two columns
int_Artist and str_Artist
int_Artist is a PK field
str_Artist Needs to have unique values
if the data in str_Artist exists, I need the int_Artist Value for that
record.
What I need sql to do in a stored procedure is this:
dim x as integer
x = select Artist_ID from Artists where artist_name = 'Test'
if x = nothing then
x = INSERT into Artists (Artist_ID) values ('test')
end if
insert into blah (blah) values (x,blah)
ANY IDEAS? or does someone have something similar?
essentially I have a table in a SQL database that has two columns
int_Artist and str_Artist
int_Artist is a PK field
str_Artist Needs to have unique values
if the data in str_Artist exists, I need the int_Artist Value for that
record.
What I need sql to do in a stored procedure is this:
dim x as integer
x = select Artist_ID from Artists where artist_name = 'Test'
if x = nothing then
x = INSERT into Artists (Artist_ID) values ('test')
end if
insert into blah (blah) values (x,blah)
ANY IDEAS? or does someone have something similar?