Thank you so much for posting here.
Please refer below and check whether it is helpful to you.
CREATE TABLE Customer
(
Customer_Name varchar(50) NOT NULL
);
GO
INSERT INTO Customer values
('DB Manager12'),
('IT Director'),
('3346');
select IIF(isnumeric(Customer_Name)=1,Customer_Name,quotename(Customer_Name,char(34))) from testdb.dbo.Customer
BCP command as below:
BCP "select IIF(isnumeric(Customer_Name)=1,Customer_Name,quotename(Customer_Name,char(34))) from testdb.dbo.Customer" queryout "d:\test.txt" -c -t"," -T
Output:
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hot issues November--What can I do if my transaction log is full?
Hot issues November--How to convert Profiler trace into a SQL Server table