Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


bulk Insert Error


bulk Insert Error

Author
Message
DBA12345
DBA12345
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
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.
sgmunson
sgmunson
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2867 Visits: 3775
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)
Smile Smile Smile
Health & Nutrition
DBA12345
DBA12345
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
Points: 56 Visits: 240
How do we get the sql server agent service account...I mean in which way we can it
sgmunson
sgmunson
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2867 Visits: 3775
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)
Smile Smile Smile
Health & Nutrition
sgmunson
sgmunson
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2867 Visits: 3775
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)
Smile Smile Smile
Health & Nutrition
j.miner
j.miner
SSC Journeyman
SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)SSC Journeyman (88 reputation)

Group: General Forum Members
Points: 88 Visits: 358
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
DBA12345
DBA12345
Valued Member
Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)Valued Member (56 reputation)

Group: General Forum Members
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search