November 28, 2006 at 2:34 am
I am reading a text file into a temptable, then opening a cursor to read through the temptable.
When i execute my procedure from SQL server, all is fine, but when i do it throught another application that calls the procedure, i get the error:
ODBC Driver - S1090 - | Invalid string or buffer length |
i really dunno how to solve that especially that when i run it alone it works!
declare
@oneline varchar(8000)
CREATE
TABLE #textfile (line varchar(8000))
BULK INSERT #textfile FROM 'D:\websites\neolane\www\Import\init_newsl.txt'
DECLARE table_cursor CURSOR FOR SELECT line FROM #textfile
OPEN table_cursor
FETCH NEXT FROM table_cursor INTO @oneline
IF (@@FETCH_STATUS = -1)
-- my code
END
...... help please!!!!
November 28, 2006 at 7:47 am
What is the driver you are using? I would review this first.
November 28, 2006 at 8:06 am
the thing is that I am executing the procedure through an application that automatically connects, and I cannot choose the connection type...
Does that mean a dead end???
November 28, 2006 at 8:34 am
Right, but if you know what driver the connection is using you can find out if it is the driver has a bug or an updated version then update the driver or procedure accordingly.
November 28, 2006 at 8:44 am
what i did is that i changed the way of calling the procedure from
Go
exec dbname..sp_importNewsletter
Go
to
use dbname
Go
exec sp_importNewsletter
Go
apparently the user in the application is not a dbo. The previous error is gone but another one appeared saying that i cannot use BULK INSERT
so now i have to know how to give the right to that user to use bulk insert while i dont even know what user it is!!! arghhhhh
November 28, 2006 at 9:04 am
On a side not I would also review using "sp_" when writing user procedures as far as a small cost in performance with contect switching, proc cache hit ratio, etc...
November 28, 2006 at 9:14 am
well am not very pro in that, i didn't quiet understand what u mean by not using sp_
what would that change in the fact that the user doesnt have the right to execute that command throught the application
November 28, 2006 at 9:27 am
November 28, 2006 at 9:34 am
This article talks about sp_ and procedure cache and the impact.
http://www.sqlservercentral.com/columnists/bkelley/procedurecache.asp
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply