Is it possible to create a job in sqlserver to shrink the datafiles? This is the process I am following:
Step1, Identify the session ID: with this select * from sys.dm_db_task_space_usage
where internal_objects_alloc_page_count <> 0
Kill Session ID, Shrink the logfiles: