Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    40

    Unanswered: string concatenation

    create procedure ChangePassword(@sUser char(20),@sPassword char(20))
    as
    begin
    execute immediate 'GRANT CONNECT TO ' + @sUser + ' IDENTIFIED BY ' + @sPassword
    grant execute on ChangePassword to public
    end

    I m getting syntax error at '+' sign. I saw in BOL and it is exactly the same.
    Can nyone help me out?


    Thx

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Where did you get such syntax from?

    This works:

    declare @sql varchar(25)
    set @sql=',getdate()'
    execute ('select getdate()'+@sql)

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Smells like Oracle syntax to me.

Posting Permissions

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