I have two sets of string values that are being passed into a proc, then I am joining them together into a table variable.Within the table variable, I need to remove all duplicate rows (e.g. where colA and colB have the same data on multiple rows).Can anyone advise how to do this please? I've seen dozens of methods on Google but all seem to come under fire from the pro's for being highly inefficient.DECLARE @tbl_u TABLE (ID int IDENTITY(1,1), colA int)DECLARE @tbl_s TABLE (ID int IDENTITY(1,1), colB int)INSERT INTO @tbl_u (colA) SELECT IdVal FROM dbo.fn_CreateIdTable(N'3,4,5,41,3,43,44,46,52,55,56,51,3,4,5,41,43,44,46,52,55,56,51,', ',')INSERT INTO @tbl_s (colB) SELECT IdVal FROM dbo.fn_CreateIdTable(N'14,14,14,14,14,14,14,14,14,14,14,14,9,9,9,9,9,9,9,9,9,9,9,', ',')SELECT u.ID, u.colA, s.colBFROM @tbl_s s INNER JOIN @tbl_u u ON u.ID = s.ID
