无法执行varchar值到varchar的隐式转换,因为由于排序规则冲突而无法解析值的排序规则

时间:2017-05-10 14:25:49

标签: sql-server

Tenho o problem a seguir

Drop table #notaserr
Drop table #Bases

select distinct idpedidoprojeto, idnf, datahora, status, idprojeto into #NotasErr
from nf 
where status in (62,65,66,70,85,86)
and datahora >= dateadd ( hh , -12, getdate() )
order by datahora desc

select  idprojeto, Descricao,siglaProjeto,Base, '['+substring(StringConexao,8,25)+']' Conexao, row_Number() over(partition by null order by Base) id
into #Bases
from Projeto
where stringConexao is not null
and descricao not in ('Lilly PharmaSystem')

declare @teste nvarchar (max)
select @teste = 'select distinct nf.idnf, nf.pedido from '+Conexao+'.'+Base+' TBLNF NF (NOLOCK)' from #bases
exec (@teste)

0 个答案:

没有答案