use NPPD_App350
--INSERT INTO [NPPD_App350].[SDT].[A03458EF-C95B-4DFB-805F-7DAC1E44BCC2]
select distinct  NEWID()  ,GETDATE(),'79C16D01-82FF-4272-BDE4-01C7AF51DBC7',  convert (nvarchar(max),[melicode]) ,convert (nvarchar(max),[PasAndazSazman])
,convert (nvarchar(max),[PasAndazKarmand]) ,convert (nvarchar(max),[shenasname]) ,
convert (nvarchar(max),[fathername]),convert (nvarchar(max),[telno]) ,
convert (nvarchar(max),[DepName]),convert (nvarchar(max),[Mandeh] ) 
,convert (nvarchar(max),[emtiaz]  )  ,convert (nvarchar(max),[PersNo])
,convert (nvarchar(max),[CartNo]),convert (nvarchar(max),[VamGhabeleDaryaft])
,convert (nvarchar(max),[PerName]) as nn ,convert (nvarchar(max),[PerFam]) ,convert (nvarchar(max),[Tarikh]), m1.[A35B3D58-38F5-4AF6-935B-437B5E30ED23]
from Cash.dbo.ViewForFAVA 
  join  (select Distinct [F85A0738-EB36-48EE-A696-1BB4C89FE7AB],[A35B3D58-38F5-4AF6-935B-437B5E30ED23] from  [NPPD_App350].[SDT].[A03458EF-C95B-4DFB-805F-7DAC1E44BCC2] ) m1
on m1.[F85A0738-EB36-48EE-A696-1BB4C89FE7AB] = Cash.dbo.ViewForFAVA.melicode
--where [Tarikh] = '1395/02/31' order by nn




