home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 32 / IOPROG_32.ISO / SOFT / SqlEval7 / devtools / samples / ODS / xp_odbc / xp_odbc.sql < prev   
Encoding:
Text File  |  1997-11-02  |  740 b   |  23 lines

  1. /** This script updates a table and calls an extended           **/
  2. /** procedure which retrieves rows from the same table.         **/
  3. /** Its purpose is to show how two connections can work with    **/
  4. /** the same rows, without blocking each other. This is         **/
  5. /** possible because the connection opened by the extended      **/
  6. /** stored procedure xp_gettable_odbc is bound to the           **/
  7. /** connection that the procedure is called from.               **/
  8.   
  9. sp_addextendedproc 'xp_gettable_odbc', 'xp_odbc.dll'
  10. go
  11.  
  12. begin transaction
  13. update pubs..authors
  14.     set phone =phone
  15. exec xp_gettable_odbc 'pubs..authors'
  16. commit transaction
  17. go
  18.  
  19. sp_dropextendedproc 'xp_gettable_odbc'
  20. go
  21.  
  22. dbcc xp_odbc(free)
  23. go