I wrote a stored procedure ALTERPROCEDURE [dbo]. [SP_Personal_AddRandom] @ countINT, @ StageIDINT, @ PassWordNVARCHAR (50), @ CreateUserINTASINSERTINTOdbo. personal (StageID, TypeID, PersonalName, Password, CreateUser) (SELECTTOP (@ Coun
I wrote a stored PROCEDURE ALTER PROCEDURE [dbo]. [SP_Personal_AddRandom] @ count INT, @ StageID INT, @ PassWord NVARCHAR (50), @ CreateUser int as insert into dbo. personal (StageID, TypeID, PersonalName, Password, CreateUser) (select top (@ Coun
I wrote a stored procedure.
Alter procedure [dbo]. [SP_Personal_AddRandom]
@ Count INT,
@ StageID INT,
@ PassWord NVARCHAR (50 ),
@ CreateUser INT
AS
Insert into dbo. Personal
(StageID,
TypeID,
PersonalName,
Password,
CreateUser
)
(Select top (@ Count)
@ StageID,
TypeID,
Name,
@ PassWord,
@ CreateUser
FROM dbo. SysPersonnel
Order by newid ()
)
Message 156, Level 15, status 1, process SP_Personal_AddRandom, 29th rows
There is a syntax error near the keyword 'order. How can I correct it?