选择Into Outfile语法不正确?

时间:2014-03-11 16:48:14

标签: sql sql-server select

我正在尝试在SQL Server 2008 R2 Management Studio中执行简单的SELECT INTO OUTFILE查询。我不明白为什么这会给我这个错误。

SELECT * INTO OUTFILE 'C:\datadump\sqldbdump.txt"
FROM dbo.alarms_2_2014
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n';

错误:

  

C:\ datadump \ sqldbdump.txt'附近的语法不正确。

1 个答案:

答案 0 :(得分:7)

SELECT * INTO OUTFILE "C:\datadump\sqldbdump.txt"
FIELDS TERMINATED BY '\t' 
LINES TERMINATED BY '\r\n' 
FROM dbo.alarms_2_2014;

尝试这个应该完美的工作。