This pool modifier creates an object in the pool of the type specified in the object_type parameter and copies the whole object specified by the ID parameter from the database into the pool.
Please note that since the SQL SDK does not have an automated garbage collection procedure, objects created in or retrieved into the pool need to be disposed of after they are no longer needed (e.g. the objects have been saved to their permanent locations in the database). Otherwise, the pool will grow uncontrollably, increasing the database size and eventually degrading performance.
exec sp_sql_retrieve_object 'Jobs', '12', @h output
exec sp_sql_set_field @h, 'Job Name', 'My Job'
exec sp_sql_add_object @h -- Object "Jobs" is now permanently saved in VT
database and its temporary representation
in the Pool is not needed anymore.
exec sp_sql_release_object @h -- Removing Pool object with handle @h because