declare @recordcount int
declare @str nvarchar(500)
set @str = N 'select @recordcount = count(*) from [ '[email protected]+ '].[dbo].[ProjectInfo] '
exec sp_executesql @str, N '@recordcount int output ', @recordcount output
if (@recordcount =0)
..........
------解决方案--------------------
U r right.