CREATE PROCEDURE [dbo].[procBulkInsert]
	@tablename varchar(50),
	@filename varchar(256)
AS
DECLARE @cmd AS char(300)

EXEC('BULK INSERT ' + @tablename + ' FROM ''' + @filename + ''' WITH (
FIELDTERMINATOR = ''0x09'',
FIRSTROW = 1,
ROWTERMINATOR = ''0x0a'',
TABLOCK)')

SET @cmd = 'del ' + @filename

exec [master].[dbo].xp_cmdshell @cmd
GO
