Posted by jrpfinch on 01/18/07 12:07
I have a table with two columns: siteID (int primary key) and siteName
(varchar(50) unique constraint).
I am completely new to databases and UDFs and would like to write a
function that looks for a particular siteName and returns the siteID.
If the siteName is not found then it would create a record and return
that record's siteID.
I am pretty sure there is a standard way of doing it and have been
looking for examples, but have yet to find anything on Google.
If anyone could point me in the right direction I would be very
grateful - I am still looking and will reply if I find anything.
Many thanks
Jon
Navigation:
[Reply to this message]
|