How can we help you today? How can we help you today?

Bug with Output clause in latest beta

Enter the following snip of code into SSMS.
Use AdventureWorks
Go

Update  Person.Address
Set     AddressLine1 = AddressLine1
Output  Deleted.*,
        Inserted.*
Now, go to after the asterisk in "Deleted.*" and/or "Inserted.*" and press tab to expand the column names. Deleted and Inserted (if you did both) get replaced with "Address" (and not even the schema corrected name of "Person.Address").

The "-- Deleted" and "-- Inserted" comments below are mine...
Update  Person.Address
Set     AddressLine1 = AddressLine1
Output  Address.AddressID, -- Deleted
        Address.AddressLine1, -- Deleted
        Address.AddressLine2, -- Deleted
        Address.City, -- Deleted
        Address.StateProvinceID, -- Deleted
        Address.PostalCode, -- Deleted
        Address.rowguid, -- Deleted
        Address.ModifiedDate, -- Deleted
        Address.AddressID, -- Inserted
        Address.AddressLine1, -- Inserted
        Address.AddressLine2, -- Inserted
        Address.City, -- Inserted
        Address.StateProvinceID, -- Inserted
        Address.PostalCode, -- Inserted
        Address.rowguid, -- Inserted
        Address.ModifiedDate -- Inserted

Thanks,
Jim
JimF
0

Comments

3 comments

  • Aaron L
    Thanks Jim! :)
    We'll get a fix out for this next week. Since inserted and deleted are copies of address it's probably got confused over what the owner qualification is meant to be.
    Aaron L
    0
  • JimF
    Thanks Aaron,

    I guess I should have phrased my OP a bit differently and just left off the part about the incorrect schema as in this case the names Inserted and Deleted need to be kept.

    I hope I wasn't being too confusing there.

    Jim
    JimF
    0
  • Aaron L
    Hi Jim,

    This should now be fixed in 6.4.0.537 - Your first post was very clear and it was easy for us to recreate on AdventureWorks :)
    We did notice that the expand wildcards has some odd alignment after expanding the columns (I think it always has) so we'll also have a quick look into seeing if we can fix that too.

    Thanks,
    Aaron.
    Aaron L
    0

Add comment

Please sign in to leave a comment.