|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi There,
Is this possible to read and write to remote directory. In order to access the directory i need to pass user name and password. At the moment i use BULK INSERT and bcp to import export files. Thanks Ganesh |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> Is this possible to read and write to remote directory.
Yes. The Best Practice is to use UNC naming (e.g. "\\SERVERNAME\SHARENAME\FILENAME") > In order to access the directory i need to pass user name and > password. It's a bit of a kludge but you can authenticate with a NET USE command like the example below. See Windows for more information on NET USE Personally, I'd perform these tasks in an SSIS or DTS package instead of Transact-SQL. EXEC master..xp_cmdshell 'NET USE \\SERVERNAME\SHARENAME somepassword /USER:someuser' BULK INSERT dbo.SomeTable FROM '\\SERVERNAME\SHARENAME\SOMEFILE.TXT' EXEC master..xp_cmdshell 'NET USE \\SERVERNAME\SHARENAME /DELETE' -- Hope this s. Dan Guzman SQL Server MVP http://weblogs.sqlteam.com/dang/ "Ganesh" <gsganesh@gmail.com> wrote in message news:056b61b2-1978-4809-8b2b-9695162d2ee4@j22g2000hsf.googlegroups.com... > Hi There, > > Is this possible to read and write to remote directory. > In order to access the directory i need to pass user name and > password. > > At the moment i use BULK INSERT and bcp to import export files. > > > Thanks > Ganesh |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
If possible, put the two servers in the same domain or domains that trust
each other. Then you don't need to pass user name or password. This would be more much secure and convenient. Linchi "Ganesh" wrote: > Hi There, > > Is this possible to read and write to remote directory. > In order to access the directory i need to pass user name and > password. > > At the moment i use BULK INSERT and bcp to import export files. > > > Thanks > Ganesh > |
|
![]() |
| Outils de la discussion | |
|
|