时间:2021-07-01 10:21:17 帮助过:43人阅读
我写了个存储过程 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
我写了个存储过程
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()
)
消息 156,级别 15,状态 1,过程 SP_Personal_AddRandom,第 29 行
关键字 'ORDER' 附近有语法错误。 请问如何改正