使用SQL查询
如何在where条件下使用日语关键字。例如:使用SQL查询,sql,sql-server,Sql,Sql Server,如何在where条件下使用日语关键字。例如: select * from tbl_Mst_Product_Language where Name = N'闲云舒展' 在上面的查询中,在where条件下,我使用了日语关键字,效果很好。但是我想把这个值放在变量中,因为我需要从c#传递这个值 我所面临的问题是,我试图把条件放在变量中的什么地方。比如说 declare @test as nvarchar(max) set @test = '闲云舒展' select * from tbl_M
select * from tbl_Mst_Product_Language where Name = N'闲云舒展'
在上面的查询中,在where条件下,我使用了日语关键字,效果很好。但是我想把这个值放在变量中,因为我需要从c#传递这个值
我所面临的问题是,我试图把条件放在变量中的什么地方。比如说
declare @test as nvarchar(max)
set @test = '闲云舒展'
select * from tbl_Mst_Product_Language where Name = @test
如果您有:
declare @test as nvarchar(max)
set @test = '闲云舒展'
select * from tbl_Mst_Product_Language where Name = @test
尝试:
那么问题出在哪里呢?就这么做吧。请解释一下你被困在哪里,因为就目前的情况而言,这不是一个问题。
set@test=闲云舒展'代码>可能更好,因为set@test=N'闲云舒展'代码>
declare @test as nvarchar(max)
set @test = N'闲云舒展' -- Note here, N
select * from tbl_Mst_Product_Language where Name = @test