Results 1 to 5 of 5
  1. #1
    Join Date
    May 2002
    Posts
    12

    Unanswered: Sybase 11.9 equivalent of Microsoft's sp_executesql?

    Does Sybase 11.9 have an equivalent to Microsoft's sp_executesql?

  2. #2
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    If you explained what it was, maybe we could help.
    Thanks,

    Matt

  3. #3
    Join Date
    May 2002
    Posts
    12
    sp_executesql is a stored procedure that allows you to execute a Transact-SQL statement that is passed in as a variable. It allows you to build and execute statements dynamically.

    For example:

    create procedure drop_table
    @table_name nvarchar(100)

    as

    declare @stmnt nvarchar(1000)

    select @stmnt = 'drop table ' + @table_name

    sp_executesql @stmnt

  4. #4
    Join Date
    Mar 2001
    Location
    Lexington, KY
    Posts
    606
    ASE 12 and up offers dynamic SQL via the exec( @sql ) function.

    As for 11.9 and below, you are out of luck unless you perform some hackery:
    http://www.sypron.nl/dynsql.html
    Thanks,

    Matt

  5. #5
    Join Date
    May 2002
    Posts
    12
    Thanks for the help! I appreciate it!

Posting Permissions

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