• Yes.

    Typically a LEFT OUTER JOIN is used for that.

    Say you're inserting names and want to avoid inserting one that's already in the table:

    INSERT INTO dbo.names_table ( name )

    SELECT wt.name

    FROM dbo.work_table wt

    LEFT OUTER JOIN dbo.names_tables nt ON

    nt.name = wt.name

    WHERE

    nt.name IS NULL --true only if name doesn't already exist in dbo.names_table

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.