I am trying to export a table present in ms sql server 2008 to a text file on my system.
I am writing the following command in sql server query window
SELECT *
FROM [AdventureWorks].[Person].[AddressType]
INTO OUTFILE 'C:/filename.csv'
FIELDS TERMINATED BY ','
LINES TERMINATED BY '
';
Now whenever I write this command the sql help gives me error that incorrect syntax near 'INTO'
then I tried interchanging from and into keywords as follows
SELECT *
INTO OUTFILE 'C:/filename.csv'
FIELDS TERMINATED BY ','
LINES TERMINATED BY '
'
FROM [AdventureWorks].[Person].[AddressType] ;
Now it gives me error that incorrect syntax near 'C:/filename.csv'
Please help me regarding this.
I am not able to remove these error and get a working sql
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…