Xcopy Can Not Copy File From Another Computer

Oct 18, 2007

sql server 2000

when I run under SQL in sql analyser



exec master.dbo.xp_cmdshell 'c:mssqldata est_data_mdf \server1data /y'

return : invalid drive specification

but I can run 'c:mssqldata est_data_mdf \server1data /y' from CMD

any solution?

Thx

View 1 Replies


ADVERTISEMENT

How To Use Xcopy && User Instance To Copy 3 Dbo Tables From The Database Of SQL Server Management Studio Express To The App_Data Folder Of Website Of VWD Express Project?

Jan 6, 2007

Hi all,
I have read/studied (i) Working with Databases in Visual Web Developer 2005 Express in http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/vwd.aspx, (ii) Xcopy Deployment (SQL Server Express) in http://msdn2.microsoft.com/en-us/library/ms165716.aspx, (iii) User Instances for Non-Administrators in http://msdn2.microsoft.com/en-us/library/ms143684.aspx, and (iv) Embedding SQL Server Server Express in Applications in http://msdn2.microsoft.com/en-us/library/ms165660.aspx.  I do not understand the concepts and procedures to do Xcopy and User Instances for non-administrators completely-I do not know how to connect to databases and create database diagrams or schemas using the Database Explorer.  I have a stand-alone Windows XP Pro PC. I have created a ChemDatabase with 3 dbo tables in the SQL Server Management Studio of my SQL Server Express and a website of my VWD Express application with an App_Data folder.  I am not able to proceed to use Xcopy and user instance to bring the 3 dbo tables of ChemDatabase to my App_Data folder. Please help and give me some detailed procedures/instructions to bring the 3 dbo tables of ChemDatabase (or ChemDatabase itself) from the SQL Server Management Studio Express to the App_Data folder of the website of my VWD Express project? 
Thanks in advance,
Scott Chang 
 

View 3 Replies View Related

Using Xcopy To Get The .mdf File Of Pubs Database To The App_Data Folder Of A Website Of VWD Express Project

Jan 9, 2007

Hi all,

I have a stand-alone Windows XP Pro PC that has SQL Server Express (SSE) and Visual Web Developer Express (VWDE) programs. The Microsoft "pubs" Database is installed in the SQL Server Management Studio Express (SSMSE). I created a website in my VWDE program. I need the .mdf file of the pubs Database in the App_Data folder of website of my VWDE project. I think that User Instance in my SSE is established. I have studied Xcopy Deployment (SQL Server Express) and User Instance for a quite a while and I still do not know where and how to use Xcopy to get the mdf file of the pubs database into the App_Data folder of the website of my VWDE project. Please help and give me the detailed key steps/instructions about where and how to get the .mdf file of the pubs database into the App_Data folder of the website of my VWDE project via Xcopy.

Thanks in advance,

Scott Chang

View 6 Replies View Related

Copy Files From Another Server To Computer With Robocopy And Job

Feb 4, 2015

I have one job for copy files from another server to my computer using Robocopy.but when I execute my job in sql server I get this error:

Accessing Source Directory 192.168.101.191Upload
Access is denied.
this is my job:
USE [msdb]
GO

/****** Object: Job [Test] Script Date: 02/04/2015 13:08:00 ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [[Uncategorized (Local)]]] Script Date: 02/04/2015 13:08:00 ******/
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'[Uncategorized (Local)]' AND category_class=1)

[Code] ....

Should I create Credential and proxy?How can I do this?Would you mind giving me required scripts for this?

View 2 Replies View Related

Copy A Database With Copy The .mdf File And Attaching It With A New Name?

Nov 4, 2006

Hello,

if i have a given database (a model) and i want to copy this database in the same database instance. Is it ok to copy the mdf and ldf file and attach the files with a new database name in the same instance.

Or is the datebase name part of the .mdf file?

Regards
Markus





View 6 Replies View Related

Moving The ASPNETDB.MDF File To Another Computer

Jul 22, 2006

Hi all!I have some problems with asp.net windows authentication.Asp made the file ASPNETDB.MDF. But I dont have SQL Server on the machine where the application will be deployed...So I have to move this file to another server, but I couldnt find any information about ASPNETDB.MDF connection string or somenthing like this.Is it possible to move this file or I have to make the authentication on my own, with my own database? I hope there is a solution to this problem!Many thanks! Regards!

View 1 Replies View Related

Accessing Script File On Local Computer

Apr 13, 2004

I am trying to create a sproc creates several tables, views, and sprocs across several similar DBs (please...no lectures on structure...I didn't create this multi-DB setup) .

My sproc loops through the DBs and runs a script on each DB. I am running the Sproc from a client computer and cannot easily access the c drive on the SQL server.

The only way I have figured out how do do this is to run the following

xp_cmdshell 'isql d- %@mydb% i- c:script.sql'

inside a loop.

My problem is that xp_cmdshell refers to the server c drive instead of my local c drive, where my script file is.

Is there a way to refer to my local c drive? Also any thoughts on a better way to approach this (other than running the entire script inline in the sproc since I don't want to have to run quotes around each batch of the script).


Thanks

View 2 Replies View Related

About Accessing SQL Server2005 Database File From A Remote Computer

Jun 5, 2007

hi every one. i am a new user of asp.net 2.0 using C#  code and i am facing a problem in accessing a  SQL Server2005 database file in the remote computer. i have connected two pc with peer to peer connection and trying to add a databse using the "Add connection" option from the visual studio 2005. in the add connection dialog box it is showing me the remote server and it was supposed to show all the database in that SQL Server when i select one. but when i am choosing the server name it was not showing me anything. by the way i have configuered the surface area for "both TCP/IP and named pipes" and both the pc's server browser is turned on. is it the right way to access a database file from a remote pc or not?? please send me a good solution to do this things and try to explain the codes with example. waiting for response....plz send me the solution.. as soon as possible

View 2 Replies View Related

Xp_cmdshell - Problem Creating Txt File For Working For Remote Computer

Jan 20, 2004

I am having problem creating/copying "txt" file in a remote machine by using the "exec master..xp_cmdshell" command in query analyzer. For example, we are getting errors for the following command:

exec master..xp_cmdshell 'copy d: estingauthors.txt \<MyServerName><myFolderName>authors.txt'

(but exec master..xp_cmdshell 'copy d: estingauthors.txt d: esting1authors1.txt' is working without any problems)

Any ideas?

View 7 Replies View Related

Xp_cmdshell - Problem Creating Txt File For Working For Remote Computer

Jan 20, 2004

I am having problem creating/copying "txt" file in a remote machine by using the "exec master..xp_cmdshell" command in query analyzer. For example, we are getting errors for the following command:

exec master..xp_cmdshell 'copy d: estingauthors.txt \<MyServerName><myFolderName>authors.txt'

(but exec master..xp_cmdshell 'copy d: estingauthors.txt d: esting1authors1.txt' is working without any problems)

Any ideas?

View 2 Replies View Related

SQL 2012 :: Restart Computer Prompt - Pending File Rename Operations Does Not Exist

Jul 21, 2014

I am attempting to install SQL Server Express 2012. Th setup support rule to "restart computer" continues to fail.

I tried to locate and change PendingFileRenameOperations under HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession Manager.

I am not able to locate PendingFileRenameOperations both when following the registry path and even searching at the HKEY levels.

View 3 Replies View Related

Xcopy

Mar 2, 2004

hi,
I have the following statement:
exec xp_cmdshell 'xcopy f:dataackup est1.bak \server2ackup /c'
it works in command prompt but not in QA. i tried dir on both the machines, it works fine.
harshal.

View 8 Replies View Related

Can I XCopy SQL CE 3.5? Yes And No, See Message.

Jan 31, 2008

I was hoping to upgrade my SQL CE from 3 to 3.5 for my PPC and desktop applications. However, when I went to XCopy to another desktop I got errors. First, error was that the System.Data.SqlServerCe.dll is not enough, so I copied the other dlls too. Then I got provider not installed error. I do not want to install, I just want to XCopy.
So I searched the newsgroups and online help. I tested using ClickOnce and that worked only because it installed SQL CE for me... but I want to just XCopy.
Next I commented out my code that uses LINQ and just used the old data adapter way to get data and it worked.
I use the same connection string:
"Data Source=C:=test.sdf;Password=sa2008;Persist Security Info=True;Encryption Mode=PPC2003 Compatibility;Max Database Size=4000"


1. Using old way to get data works with XCopy
2. Using LINQ way to get data DOES NOT work with XCopy

Seems that LINQ requires that SQL CE be installed on the desktop to work.
Is this true?


(I know LINQ is not support with SQL CE at this time, but it's sure nice to use)

One other problem I noticed is that I can compile and run my LINQ to SQL CE solution just fine in VS.Net 2008 express, but the same solution gives me a compile error without details as to why when compiled in VS.Net 2008 Pro.

,,,Bydia

View 11 Replies View Related

SQL Server 2008 :: SSIS Copy File From SharePoint Library Using File System Task Permissions?

Jun 19, 2015

Historically I've always written a VB script to copy a file from a sharepoint library. I don't like this method because I have to input a username & password in the script and maintain a config file.

Yesterday I was playing around with using a file system task. The sharepoint file has a UNC path so why not? I created a simple test package with a single file system task that copies the sharepoint file (addressed via UNC) to another network location. Package runs fine locally.

I try running on our utility server but am getting a "The file name [SHAREPOINT UNC PATH] specified in the connection was not valid" error. Package is running with a proxy on the server and the proxy account has the same permissions to the sharepoint site (so far as I can tell) as me.

View 0 Replies View Related

Xp_cmdshell With Xcopy Returns 2, Why?

Apr 8, 2008

According to the documentation, xp_cmdshell returns 0 if success or 1 if it fails, so I was curious as to why I was getting a return value of 2 when using it with xcopy. So in my t-sql code, if I have something like

@result = master..xp_cmdshell 'xcopy c: est.txt c:Program Files'

The result would return 2. Then if I check if @Result is not equal to 0, it would say their is an error when I am not sure if there was one. I did read on a faq that xcopy expects input from the user, which is normally provided at the command prompt through a return after the command and this behavior can me mimicked by adding "< NUL:" after the command text, which will effectively signal the XCOPY input stream, so the above command becomes:


@result = master..xp_cmdshell 'xcopy c: est.txt c:Program Files < NUL: '

I am still unsure why the @result would return a 2 though?
Also, if I am not going into any subdirectories, is their an advantage of copy over xcopy and vice versa?

If anyone has any info, please let me know, I am using Sql Server 2000.

Thanks in advance,
XaiSoft

View 4 Replies View Related

Batch File To Copy File And Append Date

Jan 5, 2005

The Sql Server database can only see the local drive.

I would like to set up a batch file that will copy a SQL Server

backup file from the local drive to the network drive. I would

like to append the file date to the end of the copied file. I

assume a batch file can accomplish this but I am new to batch

file writing. Does anyone have code that they already created

for this sort of task??

Thank you!

View 13 Replies View Related

SQL Express XCopy Deployment Under Vista

Nov 28, 2006

We are in the process of converting our MSDE-enabled products to using SQL Express for compatability with Vista. With help from the msdn article at http://msdn2.microsoft.com/en-us/library/ms165716.aspx I've been able to create a test install that works fine under XP, but fails under Vista. We have our application installing under the "Program Files" directory, and are copying the database's MDF file into the same directory. We are using AttachDbFileName to connect to the database and under XP the LDF file is created fine. Under Vista we receive an error that the database cannot be attached and I've noticed that the LDF file is not being created. I was receiving the exact same error under XP until I removed the LDF file from the install and allowed SQL Express to create it. I'm guessing that it is an issue in the permissions necessary to write the LDF file out to the applications directory, but that's just a guess. So, I was wondering what the Microsoft recommended method for doing a SQL Express XCopy deployment under Vista was?

View 2 Replies View Related

Issues With Moving Backups Via XCopy

Jun 9, 2006

When we take backups, we xcopy them from a folder (on a remote server) containing all of the backups for the databases on that server accross a network onto a central server, into a folder for that server/database. However, should one of the backups we have moved accross the network and onto the central server get deleted or moved, the XCopy does not attempt to move the copy from the remote server back onto the central server the next time we run the procedure...so is there a setting that essentially states, "sync up the source and destination, in order to make the destination match the host"? and what causes XCopy to ignore the files it previously moved into the destination? Is it a property on the file? Any advice?

thanks in advance!

SQL Server 2000

View 4 Replies View Related

Check File Date And Copy File

Apr 23, 2007

Hi,



I need to set up create a package so that I could check the date of the files posted in a folder, e.g. H:source. If there is no file created later than one day exists, then continue to check again one hour later. If files do exists, then copy then to c:dest and then upzip the files. Once this is done, sent an notification email to user@mydomain.com.



Thanks,

View 4 Replies View Related

File..Save Copy Of &&<package File&&> As... Not Available

Mar 27, 2006

According to the help for SSIS, one method of deploying an SSIS package
to a SQL Server, 
http://msdn2.microsoft.com/en-us/library/ms137565.aspx, is to use the
File...Save a Copy of <package file> as... menu option. 



I don't have that menu option at all.  And yes, the package is in
focus.  My save menu options are simply; Save Selected, Save
<package file> As... and Save All.



I am using Version 9.00.1399.00 of the SSIS Designer.



At one time I did have the Management Studio's CTP installed. 
However it was uninstalled before installing the tools from the
Standard Edition.  (it would seem like not completely however)



Your help would be greatly appreciated.  Thanx much.





p.s. Almost forgot to mention... I am already aware of using the
DTSInstall utility as a workaround.  It should be noted, however,
that despite enabling the "CreateDeploymentUtility" property, the
DTSInstall.exe is not copied to the binDeployment directory.

View 11 Replies View Related

Xcopy Not Copying All Files In Stored Procedure

Apr 8, 2008

I am executing xcopy with xp_cmdshell in a stored procedure and it is not copying all the files. There are about 600 files in the source directory and only around 190 are copied to the destination.

The command in the stored procedure is this N'xcopy c:source*.* c:dest'

Help please!!!!

Thanks,
Saied

View 14 Replies View Related

CLR Integration And SQL Express XCOPY Deployment Hell!

Jul 1, 2006

I originally developed my application using SQL 2005 Developer Edition, but want to switch to using an XCOPY deployed DB on SQL Express for deployement.

I have successfully copied the database.mdf/ldf files over to me project, and can connect using Data Source=.SQLExpress and AttachDbFilename=|DataDirectory|[database].mdf attributes.

The question is, how do I enable CLR integration for my C# SP's?

I've tried executing the following in various places:

sp_configure 'clr enabled', 1
go
reconfigure
go

But I obviously haven't hit the spot because I'm getting the following error when VS deploys my SP library:

Error: starting database upload transaction failed.
Error: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Any ideas?

View 1 Replies View Related

Exec Master.dbo.xp_cmdshell N'Xcopy C:@folder1 C:@folder2 /i'

Mar 7, 2008



Hi All,

I am writing a stored procedure which accepts 2 parameters -
Current version(.....for example V53)
UpgradeTo version(.....for example V61)

Using these 2 inputs --I need to create a directory V61 by copying directory V53
for this specific example it would go like this-------------

exec master.dbo.xp_cmdshell N'Xcopy c:V53 c:V61 /i'

Now if i want to make a dynamic query for this ...
how do i go about it?


declare @folder1 varchar(255)

declare @folder2 varchar(255)

declare @xcopytext varchar(255)


SET @folder1 = 'V53'

set @folder2 = 'V61'


set @xcopytext = N'Xcopy "c:@folder1" "c:@folder2" /i'

exec master.dbo.xp_cmdshell @xcopytext

This gives the error :
File Not Foundfolder1

How do I integrate dynamic query with XCopy functionality ?

View 5 Replies View Related

Xcopy Command Failed In Sql Server 2000 As Scheduled Task

Jul 20, 2005

After setting up the linked server connection at the standby server, Itried to xcopy a file through the sql server 2000 schedule task to thestandby server's shared directory. But it keeps giving me the errormessage with'Invalid Drive Specification'.My whole process includes1) set up linked server connection on the standby server2) set up job to xcopy file as operating system commend in sql serverfrom the production box(xcopy c:directoryfile.bak\standby_servere$directory /c)3) test, but not successful - I am already running the whole scheduletask as a Windows user with Admin authority.)What did I do wrong or did I miss something?Thanks in advance

View 6 Replies View Related

How To Know Whether A Computer Is A Sql Server According To The Name Of Computer?

May 9, 2004

Thanks a lot

View 6 Replies View Related

How To Copy .MDF FIle

Nov 12, 2003

hi,

I need to transfer my database from one computer to another. I am using SQL SERVER 2000. So I made the script of the database and transfered to other computer. Now when I try to run the script it gives me error that (mydatabase name).MDF file missing. So I tried to copy the .MDF file from my computer. but it says that access is denied and sharing volilation. Can anyone please help me that how can I copy the .MDF file and remove the sharing volilation.

View 7 Replies View Related

Copy File

Feb 20, 2002

Can anyone give best way to copy file from one server to another in the network in an automated way?
Di.

View 4 Replies View Related

Copy To Mdb File

Jul 12, 2007

how can i create a mdb file which represents a current database in sql server managment studio? i thought this would be obvious but it's not..

View 1 Replies View Related

Copy File

Aug 19, 2006

hi guys,

anybody know the syntax in SQL to copy file to other server.

we want to copy our db backup files automaticaly to other server.

thanks

-wei



View 5 Replies View Related

Copy File Automatically

Sep 22, 2004

I need to copy files from one machine to another machine. It should be done automatically. Could you please give me a suggestion. I have no idea about this. It should write a script or program. But I have no idea yet,

Thanks

View 8 Replies View Related

How To Copy File From Server To Pc

Nov 9, 2005

i have other question here, i would like to copy file from server to a PC. I create a script (.dat file):
xcopy \serverNameUsersyyu
\ComputerNamecyyu

Can you guy help me? Many thanks.

View 6 Replies View Related

Copy To Backup File

Apr 26, 2008

hi
i am using isp_backup store procedure to get the daily backup of database and this is work fine but i have copy the database file in network sharing folder to use
following cmd
EXEC master..xp_cmdshell 'D:filename M:foldernam'
M: is network folder to window2003
but their no copy this folder

thank

View 2 Replies View Related

Cannot Copy The Mdf File After Processing

Feb 1, 2007

I have a windows service that connects to a regular sql server 2005 database and basically bulk copies data into a SQL express database. Afterwards, I just want to copy the MDF file into a different directory. I keep getting the "Process cannot access file because it is being used by another process" error. I've tried changing the connection strings but nothing seems to work. I'm closing the connections in the code as well. Here is the code. Any thoughts or help would be appreciated. RefreshDB calls Sync 3 times and if all three calls are successful, it attempts to copy the database file to the specified location. This is where I get the error.

Public Function RefreshDB() As Boolean
Dim success As Boolean = True
Dim tables() As String = {"Job", "Equipment", "PMScheduled"}
For Each tableName As String In tables
If SyncTable(tableName) = False Then
success = False
Exit For
End If
Next
If success Then
'copy the new database to the target directory
Try
File.Copy(My.Settings.DBFilePath, My.Settings.TargetDirectory + "EMField.mdf")
Catch ex As Exception
My.Application.Log.WriteEntry(ex.Message + "(RefreshDB)", TraceEventType.Critical)
Return False
End Try
End If
Return success
End Function


Private Function SyncTable(ByVal tableName As String) As Boolean
Dim reader As SqlDataReader
Dim sourceViewName As String = String.Format("EMField{0}View", tableName)
Dim connectionString As String = My.Settings.EMFieldConnectionString
'insert the path to the database into the connectionstring
connectionString = connectionString.Replace("[DBFilePath]", My.Settings.DBFilePath)
Try
'clear the target table first
Using targetConnection As New SqlConnection(connectionString)
Using truncateCommand As New SqlCommand(String.Format("TRUNCATE TABLE {0}", tableName), targetConnection)
targetConnection.Open()
truncateCommand.ExecuteNonQuery()
targetConnection.Close()
End Using
End Using
'create a datareader from the source database
Using sourceConnection As New SqlConnection(My.Settings.EMLiteConnectionString)
Using readCommand As New SqlCommand(String.Format("SELECT * FROM {0}", sourceViewName), sourceConnection)
sourceConnection.Open()
reader = readCommand.ExecuteReader
BulkCopy(tableName, reader, connectionString)
reader.Close()
sourceConnection.Close()
End Using
End Using
Return True
Catch ex As SqlException
My.Application.Log.WriteEntry(ex.Message + "(sync)", TraceEventType.Critical)
Return False
End Try
End Function

Public Sub BulkCopy(ByVal tableName As String, ByRef reader As SqlDataReader, ByVal connectionString As String)
Try
'bulk copy from source to target database
Using bulkCopy As New SqlBulkCopy(connectionString)
bulkCopy.DestinationTableName = tableName
bulkCopy.WriteToServer(reader)
bulkCopy.Close()
End Using
Catch ex As SqlException
'throw exception back to calling sub
Throw ex
End Try
End Sub

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved