Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 basic question!!

Author  Topic 

PatDeV
Posting Yak Master

197 Posts

Posted - 2006-02-07 : 17:45:22
declare @sCmd varchar(500)
set @sCmd ='copy /Y \\testserver\Karen C\testmodel.mdb \\testserver\Karen C\test.mdb'
exec master..xp_cmdshell @sCmd

where is am doing wrong

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-02-07 : 17:55:43
Is Karen C the share name? Are you receiving an error?

Tara Kizer
aka tduggan
Go to Top of Page

PatDeV
Posting Yak Master

197 Posts

Posted - 2006-02-07 : 17:58:09
yes!
Go to Top of Page

PatDeV
Posting Yak Master

197 Posts

Posted - 2006-02-07 : 17:58:41
it says
The syntax of the command is incorrect.

On QA!!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-02-07 : 18:03:22
Change the share name so that there isn't a space in it. Otherwise, you'll have to refer to it via its MS-DOS 8.3 name (or whatever it's called).

Tara Kizer
aka tduggan
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-02-07 : 21:02:24
quote:
Originally posted by tkizer

Change the share name so that there isn't a space in it. Otherwise, you'll have to refer to it via its MS-DOS 8.3 name (or whatever it's called).

Tara Kizer
aka tduggan



Nah

set @sCmd ='copy /Y "\\testserver\Karen C\testmodel.mdb \\testserver\Karen C\test.mdb"'

Should do it



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page
   

- Advertisement -