• Renuka__ (8/30/2013)


    Thank you for the replies.

    I was trying to avoid complex queries too; however, inner Select query in the UPDATE statement returns multiple domain names, so it returns 'subquery returned more than 1 value' error and the update fails.

    I am still trying...

    Thank you.

    If you are using my code this error means that you have multiple domains in table1 for at least one server.

    This means that you must decide which Domain you wan to use in this case.

    If using the last domain in alphabetic order is ok for you something like this should work:

    update Table2

    set Domain = isnull((select max(Domain) from Table1 t1 where t1.ServerName = Table2.ServerName), 'Unknown')