SQL Server Performance

BCP causes database connection timeouts

Discussion in 'SQL Server 2005 Database Mirroring' started by fil_bell, Feb 10, 2009.

  1. fil_bell New Member

    I have recently setup high availability mirroring using a seperate witness server. Since doing so the following BCP queryout causes all database connections from applications using ADO.NET to timeout (10 seconds) while it executes. This can take more than 60 seconds depending on the amount of data.SET @SQL = 'SELECT * FROM Database.dbo.Log(NOLOCK) WHERE UniqueID <= ' + CONVERT(VarChar(20), @MaxUniqueID)
    SET @CMD = 'bcp "' + @SQL + '" queryout "' + @Filename + '" -c -T'
    exec master.dbo.xp_cmdshell @CMD
    There was no problem before database mirroring was setup, this just does not make any sense.
  2. satya Moderator

    Why you are running a command line operation to fetch the data with a query?
    Why not run or design a SSIS package that can easily get you required data?

Share This Page