declare @var varchar(100)set @var = 'aaaaa1'
declare @cmd varchar(200)set @cmd = 'bcp "select '''+@var+''' " queryout D:\001.txt -S "10.0.3.49" -U "sa" -P "" -c '
EXEC master..xp_cmdshell @Cmd