The results of the code below places the result of the query in a text file. Is there a way to include a header?
What is the syntax when you need to use a variable in the query?
What is the syntax when you need to use a string literal in the query?
EXEC master..xp_cmdshell 'bcp "select claim,adjrun,paybatch,referral,claim_status from ##closedreferrals" queryout F:\claimsnet\ClosedReferrals.txt -c -S CCMFISCALNT3 -T'
What is the syntax when you need to use a variable in the query?
What is the syntax when you need to use a string literal in the query?
EXEC master..xp_cmdshell 'bcp "select claim,adjrun,paybatch,referral,claim_status from ##closedreferrals" queryout F:\claimsnet\ClosedReferrals.txt -c -S CCMFISCALNT3 -T'