Home > Database > Mysql Tutorial > sqlserver 随机数问题

sqlserver 随机数问题

WBOY
Release: 2016-06-07 15:39:38
Original
1295 people have browsed it

我写了个存储过程 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' 附近有语法错误。 请问如何改正 

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template