insert DiscoveryDevice
(
	 DeviceGuid
	,IsLocal
)
select 
		 top(1) DV.DeviceGuid
		,1
  from Device          DV
  left
  join DiscoveryDevice DD
                            on DV.DeviceGuid = DD.DeviceGuid
 where
       DD.DeviceGuid is null                              
go