This script will loop through a directory, executing all SQL files within...
--Enable xp_cmdshell
EXEC [master].[dbo].[sp_configure] 'show advanced options', 1
RECONFIGURE
GO
EXEC [master].[dbo].[sp_configure] 'xp_cmdshell', 1
RECONFIGURE
GO
--Execute all sql files in dir
EXEC xp_cmdshell 'for %f...