-- Script B in a 2 script demo of how to use fn_get_sql. -- Batch B-3 Moves to the Pubs sample database -- And prints the SPID PRINT 'Batch B-3 Printing the SPID and Using Pubs' PRINT 'Script B -- Has SPID ' + CAST(@@SPID as varchar) Use Pubs go -- Make sure to take note of the SPID of this connection. -- Batch B-4 PRINT 'Batch B-4 SELECT a blocked resource.' select * from authors GO -- You shouldn't see the results of this query until -- you go back and run Batch A-5