• In the end I got it to work. You were right, it was an issue with permissions on the c:\ but just simply not specifying a path didn't help.

    I ended up with

    declare @sql varchar(8000)

    select @sql = 'bcp AICS_Employees.dbo.Employee out c:\bcp\bcptest3.txt -c -t, -T -S'+ @@servername

    exec master..xp_cmdshell @sql

    worked perfectly.

    If I simply changed the path to c:\

    declare @sql varchar(8000)

    select @sql = 'bcp AICS_Employees.dbo.Employee out c:\bcptest3.txt -c -t, -T -S'+ @@servername

    exec master..xp_cmdshell @sql

    i get this error

    SQLState = HY000, NativeError = 0

    Error = [Microsoft][SQL Native Client]Unable to open BCP host data-file

    NULL

    thanks again for your help.