473,698 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

textcopy.exe failure

I am running the following script:
begin
set quoted_identifi er off

declare @pk int

declare @where_clause varchar(100)

declare @file_name varchar (50)

declare @debug varchar (50)

Declare @cmd varchar (50)

--debug

/*if @Debug = 1
print @cmd
exec Master..xp_cmdS hell @cmd */
-- begin cursor

DECLARE LOOKUP CURSOR FOR select pr.[id]
from plan_report pr, plan_version pv
where pv.plan_id = pr.plan_id and pv.status = '30' and pr.create_time
>= pv.update_time
OPEN LOOKUP

FETCH NEXT FROM LOOKUP INTO @pk
-- Loop through the list

WHILE @@FETCH_STATUS = 0

BEGIN
SET @where_clause = 'Where' + '[ID]' + '=' + cast(@pk as
varchar(10))
SET @file_name = 'C:\'+cast(@pk as varchar(10))+'. pdf'

exec sp_textcopy @srvname = 'MILNPPRODSQL',

@login = 'sa',

@password = 'W3Ot-@PirI#a',

@dbname = 'Naviplan',

@tbname = 'Plan_Report',

@colname = 'document',

@filename = @file_name,

@whereclause = @where_clause,

@direction = 'o' -- 'o' for output, 'i' for input

-- loop cursor

SET @pk = NULL

SET @where_clause = NULL

SET @file_name = NULL

FETCH NEXT FROM LOOKUP INTO @pk
END
-- cleanup

CLOSE LOOKUP

DEALLOCATE LOOKUP

end

This script runs with no issue in our Dev environment (which has a
restore of our production db) but when I run in production I get the
following error:

The system cannot find the path specified.

I can't figure out what path it is erroring on?? Both servers are
Windows 2003. The environmental variables on each server is
identical. Only difference I can think of is that our production
server is a clustered sql server and our dev server is not....

Any help would be greatly appreciated...

Thanks,

Connie

Mar 7 '07 #1
5 6121
Connie (cs*****@rwbair d.com) writes:
exec sp_textcopy @srvname = 'MILNPPRODSQL',
...
This script runs with no issue in our Dev environment (which has a
restore of our production db) but when I run in production I get the
following error:

The system cannot find the path specified.

I can't figure out what path it is erroring on?? Both servers are
Windows 2003. The environmental variables on each server is
identical. Only difference I can think of is that our production
server is a clustered sql server and our dev server is not....
We don't know what is in that sp_textcopy, but apparently textcopy is
on in the path on the production server. You may have to modify this
sp_textcopy, so that it does not assume that textcopy is in the path.

And, of course, if the production server is SQL 2005, then there is
no textcopy available.

Overall, I am not very fond of the solution of calling textcopy from
xp_cmdshell. If this is for an Agent job, I think it would be better
to do with an Active-X task instead.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Mar 7 '07 #2
On Mar 7, 4:24 pm, Erland Sommarskog <esq...@sommars kog.sewrote:
Connie (csaw...@rwbair d.com) writes:
exec sp_textcopy @srvname = 'MILNPPRODSQL',
...
This script runs with no issue in our Dev environment (which has a
restore of our production db) but when I run in production I get the
following error:
The system cannot find the path specified.
I can't figure out what path it is erroring on?? Both servers are
Windows 2003. The environmental variables on each server is
identical. Only difference I can think of is that our production
server is a clustered sql server and our dev server is not....

We don't know what is in that sp_textcopy, but apparently textcopy is
on in the path on the production server. You may have to modify this
sp_textcopy, so that it does not assume that textcopy is in the path.

And, of course, if the production server is SQL 2005, then there is
no textcopy available.

Overall, I am not very fond of the solution of calling textcopy from
xp_cmdshell. If this is for an Agent job, I think it would be better
to do with an Active-X task instead.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarsk og.se

Books Online for SQL Server 2005 athttp://www.microsoft.c om/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.c om/sql/prodinfo/previousversion s/books.mspx
Erland, The reason I am doing this is to extract a blob from a sql
server table and store it into a location on our server. Here is what
is in the sp_textcopy:
CREATE PROCEDURE sp_textcopy (
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
@direction char(1))
AS
DECLARE @exec_str varchar (255)
SELECT @exec_str =
'C:\Progra~1\Mi cros~1\MSSQL\Bi nn\textcopy.exe /S ' + @srvname
+
' /U ' + @login +
' /P ' + @password +
' /D ' + @dbname +
' /T ' + @tbname +
' /C ' + @colname +
' /W "' + @whereclause +
'" /F ' + @filename +
' /' + @direction
EXEC master..xp_cmds hell @exec_str
GO

I believe that I must be having some sort of right issue on the
Production server where I am now trying to run this. It works
perfectly in Development.

Mar 7 '07 #3
Connie (cs*****@rwbair d.com) writes:
Erland, The reason I am doing this is to extract a blob from a sql
server table and store it into a location on our server. Here is what
is in the sp_textcopy:
CREATE PROCEDURE sp_textcopy (
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
@direction char(1))
AS
DECLARE @exec_str varchar (255)
SELECT @exec_str =
'C:\Progra~1\Mi cros~1\MSSQL\Bi nn\textcopy.exe /S ' + @srvname
+
' /U ' + @login +
' /P ' + @password +
' /D ' + @dbname +
' /T ' + @tbname +
' /C ' + @colname +
' /W "' + @whereclause +
'" /F ' + @filename +
' /' + @direction
EXEC master..xp_cmds hell @exec_str
GO

I believe that I must be having some sort of right issue on the
Production server where I am now trying to run this. It works
perfectly in Development.
No, it's not a permissions issue. But it would be as simple that on
the production box, SQL Server is not installed on the C disk. Or
that the 8.3 name for C:\Program Files\Microsoft SQL Server is
different. The first thing to try is replace the 8.3 parts with the
long names. Next is to check where textcopy is located on the
production server.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Mar 7 '07 #4
On Mar 7, 4:46 pm, Erland Sommarskog <esq...@sommars kog.sewrote:
Connie (csaw...@rwbair d.com) writes:
Erland, The reason I am doing this is to extract a blob from a sql
server table and store it into a location on our server. Here is what
is in the sp_textcopy:
CREATE PROCEDURE sp_textcopy (
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
@direction char(1))
AS
DECLARE @exec_str varchar (255)
SELECT @exec_str =
'C:\Progra~1\Mi cros~1\MSSQL\Bi nn\textcopy.exe /S ' + @srvname
+
' /U ' + @login +
' /P ' + @password +
' /D ' + @dbname +
' /T ' + @tbname +
' /C ' + @colname +
' /W "' + @whereclause +
'" /F ' + @filename +
' /' + @direction
EXEC master..xp_cmds hell @exec_str
GO
I believe that I must be having some sort of right issue on the
Production server where I am now trying to run this. It works
perfectly in Development.

No, it's not a permissions issue. But it would be as simple that on
the production box, SQL Server is not installed on the C disk. Or
that the 8.3 name for C:\Program Files\Microsoft SQL Server is
different. The first thing to try is replace the 8.3 parts with the
long names. Next is to check where textcopy is located on the
production server.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarsk og.se

Books Online for SQL Server 2005 athttp://www.microsoft.c om/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.c om/sql/prodinfo/previousversion s/books.mspx- Hide quoted text -

- Show quoted text -
Did all of that already, checked the location of the textcopy.exe and
it does exist in the same location on dev as it does on production. I
tried using the long names and the short name both, still same
results... I have basically gone through and verified everything and
compared production to development, I am just frustrated right
now....Thanks for all the ideas and help though I am open for all and
any suggestions....

Mar 8 '07 #5
On Mar 8, 12:23 pm, "Connie" <csaw...@rwbair d.comwrote:
On Mar 7, 4:46 pm, Erland Sommarskog <esq...@sommars kog.sewrote:


Connie (csaw...@rwbair d.com) writes:
Erland, The reason I am doing this is to extract a blob from a sql
server table and store it into a location on our server. Here is what
is in the sp_textcopy:
CREATE PROCEDURE sp_textcopy (
@srvname varchar (30),
@login varchar (30),
@password varchar (30),
@dbname varchar (30),
@tbname varchar (30),
@colname varchar (30),
@filename varchar (30),
@whereclause varchar (40),
@direction char(1))
AS
DECLARE @exec_str varchar (255)
SELECT @exec_str =
'C:\Progra~1\Mi cros~1\MSSQL\Bi nn\textcopy.exe /S ' + @srvname
+
' /U ' + @login +
' /P ' + @password +
' /D ' + @dbname +
' /T ' + @tbname +
' /C ' + @colname +
' /W "' + @whereclause +
'" /F ' + @filename +
' /' + @direction
EXEC master..xp_cmds hell @exec_str
GO
I believe that I must be having some sort of right issue on the
Production server where I am now trying to run this. It works
perfectly in Development.
No, it's not a permissions issue. But it would be as simple that on
the production box, SQL Server is not installed on the C disk. Or
that the 8.3 name for C:\Program Files\Microsoft SQL Server is
different. The first thing to try is replace the 8.3 parts with the
long names. Next is to check where textcopy is located on the
production server.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarsk og.se
Books Online for SQL Server 2005 athttp://www.microsoft.c om/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.c om/sql/prodinfo/previousversion s/books.mspx-Hide quoted text -
- Show quoted text -

Did all of that already, checked the location of the textcopy.exe and
it does exist in the same location on dev as it does on production. I
tried using the long names and the short name both, still same
results... I have basically gone through and verified everything and
compared production to development, I am just frustrated right
now....Thanks for all the ideas and help though I am open for all and
any suggestions....- Hide quoted text -

- Show quoted text -
Well I got past that error, I took the textcopy.exe file and put it in
the root of C:\ and changed the stored proc to reflect that change,
and now it runs with no issues....It just seems that it cannot find it
under the sql server installation location for some reason.....I
double checked the path several times??? Go figure.. Thanks for the
help though your suggestions about the path led me to try this out :)

Mar 8 '07 #6

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

Similar topics

10
3146
by: x2164 | last post by:
hi all, Linux 2.4.28 Glibc 2.2.5 gcc 2.95.3 I'm new to Python. I've compiled Python 2.4 from tar file.
3
3751
by: Damaji Jambhale | last post by:
COMException: Catostrphic failure When I added a "dll" reference in the web project. I was able to instantiate the class OK. But when I tried to set the properties, it failed with "COMException: Catostrphic failure". Any idea? Thanks.
2
3082
by: JustaCowboy | last post by:
Greetings, I am seeking information related to this subject. BOL suggests backing up the active transaction log immediately after a failure, so that the backup can be used in a recovery scenario if necessary. This is the relevant text from BOL "Transaction Log Backup": ----// The transaction log backup created at 8:00 P.M. contains transaction log
1
3526
by: Zack Sessions | last post by:
I know it may not be good design standards, but SQL7 can handle database names that have embedded spaces just fine, you just need to enclose the database name in square brackets. But can TEXTCOPY handle spaces in the database name? I first tried something like: TEXTCOPY /S server /U sa /P password /D mydatabase /t /C columnname /W "where id = 1" /F file.txt /O
4
8120
by: J. Marshall Latham | last post by:
I have written an ASP.NET web app in C# that is trying to connect to a database using OleDb. I put code in a dll that uses another dll to create a connection object (and open it if requested) to send back to the web app to connect to the database. I am getting the following error when I change anything in my web app and recompile. Catastrophic failure Description: An unhandled exception occurred during the execution of the current web...
5
5554
by: Ron Louzon | last post by:
I have some C++ code that uses the CSingleLock( CCriticalSection *) constructor. In visual C++ 6.0, this code compiles and runs fine in both Debug and release modes. However, in Visual Studio .Net, when I run this code I get an Assertion failure. The error appears to be exactly the same as that seen with CSingleLock in VC++ version 4.0. I can get around this by using the Lock method of the CCriticalSection object but the accepted way...
0
2654
by: Marty Cruise | last post by:
I successfully deploy my application to 20 domain users. Only one new user is giving me a problem, although he can access all domain resources. When he clicks the installation link on the publish page, Framework 2.0 installs successfully, but then the application installation fails during the "Verifying Application Requirements" process. Can anyone help me figure out how to solve this? Error is as follows. PLATFORM VERSION INFO...
66
3615
by: Johan Tibell | last post by:
I've written a piece of code that uses sockets a lot (I know that sockets aren't portable C, this is not a question about sockets per se). Much of my code ended up looking like this: if (function(socket, args) == -1) { perror("function"); exit(EXIT_FAILURE); } I feel that the ifs destroy the readability of my code. Would it be
1
1325
by: snavebelac | last post by:
Hi everyone I have a system running on a 2 server environment. One server has the internal database (SQL SERVER 2000 with an MSAccess front end on the clients) and is not open to the internet. The other is just a web server, runs IIS6 and can communicate with SQL Server on the other box only - no direct access to files or anything else due to firewalls. I needed a system, whereby files (images docs pdfs etc) could be made available to...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.