Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 20th, 2004, 06:49 AM
Georgina Georgina is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 16 Georgina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 23 sec
Reputation Power: 0
Cool Using SQL to copy local file to Intranet server

We are thinking of changing the setup of our intranet to use SQL Server to do the actual processing of copying a local file selected by the user to a network share and saving the link in a database. The files may be Word, Excel, Powerpoint, Acrobat files up to 6 mB in size. Other users would retrieve this documents from their local PC. I have no idea how to approach this, can anyone give me some pointers?
Georgina

Reply With Quote
  #2  
Old September 3rd, 2004, 04:20 PM
jlestein jlestein is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Oregon
Posts: 7 jlestein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Permissions Problems

I also have been wanting to do something similar. When a SP is run I want it to copy a file to a location on another server on our internal network.
Even after changing the SQL process to run as a particular user instead of the system account it still does not seem to work.

Any help in copying files to a network location is greatly appreciated.
Joshua

Quote:
Originally Posted by Georgina
We are thinking of changing the setup of our intranet to use SQL Server to do the actual processing of copying a local file selected by the user to a network share and saving the link in a database. The files may be Word, Excel, Powerpoint, Acrobat files up to 6 mB in size. Other users would retrieve this documents from their local PC. I have no idea how to approach this, can anyone give me some pointers?
Georgina

Reply With Quote
  #3  
Old September 6th, 2004, 12:33 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
You can do that kind of coding in stored procedures, if that's the route you want to take.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #4  
Old September 7th, 2004, 12:14 PM
jlestein jlestein is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Oregon
Posts: 7 jlestein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Examples...

So do you have an example of how to do the file copy with in a Stored procedure then?
Thanks,
Joshua

Quote:
Originally Posted by Doug G
You can do that kind of coding in stored procedures, if that's the route you want to take.

Reply With Quote
  #5  
Old September 7th, 2004, 04:59 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 29 m 58 sec
Reputation Power: 181
Here's one reference to using a COM object from a SP

http://www.sqlteam.com/item.asp?ItemID=322

Reply With Quote
  #6  
Old September 7th, 2004, 05:47 PM
jlestein jlestein is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Oregon
Posts: 7 jlestein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unfortunately this will not work. Even if you create an object, it is still created under the SQL System process. The problem I am having is that SQL does not see network locations.

If you are connecting from one windows machine to another than this will work just fine but when you are connecting to a non-windows machine there is no easy way to match the SQL user with a remote user account to allow SQL to see the remote server.

I tried using "net use" to map a drive under the SQL Process and this works well to copy to any windows based location but not to non windows machine.

Any other ideas?

Reply With Quote
  #7  
Old September 7th, 2004, 06:27 PM
Scorpions4ever Scorpions4ever is offline
Mad Rater
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 126 Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 31 m 44 sec
Reputation Power: 8
Sounds like you may need to setup the account that SQL Server runs under (When you install SQL Server, you're given the option of using Local System or a Windows User account for this) in the other system with no password, so that it can map the drives correctly? There may be security implications about allowing a mapping with no password though, unless you restrict this to a specific IP address.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.

Reply With Quote
  #8  
Old September 7th, 2004, 06:31 PM
jlestein jlestein is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Oregon
Posts: 7 jlestein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes, this works like this but I am not sure how to go about restricting the IP Address on our internal network...

Reply With Quote
  #9  
Old September 7th, 2004, 07:29 PM
Scorpions4ever Scorpions4ever is offline
Mad Rater
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 126 Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level)Scorpions4ever User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 31 m 44 sec
Reputation Power: 8
Depends on what you're using to map a drive. If you're using samba on the other server, note that the smb.conf file has a hosts allow= directive where you can specify the IP addresses that are allowed to connect.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Using SQL to copy local file to Intranet server


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT