July 3, 2009 at 5:02 am
Hi masters,
I have the procedure below in my database, i'm converting this database from SQL Server 2000 to 2005.
Shoul i expect any difference in terms of sintax or behavior because of the use of Bulk insert? or bulk insert as not changed?
thank you,
rv
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER proc [dbo].[BULK_INSERT_DATA](@caminho varchar(500))
as
Declare @erro as int
declare @SQLStatement as varchar(500)
set @SQLStatement=('BULK INSERT table1
FROM '''+@caminho+'\file1.txt''
WITH
(
FIRSTROW =2,
FIELDTERMINATOR =''|'',
ROWTERMINATOR ='''',
tablock,
DATAFILETYPE =''widechar''
)')
exec (@SQLStatement)
set @erro=@@error
if @erro=0
begin
set @SQLStatement= ('BULK INSERT table_name
FROM '''+@caminho+'\file2.txt''
WITH
(
FIRSTROW =2,
FIELDTERMINATOR =''|'',
ROWTERMINATOR ='''',
tablock,
DATAFILETYPE =''widechar''
)')
exec (@SQLStatement)
set @erro=@@error
end
if @erro=0
begin
insert into table_name values (3)
end
July 3, 2009 at 11:36 am
i hope this sp can be used as given
July 5, 2009 at 8:55 am
sorry didn't undestud your point?
what did you mean?
tks,
Pedro
p.s - my question was :
Did anything changed in terms of Bulk insert from SQL server 2000 to SQL Server 2005?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply