Copying files from SQL (MS SQL Server 6.5, WIN 4.0 server, WIN95 client)

Copying files from SQL (MS SQL Server 6.5, WIN 4.0 server, WIN95 client)

Post by K Schmid » Fri, 23 Apr 1999 04:00:00



I am thinking of copying files from one directory to another using
xp_cmdshell.  I have ran into some problems.  Namely, the reality that
xp_cmdshell/SQL server seem to live in seems different from the reality of
the command line or Explorer.  Specifically, some of the problems are:
creating directories under command line shell does not make them visible to
xp_cmdshell; files that xp_cmdshell are copied and thereafter present in the
target directory do not appear visible through the command line shell not
through the Explorer.  Has anyone 1) ran into problems like this 2) found a
reliable way to copy files from a stored procedure?
Thanks in advance!
Kurt

--
Spam catcher:  remove the underscore and the edible part in the address

 
 
 

Copying files from SQL (MS SQL Server 6.5, WIN 4.0 server, WIN95 client)

Post by Neil Pik » Sat, 24 Apr 1999 04:00:00


Kurt,

 I've never had any problems.  Use copy rather than xcopy.  Also fully qualify all
directory names as the starting directory may not be the one you expect.

Quote:> I am thinking of copying files from one directory to another using
> xp_cmdshell.  I have ran into some problems.  Namely, the reality that
> xp_cmdshell/SQL server seem to live in seems different from the reality of
> the command line or Explorer.  Specifically, some of the problems are:
> creating directories under command line shell does not make them visible to
> xp_cmdshell; files that xp_cmdshell are copied and thereafter present in the
> target directory do not appear visible through the command line shell not
> through the Explorer.  Has anyone 1) ran into problems like this 2) found a
> reliable way to copy files from a stored procedure?

 Neil Pike MVP/MCSE.  Protech Computing Ltd
 (Please post ALL replies to the newsgroup only unless indicated otherwise)
 For SQL FAQ entries see
 http://go.compuserve.com/sqlserver (library 1) - latest stuff is always here
 www.ntfaq.com/sql.html
 http://www.swynk.com/faq/sql/sqlserverfaq.asp

 
 
 

1. MS SQL Server 6.5 won't disconnect the client task

The program opens the data base with the regular Borland BDE API.

Then it is possible to retrieve records, by any key. The file has 32,000
keys. The retrieval is instantaneous, from the first time, so I know it is
using the index.

Then the program is ended by closing the data base. The following are the
BDE functions that I have tried in closing the program:

void vCloseAll()
{
  for(int i=1; i<MAXTABLES; i++)
   if(!ar[i].hDb) continue;
   else Chk(DbiCloseDatabase(&ar[i].hDb));
  Chk(DbiExit());

The problem is that it never returns any errors. It SEEMS to have ended.
This same function works for all the other ODBC DRIVERS and data base
types.

But the Microsoft Process Viewer Application reports that my program is
still hanging in there, with one TID.

"killing" the process just freezes the Process Viewer Application.

My only alternative at this point is to RESET the computer. Doing a
Control-Alt-DEL will not show the task under the tasks list.

The funny thing is that this problem comes up ONLY when the data base being
accessed is in a Microsoft SQL Server. Using EXACTLY the same instructions
(and changing only certain values in the BDE32CFG) I can access AS/400 data
bases as well as the Standard (dbase and Paradox) data bases with zero
problems.

However, if hooked to the SQL Server, the task remains in a hidden way,
visible only with  the Application Viewer, and NOT ALLOWING any other tasks
with similar requirements to be loaded and run: dbd32.exe can't be loaded,
and another instance of this task can not be loaded either. I only know it
is hanging in there because it shows in the list of tasks with the Process
Viewer, but it is reported as "Ended" or nonexistent.

The following are just downloaded files from Borland (the older versions
used to act in exactly the same way):

IDAPI32         3.5.0.20           19/09/96
IDODBC32        3.5.0.20           19/09/96
IDR20009        3.5.0.20           19/09/96

The ODBC related files are as follows:

ODBC32  2.50.30.6       13/08/96
ODBCCP32        2.50.30.6       27/06/96
ODBCINT 2.50.30.6       27/06/96

The SQL Server loaded processes are:

SQLSRV32        2.65.2.1                3/04/96

------------

If there is anyone out there that knows why such a problem is coming, I'll
appreciate any comments.

Franz J Fortuny

2. CERTIFICATION? If You want to pass exams....

3. SQL Server 6.5/Win95 Client/Server

4. Oracle and the IBM Shark

5. Copy DB from server to server (MS SQL 6.5)

6. Convert Database to Access 97 from 2000 generates runtime error

7. sql-server login window suppress in vb3 with ms sql 6.5 and Nt 4.0

8. Special Sql Query

9. Use of SQL Server 7.0 Client with SQL Server 6.5 Server

10. Access multiusers: File Server vs Client-Server (MS SQL Server)

11. Does MS SQL Client version 6.5 work with SQL Server 7.0

12. migrating sql databases sever 6.5 from sql server 6.5 to another sql server 6.5

13. SQL Server 6.5 and MS WIN95 with ACCESS 97