Posted by Tony Rogerson on 12/21/06 17:07
The first one; its more portable between versions of SQL Server, the second
only works in SQL 2005 and upwards.
--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"fireball" <fireball@onet.kropka.eu> wrote in message
news:embrdl$n8d$1@atlantis.news.tpi.pl...
> which is more proper:
> if DB_ID(@db) IS NOT NULL
> or
> IF EXISTS (SELECT name FROM sys.databases WHERE name = @db)
> ?
>
>
>
>
> regards
>
>
Navigation:
[Reply to this message]
|