I have a stored proc on a bespoke utils database that takes the parameters @database, @size. When the proc is called it finds the tran log file id for the given database and truncates it. However I also want to run the DBCC shrinkfile (<file_id>, option, size) against this database.
Essentially I need to know how to run this command against a different database to the one currently OR how to get some form of "use database" command in a stored proc.
Any help greatly appreciated