473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Urgent : DB-Library Error 10007: General SQL Server error: Check messages from the SQL

DB-Library Error 10007: General SQL Server error: Check messages from
the SQL
Server.


CREATE PROCEDURE [dbo].[spu_Import_Export_Image]
(
@srvr varchar(50),
@db varchar(50),
@usr varchar(15),
@pwd varchar(50),
@tbl varchar(50),
@col varchar(50),
@mod varchar(1),
@imgpath1 varchar(1000),
@pk varchar(50)
)

AS

BEGIN

declare @path varchar(50)
declare @whr varchar(200)
declare @fil varchar(100)
declare @cmd varchar(1000)
declare @imgpath varchar(800)
declare @ext varchar(5)
--declare @pk varchar(50)
declare @KeyValue varchar(8000)
declare @image varchar(50)
--declare @imgpath1 varchar(1000)
declare @imgpath2 varchar(1000)
declare @sellist varchar(2000)

set @path = 'c:\textCopy.exe'
select @sellist = 'DECLARE curKey CURSOR FOR SELECT ' + @pk +' FROM '
+ @tbl + ' ORDER BY ' + @pk

exec (@sellist)

OPEN curKey
FETCH NEXT FROM curKey INTO @KeyValue

WHILE (@@fetch_status = 0)
BEGIN
set @whr = '"where '+ @pk +' = "' + @KeyValue
set @fil = @imgpath1 + '\' + @KeyValue --+ @ext
set @cmd = @path + ' /S ' + @srvr + ' /D ' + @db + ' /U ' + @usr
+ ' /P ' + @pwd+ ' /T ' + @tbl + ' /C ' + @col + ' /W ' + @whr + '
/F ' + @fil+ ' /' + @mod
exec Master..xp_cmdShell @cmd
FETCH NEXT FROM curKey INTO @KeyValue
END
CLOSE curKey
DEALLOCATE curKey

END

GO
Above srcipt runs fine with image data type in one table but when i
run for some other table it gives me Error Message
TEXTCOPY Version 1.0
DB-Library version 8.00.194
SQL Server 'WSQL01' Message 170: Line 1: Incorrect syntax near '99'.
(Concern
ing line 1)
DB-Library Error 10007: General SQL Server error: Check messages from
the SQL
Server.
ERROR: Could not use database 'test1'

NULL
-----------

Aslo it only runs on server console if i run it from workstation uing
same files and tables it gives me an error again. Can anybody help me
and reply me at dh******@freewavetech.dom asap.

thnx,

dharmesh
Jul 20 '05 #1
1 15149

"Dharmesh Gandhi" <dh******@freewavetech.com> wrote in message
news:1d*************************@posting.google.co m...
DB-Library Error 10007: General SQL Server error: Check messages from
the SQL
Server.


CREATE PROCEDURE [dbo].[spu_Import_Export_Image]
(
@srvr varchar(50),
@db varchar(50),
@usr varchar(15),
@pwd varchar(50),
@tbl varchar(50),
@col varchar(50),
@mod varchar(1),
@imgpath1 varchar(1000),
@pk varchar(50)
)

AS

BEGIN

declare @path varchar(50)
declare @whr varchar(200)
declare @fil varchar(100)
declare @cmd varchar(1000)
declare @imgpath varchar(800)
declare @ext varchar(5)
--declare @pk varchar(50)
declare @KeyValue varchar(8000)
declare @image varchar(50)
--declare @imgpath1 varchar(1000)
declare @imgpath2 varchar(1000)
declare @sellist varchar(2000)

set @path = 'c:\textCopy.exe'
select @sellist = 'DECLARE curKey CURSOR FOR SELECT ' + @pk +' FROM '
+ @tbl + ' ORDER BY ' + @pk

exec (@sellist)

OPEN curKey
FETCH NEXT FROM curKey INTO @KeyValue

WHILE (@@fetch_status = 0)
BEGIN
set @whr = '"where '+ @pk +' = "' + @KeyValue
set @fil = @imgpath1 + '\' + @KeyValue --+ @ext
set @cmd = @path + ' /S ' + @srvr + ' /D ' + @db + ' /U ' + @usr
+ ' /P ' + @pwd+ ' /T ' + @tbl + ' /C ' + @col + ' /W ' + @whr + '
/F ' + @fil+ ' /' + @mod
exec Master..xp_cmdShell @cmd
FETCH NEXT FROM curKey INTO @KeyValue
END
CLOSE curKey
DEALLOCATE curKey

END

GO
Above srcipt runs fine with image data type in one table but when i
run for some other table it gives me Error Message
TEXTCOPY Version 1.0
DB-Library version 8.00.194
SQL Server 'WSQL01' Message 170: Line 1: Incorrect syntax near '99'.
(Concern
ing line 1)
DB-Library Error 10007: General SQL Server error: Check messages from
the SQL
Server.
ERROR: Could not use database 'test1'

NULL
-----------

Aslo it only runs on server console if i run it from workstation uing
same files and tables it gives me an error again. Can anybody help me
and reply me at dh******@freewavetech.dom asap.

thnx,

dharmesh


The 'incorrect syntax' message suggests that one of your command strings is
not being constructed correctly. For troubleshooting, it might be useful to
create a @Debug parameter, then add this to your procedure:

....
if @Debug = 1
print @cmd
exec Master..xp_cmdShell @cmd

That way you can see exactly what the command being executed is, and that
may help to find the syntax error.

Simon
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rajesh Garg | last post by:
I have a scenario like this....... update esan set tes_address_city = 'TEST1' --at some time update esan set tes_address_city = 'TEST12' --at some time update esan set tes_address_city =...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: LaurenW | last post by:
After many years of working with Access, I am FINALLY required to delete a single field from a table in a linked back-end data base and I must do it fro the FRONT end! There MUST be a way to do...
3
by: itm | last post by:
I have to copy a FE/BE Access 2002 database on a regular basis to a CD to take to another site to use at that site. The data does not have to be up to the minute at that site. Is there a simple...
0
by: TLi | last post by:
Hi I'm having problems in enumerating checked items of checkedlistbox. I'm trying to do following string sVal foreach(myObject _myobj in checkedListBox1.CheckedItems sVal = _myobj.value...
10
by: lakshmananl | last post by:
hi, i have a problem in importing data from .ixf files the dump was got from AIX box and this dump is to be imported to win2003 box with db2v7.2 fixpack8. i have just created a new db in the...
0
by: pamelafluente | last post by:
I am using VB2005 (vs2005 team), trying to connect to a PARADOX .db file. I am using an OLEDB connection. This is the connection string I am using: Provider=Microsoft.Jet.OLEDB.4.0; Data...
1
by: Tund3r | last post by:
Hi, i have some problem when trying make insert a lot of row in a large db. I have to pharse a 10 file of 1 million of record and insert it into a table ... when arrive at around 1 million of...
7
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.