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
 General SQL Server Forums
 New to SQL Server Programming
 Ubuntu using Bulk Insert to Windows SqlServer

Author  Topic 

sqlnewuser
Starting Member

4 Posts

Posted - 2009-07-15 : 03:08:14
Hi,

Anyone can help me, I can connect from Ubuntu "freetds driver" to Windows SQLServer Database. I can update, delete, select, insert, etc.

But when I use bulk insert, getting some errors which the location of my textfile was correct. See the list for my commands and errors;

1> BULK INSERT test FROM '/home/test/test.txt' WITH (FIRSTROW = 2, CODEPAGE = 'ACP', DATAFILETYPE = 'char', FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')
2> go
Msg 4861, Level 16, State 1, Server GMSERVER, Line 1
Cannot bulk load because the file "/home/test/test.txt" could not be opened. Operating system error code 3(The system cannot find the path specified.).


Thanks in Advance.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-15 : 03:20:24
the location of BULK INSERT should be a drive or path accessible on the Server side not your client.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-15 : 03:38:57
check the sql service account from which server you are getting error. check whether that service account has the access to that folder..

-------------------------
R..
Go to Top of Page

sqlnewuser
Starting Member

4 Posts

Posted - 2009-07-15 : 03:39:32
Hi Khtan,

Is there a way that the path from my unix client can specify the path from the windows sqlserver database.

I want all the process done in unix side, because I'm grabbing some data with different platform. And in the end push the data to Windows SqlServer using bulk insert. Thanking you.


Regards,
DBM
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-15 : 03:44:19
BULK INSERT is server side operation. You have to make the path available to the server on the server end


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-15 : 03:51:57
Hi KH

Is it possible to give like this right \\LocalcomputerName\path\folder\......



-------------------------
R..
Go to Top of Page

sqlnewuser
Starting Member

4 Posts

Posted - 2009-07-15 : 03:54:42
Hi All,

Get the point, now it works...fantastic.

Cheers,
DBM
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-15 : 03:57:01
BULK INSERT will be using the SQL Server services account rights. You need to ensure that it has the access rights to the required path

I don't think Windows Server will be able to access to unix path directly without some additional driver.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-15 : 04:01:15
Hi sqlnewuser

You should post the solution what u have done...

-------------------------
R..
Go to Top of Page

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-15 : 04:03:07
quote:
Originally posted by rajdaksha

check the sql service account from which server you are getting error. check whether that service account has the access to that folder..

-------------------------
R..



Hi Khtan

i have mentioned...above its right...


-------------------------
R..
Go to Top of Page

sqlnewuser
Starting Member

4 Posts

Posted - 2009-07-15 : 04:05:02
Install and configure Samba then specify UNC Path. Cheers
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-15 : 04:16:59
that's good


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -