Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

bulk Insert Error Expand / Collapse
Author
Message
Posted Friday, December 14, 2012 11:56 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 24, 2014 8:19 PM
Points: 56, Visits: 240
Hi I am trying to execute .tbl file to bulk insert in the server ServerA. The .tbl file was saved in Server ServerB. So I used the query and path as follows.

I tried in two different ways.
BULK INSERT tablename
FROM '\\servernameB\F$\Upload Data\David\test.tbl'
WITH
(
--DATAFILETYPE = 'widechar',
FIELDTERMINATOR = '^',
ROWTERMINATOR = ''
)

BULK INSERT tablename
FROM '\\servernameB\Upload Data\David\test.tbl'
WITH
(
--DATAFILETYPE = 'widechar',
FIELDTERMINATOR = '^',
ROWTERMINATOR = ''
)

I gave the full control/permissions to the folder in serverB but still I am getting the below error.

Cannot bulk load because the file \\servernameB\Upload Data\David\test.tbl could not be opened. Operating system error code 3(The system cannot find the path specified.).


Please Please help me in this. We using serverA first time and getting this issue.Also I got stuck with this from past 3 days and not able to do any stuff.
Post #1396769
Posted Friday, December 14, 2012 12:13 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, July 17, 2014 1:20 PM
Points: 1,615, Visits: 2,116
It's possible that whatever process you are using to execute this BULK INSERT is running with a security context that doesn't have access to that particular share and/or folder. It is a different thing to run this kind of query from SSMS than to run it from SSIS, as with the latter, you can run a package a number of ways, and those different ways may all run with a different security context. For example, if this runs as part of an SQL Agent job, the the SQL Agent service account will need access to the specified share, whereas if you run this via SSMS, it's your logon credentials that wil be used.


Steve
(aka sgmunson)

Internet ATM Machine
Post #1396780
Posted Friday, December 14, 2012 1:52 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 24, 2014 8:19 PM
Points: 56, Visits: 240
How do we get the sql server agent service account...I mean in which way we can it
Post #1396810
Posted Friday, December 14, 2012 3:32 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, July 17, 2014 1:20 PM
Points: 1,615, Visits: 2,116
Which account to use was decided when SQL Server was installed, and the information was used to supply the installation procedure with the account name and/or password. Your DBA should know this information. In many corporate environments, there's a single domain account used for this purpose. If this is your own personal instance, you may want to Google search for how to find the SQL Server Agent Service account name. I don't know where that information resides, but I'd be very surprised if you had to go looking in the registry to find it.

Steve
(aka sgmunson)

Internet ATM Machine
Post #1396828
Posted Friday, December 14, 2012 3:40 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, July 17, 2014 1:20 PM
Points: 1,615, Visits: 2,116
Looks like it sorta is in the registry, but if WMI is in place, the following WMI query will shake it loose:

wmic service where "name Like '%SQL%'" get Name , StartName

Found the query on Stack Overflow at the following site:

http://stackoverflow.com/questions/7324407/get-service-account-details-of-the-sql-agent-service

Enjoy...


Steve
(aka sgmunson)

Internet ATM Machine
Post #1396829
Posted Sunday, December 16, 2012 9:33 PM


SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 9:13 AM
Points: 80, Visits: 344
Hi All,

First, I am assuming that you are using at least the standard or higher version of SQL Server.

I think the Express version does not have the agent.


The SQL Server agent - account - can be found under the configuration manager.

http://msdn.microsoft.com/en-us/library/ms174212.aspx

You should never use services.msc since a certificate is created when settings are changed.

Usually a domain account is supplied and is part of the local admins group on the machine.


However, other setups might be dictated by your company.

http://msdn.microsoft.com/en-us/library/ms191543.aspx

The Matrix at the end shows what accounts are possible to use and limititations.


If your account used by the agent allows logins into the server, ask your DBA to MSTSC into the server and try running the BULK INSERT. If this does not work, your account does not have the rights.

If this does work, then your SQL Server Agent is not configured correctly.

Like always, more detail and screen shots help us get to the root of your problem.

Good luck




John Miner
Crafty DBA
www.craftydba.com
Post #1397077
Posted Monday, December 17, 2012 10:30 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, April 24, 2014 8:19 PM
Points: 56, Visits: 240
Actually I do not have the permission to the server remotely. Because it's a database server I won't get access to the folders in the server to store .tbl files.
Post #1397345
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse