Skip to main content
added 58 characters in body
Source Link
John K. N.
  • 18.3k
  • 14
  • 54
  • 115

I'm not sure but is it as simple as adding two single quotes to your statement around B1A?

Yours:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull ''B1A'';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

Mine:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull '''B1A''';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

You might even need an extra two single quotes around B1A.

I'm not sure but is it as simple as adding two single quotes to your statement around B1A?

Yours:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull ''B1A'';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

Mine:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull '''B1A''';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

I'm not sure but is it as simple as adding two single quotes to your statement around B1A?

Yours:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull ''B1A'';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

Mine:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull '''B1A''';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

You might even need an extra two single quotes around B1A.

Source Link
John K. N.
  • 18.3k
  • 14
  • 54
  • 115

I'm not sure but is it as simple as adding two single quotes to your statement around B1A?

Yours:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull ''B1A'';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO

Mine:

DECLARE @SQL VARCHAR(8000); 
SELECT @SQL = 'bcp "EXEC ispsSelectEmptyAsNull '''B1A''';" 
           queryout "F:\aaData\IPACostData\R15TData\2BSHAEOS_B1A_20121120.txt" 
           -f "F:\aaData\IPACostData\R15TData\tmpFormatCard_B1A.fmt" -T -S' +     
@@SERVERNAME + ''; 
EXEC xp_cmdshell @SQL;
GO