Bulk Insert

  • I am using SQL Server 2005 (Yukon) Beta2.

    I have a table:

    create table mbt_image_1MB

       (emp_id int identity(1,1) not null,

        fname varchar(20) null,

        lname varchar(30) null,

        hiredate datetime null,

        ssn char(12) null,

        mgrid int null,

        dept varchar(20) null,

        title char(30) null,

        hourly_wage money not null default $5.00,

        employee_image image not null)

    go

    I am trying to insert a image using bulk insert.

    bulk insert dbo.mbt_image_1MB from '\\pund2k215\mbt\sql\image_data\1MB.bmp'

    with (formatfile = '\\pund2k215\mbt\sql\image_data\mbt_image_bcp_format9.txt')

    go

    Format9.txt contains the following data :

    8.0

    1

    1  SQLBINARY     0  0 "!end!"  8  employee_image SQL_Latin1_General_CP1_CI_AS 

    Now when I run the bulk insert statement using Query Analyser, I get

    the error :

    Server: Msg 4861, Level 16, State 1, Line 1

    Could not bulk load because file '\\pund2k215\mbt\sql\image_data\1MB.bmp' could not be opened. Operating system error code 1326(Logon failure: unknown user name or bad password.).

    However, the same runs fine when i am using SQL 2000.

    ANy help would be appreciated.

    Regds,

    Kishore

  • You may want to check what account the job is executed under for both of your cases. Is it SQL server startup account? Is it your Windows login? Are you connecting using Query Analyzer as a low-privileged standard login?

    What do you mean, SQL 2000 versus Query Analyzer?

    Yelena

    Regards,Yelena Varsha

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply