You are here: Beginner question: find or create function « MsSQL Server « IT news, forums, messages
Beginner question: find or create function

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация