Results 1 to 5 of 5

Thread: BCP

  1. #1
    Harish Guest

    BCP

    When i try to run my BCP program its giving me the following error
    DB-LIBRARY
    error: Bcp: Unable to open host data-file
    =============
    my program is
    declare @v1 varchar(3)
    Declare @cmdstring varchar(255)
    Declare @filename varchar(32)

    declare c1 cursor
    for select oldlob from xlob


    open c1
    fetch next from c1 into @v1
    WHILE @@FETCH_STATUS = 0
    begin
    delete from final1
    insert into final1
    select account_code,newaccountcode,net_change,0.0,'30 APR 2001','USD'
    from test1 where oldlob=@v1
    order by oldlob,account_code

    select @filename = 'xxgl_efs_conversions_dat.0'+@v1
    Select @cmdstring = 'bcp testgl..final1 out c:efs estapr2001' + @filename + ' -c -t"|" -r
    -Spla -Usa -Psuper'

    exec master..xp_cmdshell @cmdstring
    fetch next from c1 into @v1
    end
    close c1
    deallocate c1

  2. #2
    Jürgen Leis Guest

    BCP (reply)

    Either your path is misspelled or more likely:

    If you execute this as an Administrator (sa)
    the Account SQL Server is running under has
    no write permission in the directory.

    If you execute this as a reguler User
    the SQLAgentCmdExec Account has
    no write permission in the directory.


    ------------
    Harish at 12/3/2001 1:11:01 PM

    When i try to run my BCP program its giving me the following error
    DB-LIBRARY
    error: Bcp: Unable to open host data-file
    =============
    my program is
    declare @v1 varchar(3)
    Declare @cmdstring varchar(255)
    Declare @filename varchar(32)

    declare c1 cursor
    for select oldlob from xlob


    open c1
    fetch next from c1 into @v1
    WHILE @@FETCH_STATUS = 0
    begin
    delete from final1
    insert into final1
    select account_code,newaccountcode,net_change,0.0,'30 APR 2001','USD'
    from test1 where oldlob=@v1
    order by oldlob,account_code

    select @filename = 'xxgl_efs_conversions_dat.0'+@v1
    Select @cmdstring = 'bcp testgl..final1 out c:efs estapr2001' + @filename + ' -c -t"|" -r
    -Spla -Usa -Psuper'

    exec master..xp_cmdshell @cmdstring
    fetch next from c1 into @v1
    end
    close c1
    deallocate c1

  3. #3
    Harish Guest

    BCP (reply)


    I have all the permission on that folder
    and the path of the file is also correct
    I am unbale to figure out thats wrong with this...becoz I was running this program for so long...and all of sudden it gave me this error.

    Thanks,

    ------------
    Jürgen Leis at 12/3/2001 2:16:38 PM

    Either your path is misspelled or more likely:

    If you execute this as an Administrator (sa)
    the Account SQL Server is running under has
    no write permission in the directory.

    If you execute this as a reguler User
    the SQLAgentCmdExec Account has
    no write permission in the directory.


    ------------
    Harish at 12/3/2001 1:11:01 PM

    When i try to run my BCP program its giving me the following error
    DB-LIBRARY
    error: Bcp: Unable to open host data-file
    =============
    my program is
    declare @v1 varchar(3)
    Declare @cmdstring varchar(255)
    Declare @filename varchar(32)

    declare c1 cursor
    for select oldlob from xlob


    open c1
    fetch next from c1 into @v1
    WHILE @@FETCH_STATUS = 0
    begin
    delete from final1
    insert into final1
    select account_code,newaccountcode,net_change,0.0,'30 APR 2001','USD'
    from test1 where oldlob=@v1
    order by oldlob,account_code

    select @filename = 'xxgl_efs_conversions_dat.0'+@v1
    Select @cmdstring = 'bcp testgl..final1 out c:efs estapr2001' + @filename + ' -c -t"|" -r
    -Spla -Usa -Psuper'

    exec master..xp_cmdshell @cmdstring
    fetch next from c1 into @v1
    end
    close c1
    deallocate c1

  4. #4
    Harish Guest

    BCP (reply)


    I don't see any wrong in this command
    but i am unable to find the error..please help!!!

    bcp agprod..company out d: estcompany.txt -Snmerhoutrans -Usa -Psa

    Msg 170, Level 15, State 1
    Line 1: Incorrect syntax near '.'.


    ------------
    Harish at 12/3/2001 3:21:47 PM


    I have all the permission on that folder
    and the path of the file is also correct
    I am unbale to figure out thats wrong with this...becoz I was running this program for so long...and all of sudden it gave me this error.

    Thanks,

    ------------
    Jürgen Leis at 12/3/2001 2:16:38 PM

    Either your path is misspelled or more likely:

    If you execute this as an Administrator (sa)
    the Account SQL Server is running under has
    no write permission in the directory.

    If you execute this as a reguler User
    the SQLAgentCmdExec Account has
    no write permission in the directory.


    ------------
    Harish at 12/3/2001 1:11:01 PM

    When i try to run my BCP program its giving me the following error
    DB-LIBRARY
    error: Bcp: Unable to open host data-file
    =============
    my program is
    declare @v1 varchar(3)
    Declare @cmdstring varchar(255)
    Declare @filename varchar(32)

    declare c1 cursor
    for select oldlob from xlob


    open c1
    fetch next from c1 into @v1
    WHILE @@FETCH_STATUS = 0
    begin
    delete from final1
    insert into final1
    select account_code,newaccountcode,net_change,0.0,'30 APR 2001','USD'
    from test1 where oldlob=@v1
    order by oldlob,account_code

    select @filename = 'xxgl_efs_conversions_dat.0'+@v1
    Select @cmdstring = 'bcp testgl..final1 out c:efs estapr2001' + @filename + ' -c -t"|" -r
    -Spla -Usa -Psuper'

    exec master..xp_cmdshell @cmdstring
    fetch next from c1 into @v1
    end
    close c1
    deallocate c1

  5. #5
    Juergen Leis Guest

    BCP (reply)

    You must execute this command in a CMD Window, not in Query Analyzer.


    ------------
    Harish at 12/3/2001 5:10:32 PM


    I don't see any wrong in this command
    but i am unable to find the error..please help!!!

    bcp agprod..company out d: estcompany.txt -Snmerhoutrans -Usa -Psa

    Msg 170, Level 15, State 1
    Line 1: Incorrect syntax near '.'.


    ------------
    Harish at 12/3/2001 3:21:47 PM


    I have all the permission on that folder
    and the path of the file is also correct
    I am unbale to figure out thats wrong with this...becoz I was running this program for so long...and all of sudden it gave me this error.

    Thanks,

    ------------
    Jürgen Leis at 12/3/2001 2:16:38 PM

    Either your path is misspelled or more likely:

    If you execute this as an Administrator (sa)
    the Account SQL Server is running under has
    no write permission in the directory.

    If you execute this as a reguler User
    the SQLAgentCmdExec Account has
    no write permission in the directory.


    ------------
    Harish at 12/3/2001 1:11:01 PM

    When i try to run my BCP program its giving me the following error
    DB-LIBRARY
    error: Bcp: Unable to open host data-file
    =============
    my program is
    declare @v1 varchar(3)
    Declare @cmdstring varchar(255)
    Declare @filename varchar(32)

    declare c1 cursor
    for select oldlob from xlob


    open c1
    fetch next from c1 into @v1
    WHILE @@FETCH_STATUS = 0
    begin
    delete from final1
    insert into final1
    select account_code,newaccountcode,net_change,0.0,'30 APR 2001','USD'
    from test1 where oldlob=@v1
    order by oldlob,account_code

    select @filename = 'xxgl_efs_conversions_dat.0'+@v1
    Select @cmdstring = 'bcp testgl..final1 out c:efs estapr2001' + @filename + ' -c -t"|" -r
    -Spla -Usa -Psuper'

    exec master..xp_cmdshell @cmdstring
    fetch next from c1 into @v1
    end
    close c1
    deallocate c1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •