Upgrade to 4.5 - Incorrect syntax near ','.

(5 posts) (2 voices)

Tags:

No tags yet.

  1. ziuras, Member

    Hi i have an error on update procedure
    I use MS SQL server 2005
    ------------------------------
    if not exists (select * from mydbr_snippets) begin
    insert into mydbr_snippets (name, code, shortcut, cright, cdown)
    values
    ('select-clause', 'select '+char(10)+'from '+char(10)+'where ', 'Ctrl-Alt-S', 7, 0),
    ('if-clause', 'if () begin'+char(10)+'end', 'Ctrl-I', 4, 0),
    ('if-else-clause', 'if () begin'+char(10)+'end else begin'+char(10)+'end', 'Ctrl-Alt-I', 4, 0),
    ('while-clause', 'while () begin'+char(10)+'end', 'Ctrl-Alt-W', 7, 0),
    ('create procedure', 'create procedure sp_DBR()'+char(10)+'as'+char(10)+'begin'+char(10)+''+char(10)+'end', 'Ctrl-P', 23, 0),
    ('create function', 'create function fn_() '+char(10)+'returns varchar(255)'+char(10)+'begin'+char(10)+''+char(10)+'declare @v_ret varchar(255)'+char(10)+''+char(10)+'return @v_ret'+char(10)+''+char(10)+'end'+char(10)+'go', '', 19,0),
    ('cursor', 'declare c_cursor cursor for '+char(10)+
    'select '+char(10)+
    'from '+char(10)+char(10)+
    'open c_cursor'+char(10)++char(10)+
    'fetch next from c_cursor '+char(10)+
    'into @'+char(10)+
    'while (@@fetch_status = 0) begin'+char(10)+
    ' -- Do something'+char(10)+
    ' fetch next from c_cursor into @'+char(10)+
    'end'+char(10)++char(10)+
    'close c_cursor'+char(10)+
    'deallocate c_cursor', '', 7, 1)
    end

    Posted 3 years ago #
  2. ziuras, Member

    in mydbr database there are not 'mydbr_snippets' table.

    Posted 3 years ago #
  3. ziuras, Member

    Ok i created mydbr_snippets table
    but ms sql 2005 syntex alow only one row to be inserted at once.

    insert into table(c1, c2)
    values (1, 2)

    insert into table(c1, c2)
    values (3, 4)

    or

    insert into table(c1, c2)
    select 1, 2 union all
    select 3, 4
    ...

    Posted 3 years ago #
  4. myDBR Team, Key Master

    Yes,
    it's an issue with SQL Server 2005. It's now fixed in the latest build. Thanks for reporting the issue.

    --
    myDBR Team

    Posted 3 years ago #
  5. ziuras, Member

    Thanks, problem solved

    Posted 3 years ago #

Reply

You must log in to post.