找错
以下为存储过程CREATE PROCEDURE [update_LogOn_1]
(@un_1 [char],
@PW_2 [nvarchar](50),
@enb_3 [nvarchar](50))
AS UPDATE [sgjx].[dbo].[LogOn]
SET [PW] = @PW_2,
[enb] = @enb_3
WHERE
( [un] = @un_1)
GO
以下是查询分析器中的结果
DECLARE @RC int
DECLARE @un_1 char(1)
DECLARE @PW_2 nvarchar(50)
DECLARE @enb_3 nvarchar(50)
SELECT @un_1 = 'guest'
SELECT @PW_2 = N'saga'
SELECT @enb_3 = N'2'
EXEC @RC = [sgjx].[dbo].[update_LogOn_1] @un_1, @PW_2, @enb_3
DECLARE @PrnLine nvarchar(4000)
PRINT '存储过程: sgjx.dbo.update_LogOn_1'
SELECT @PrnLine = ' 返回代码 = ' + CONVERT(nvarchar, @RC)
PRINT @PrnLine
(所影响的行数为 0 行)
存储过程: sgjx.dbo.update_LogOn_1
返回代码 = 0
各位高手帮忙看下,倒底是哪里出错了?
--------------------编程问答--------------------
DECLARE @un_1 char(1) -- 定义长度为1
SELECT @un_1 = 'guest' --这里的字符长度超过了1个字符
补充:.NET技术 , VB.NET