Competition: What’s your favorite Redgate tool? Enter now.

Prompt shows wrong fieldnames with EXCEPT or INTERSECT

MauriceMaurice Posts: 14 Bronze 1
edited November 26, 2015 3:12AM in SQL Prompt
When expanding a wildcard in a EXCEPT or INTERSECT query it shows the fields from the first SQL statement when you expect the field from the second statement.

SQLPrompt version 7.1.0.118
CREATE TABLE [dbo].[tblTabel1] (
		tbl1Field1 BIGINT IDENTITY(1,1) NOT NULL
		, tbl1Field2 nvarchar(10)
		, tbl1Field3 nvarchar(10))


CREATE TABLE [dbo].[tblTabel2] (
		tbl2Field1 BIGINT IDENTITY(1,1) NOT NULL
		, tbl21Field2 nvarchar(10)
		, tbl2Field3 nvarchar(10))

		
SELECT * FROM [dbo].[tblTabel1]
EXCEPT
SELECT [tblTabel1].[tbl1Field1]
     , [tblTabel1].[tbl1Field2]
     , [tblTabel1].[tbl1Field3] FROM [dbo].[tblTabel2]	

Comments

Sign In or Register to comment.