Home > database >  Variable assignment problem
Variable assignment problem

Time:02-26

No value in the table below pNo, what reason be? How is spelled correctly?

DECLARE @ AMHandleUser varchar
The SET @ AMHandleUser='zhang'
INSERT INTO [dbo] [Alarm_log] (pNo, pName)
The SELECT pNo=@ AMHandleUser, pName=@ AMHandleUser

CodePudding user response:

Scattered points, has found a reason:
The SET @ AMHandleUser='zhang' should SELECT @ AMHandleUser

CodePudding user response:

Correct, it should be like this:
DECLARE @ AMHandleUser varchar (50)
  • Related