I\'m trying to achieve the following in SQL Server 2005:
SELECT (IF EITHER EXISTS) usr.username, pro.email FROM table1 AS usr, table2 AS pro WHERE usr.username = \'ex
Its not really clear what you want. Since you're not joining the tables I'm assuming you really want the union of the two
SELECT
usr.UserName foo
FROM
table1 AS usr
WHERE
usr.username = 'existing_username'
UNION ALL SELECT
pro.email foo
FROM
table2 AS pro
WHERE
pro.email = 'existing_email'
If you want to know where it came from you could do
SELECT
usr.UserName foo,
'usr' source
FROM
table1 AS usr
WHERE
usr.username = 'existing_username'
UNION SELECT
pro.email foo
'email' source
FROM
table2 AS pro
WHERE
pro.email = 'existing_email'