Results 1 to 5 of 5

Thread: SQL Server Call C++ function?

  1. #1
    xy Guest

    SQL Server Call C++ function?

    Hi,

    Does anyone know if/how SQL server can call a function in a C++ library?

    Cheers,

    Xiaobing

  2. #2
    Ray Miao Guest

    SQL Server Call C++ function? (reply)

    Yes if you can build them as extended stored procedures.


    ------------
    xy at 12/11/2001 7:40:31 AM

    Hi,

    Does anyone know if/how SQL server can call a function in a C++ library?

    Cheers,

    Xiaobing

  3. #3
    xy Guest

    SQL Server Call C++ function? (reply)


    Thanks a lot Ray.

    Xiaobing

    ------------
    Ray Miao at 12/11/2001 9:31:15 AM

    Yes if you can build them as extended stored procedures.


    ------------
    xy at 12/11/2001 7:40:31 AM

    Hi,

    Does anyone know if/how SQL server can call a function in a C++ library?

    Cheers,

    Xiaobing

  4. #4
    JeffP Guest

    SQL Server Call C++ function? (reply)


    If you are not able to build, but must use an existing dll, you may wish to consider...

    declare @object int, @result(int, or varchar(n)) @myvar varchar(10)
    ,@intMyinput int --some input value

    exec sp_OACreate 'ThierDllName.Class' @object out ,1
    -- the ,1 denotes a Dll only

    exec sp_OAMethod @object ,'FunctionName' ,@result out @IntMyinput
    -- then something happens, or if an @output
    -- value similar to result is added you would get
    -- a value back.

    HTH

    JeffP...
    ------------
    Ray Miao at 12/11/2001 9:31:15 AM

    Yes if you can build them as extended stored procedures.


    ------------
    xy at 12/11/2001 7:40:31 AM

    Hi,

    Does anyone know if/how SQL server can call a function in a C++ library?

    Cheers,

    Xiaobing

  5. #5
    xy Guest

    SQL Server Call C++ function? (reply)


    Great! I'll try it out. Cheers
    /Xiaobing

    ------------
    JeffP at 12/11/2001 11:25:54 AM


    If you are not able to build, but must use an existing dll, you may wish to consider...

    declare @object int, @result(int, or varchar(n)) @myvar varchar(10)
    ,@intMyinput int --some input value

    exec sp_OACreate 'ThierDllName.Class' @object out ,1
    -- the ,1 denotes a Dll only

    exec sp_OAMethod @object ,'FunctionName' ,@result out @IntMyinput
    -- then something happens, or if an @output
    -- value similar to result is added you would get
    -- a value back.

    HTH

    JeffP...
    ------------
    Ray Miao at 12/11/2001 9:31:15 AM

    Yes if you can build them as extended stored procedures.


    ------------
    xy at 12/11/2001 7:40:31 AM

    Hi,

    Does anyone know if/how SQL server can call a function in a C++ library?

    Cheers,

    Xiaobing

Posting Permissions

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