March 23, 2010 at 7:27 am
Use database1
declare @date varchar(100) = (select Convert(VarChar, GetDate(), 112))
Declare @fullpath varchar(100) = 'c:\templogs\'+(@date)+'-server1.csv'
bulk INSERT server1 FROM '+@fullpath+'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = ''
)
How do I say from 'c:\templogs\20100323-server1.csv' using the declared @fullpath?
The file name changes everyday because of the date change and I'd like to automate it.
Help!
March 23, 2010 at 7:32 am
March 23, 2010 at 10:18 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply