Here's a small piece code that I'm trying to run. I need to build by text file each time. Once built, I'd like to do a bulk insert, however it keeps complaining about my syntax in the "from" statement. All parameters have been declared, I'm just not showing it here.
if @currentmonth = 1 -- January
begin
set @champFile = '\CC' + @lastyear + '1001.TXT'
bulk insert ccm_Prov_Enct_Stat_Rep
from 'f:\' + @champFile
with (DATAFILETYPE = 'CHAR')
end
if @currentmonth = 1 -- January
begin
set @champFile = '\CC' + @lastyear + '1001.TXT'
bulk insert ccm_Prov_Enct_Stat_Rep
from 'f:\' + @champFile
with (DATAFILETYPE = 'CHAR')
end