Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 bulk insert

Author  Topic 

erajendar
Starting Member

4 Posts

Posted - 2004-01-19 : 07:55:15
Dear ALL,

Greetings!!!

If I execute the following statement:

set quoted_identifier off
declare @str varchar(500)
declare @path varchar(40)
set @path= "'\\rajendar\c\raj.txt'"
set @str="BULK INSERT #temp FROM " + @path + " WITH(DATAFILETYPE = 'char',FIELDTERMINATOR = '\t',ROWTERMINATOR = '\n')"
exec @str

Following error is coming:

Server: Msg 2812, Level 16, State 62, Line 7
Could not find stored procedure 'BULK INSERT #temp FROM '\\rajendar\c\raj.txt' WITH(DATAFILETYPE = 'char',FIELDTERMINATOR = '\t',ROWTERMINATOR = '\n')'.


any guess....

Rajendar

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-01-19 : 07:57:19
You need brackets around the @str when you 'exec' it. i.e.

exec (@str)


Raymond
Go to Top of Page

erajendar
Starting Member

4 Posts

Posted - 2004-01-19 : 09:37:31
Thanks alot raymondpeacock!!
It worked




Go to Top of Page
   

- Advertisement -