Hi,
I have query with union .
DECLARE @U2TableName AS VARCHAR(200)='CIS.CUST.MAST' INSERT INTO BIBKUL8.eMarine_Demo.[dbo].UpdateU2 select @U2TableName AS TableName,Name As Field,'1010001'+ CustomerCode AS Z_ID ,'1' AS Pos from CIS WHERE ExportedToU2 IS NULL UNION select @U2TableName AS TableName,Initial As Field,'1010001'+ CustomerCode AS Z_ID ,'2' AS Pos from CIS WHERE ExportedToU2 IS NULL UNION select @U2TableName AS TableName,ModuleType As Field,'1010001'+ CustomerCode AS Z_ID ,'3' AS Pos from CIS WHERE ExportedToU2 IS NULL
How to write above query without UNION is nothing but in a SINGLE STATEMENT?
Please help me to solve.
Thank you in advance.
- Edited by Narsa 4 hours 11 minutes ago