Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Posts
    2

    Unanswered: Syntax problem in stored procedure

    Hello

    I am wondering if anyone can help me figure out where my syntax error is the following stored procedure.

    I receive the error: 'Syntax error near the keyword as'

    Thank you: Code follows

    CREATE PROCEDURE sp_TransferPasswords
    @ESI_NOVA_DB
    AS
    DECLARE @temppass varchar(255)

    SELECT name, password
    INTO #RemoteSyslogins
    FROM master..syslogins
    WHERE 0=1

    select @temppass = @ESI_NOVA_DB + "...ps_SQLExec 'select name, password from master..syslogins where suid >10 and suid < 16382'"
    insert into #RemoteSyslogins
    exec (@temppass)

    exec sp_configure "allow updates", 1
    reconfigure with override

    exec
    ("update master..syslogins
    set syslogins.password = #RemoteSyslogins.password
    from #RemoteSyslogins
    where syslogins.name = #RemoteSyslogins.name")

    exec sp_configure "allow updates", 0
    reconfigure with override

    drop table #RemoteSyslogins
    Last edited by jpanek; 02-18-02 at 11:15.

  2. #2
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    I guess the copy of the SP failed.
    It will be somewhere near the keyword 'as'.

    If you double click on the error message in query analyser it should show you where it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •