当前位置: 代码迷 >> Sql Server >> 求帮帮忙。
  详细解决方案

求帮帮忙。

热度:34   发布时间:2016-04-27 14:41:48.0
求大虾帮帮忙。。。。
CREATE TABLE tbEnergyCollection1111 (
[ID] [int] IDENTITY(1,1) NOT NULL,
[AcqItemID] [int] NULL,
[CollectionTime] [datetime] NULL CONSTRAINT [DF_tbEnergyCollection_CollectionTime] DEFAULT (getdate()),
[Quantity] [decimal](24, 4) NULL,
[DiffQuantity] [decimal](24, 4) NULL,
[origQuantity] [decimal](24, 4) NULL,
[updatetime] [datetime] NULL CONSTRAINT [DF_tbEnergyCollection_updatetime] DEFAULT (getdate())
) ON [PRIMARY]
消息 214,级别 16,状态 2,过程 sp_executesql,第 1 行
过程需要类型为 'ntext/nchar/nvarchar' 的参数 [email protected]'。



怎么解决!!

------解决方案--------------------
sp_executesql 的参数需要用 unicode 类型的。 包括变量也要用Unicode

所以 @statement = N'XXXXX'

转换一下吧 

------解决方案--------------------
SQL code
--过程需要类型为 'ntext/nchar/nvarchar' 的参数 [email protected]'。--这个报错很明显了unicode型的前面要加N'
  相关解决方案