On this case, RETURNS_ID is a PK with IDENTITY(1,1). I could do this:
SELECT * INTO #TempTable
FROM Hosea_tblDef_RETURNS
WHERE Product_Id = 'AGP1'
AND (Fund_Id = 'E016' or Fund_Id is null)
ALTER TABLE #TempTable
DROP COLUMN RETURNS_ID
SELECT * FROM #TempTable
DROP TABLE #TempTable
but the problem is that I will never know if the table has a PK with IDENTITY(1,1) or not since the user will be inputting the name of the table.I want a generic solution that will cater for any table. the solution I have now works fine for tables without PK. I tested with a table having PK IDENTITY(1,1) then I ran into this problem.