4

I'm using SQLCMD in PDW for extracting data into a flat file. The command line syntax is given below:

sqlcmd -S "10.20.30.40,19001" -d MyPDW_DB -U PDW_User -P Password1 -Q "SET QUOTED_IDENTIFIER ON; SELECT * FROM MyPDW_DB.dbo.SampleFact" -o "FactOut.txt" -s"|"

When I try to execute the batch file, I get the following error:

Msg 104409, Level 16, State 1, Server PdwTdsServer, Line 1 Setting QuotedIdentifier to 'OFF' is not supported.

I am assuming this is due to the fact that there is a "comma" in the server name (IP address,Port Number). I can use this command for extracting data from SQL tables. Any idea on how I can make this working for PDW?

Thanks in advance

Triumph Spitfire
  • 663
  • 15
  • 38
  • Try removing "SET QUOTED_IDENTIFIER ON; " from your query since your not using any Keywords as tablename. – knkarthick24 Jan 19 '15 at 08:59
  • Thanks for your reply. I tried that as well. But I get the same error. – Triumph Spitfire Jan 19 '15 at 09:03
  • What error you're getting now? I believe it is not the same as above since you removed set QuotedIdentifier to 'OFF' . – knkarthick24 Jan 19 '15 at 09:10
  • I'm getting the exact same error: **Msg 104409, Level 16, State 1, Server PdwTdsServer, Line 1 Setting QuotedIdentifier to 'OFF' is not supported.** That's reason I suspect it has something to do with the "comma" in the server name, though the error message is not very helpful. – Triumph Spitfire Jan 19 '15 at 09:21
  • try running this one: sqlcmd -S 10.20.30.40 -d MyPDW_DB -U PDW_User -P Password1 -Q "SELECT * FROM MyPDW_DB.dbo.SampleFact" -o "FactOut.txt" – knkarthick24 Jan 19 '15 at 10:19
  • I cannot connect to the PDW instance without the port number. However, I tried what you suggested but it didn't work either. :-| – Triumph Spitfire Jan 19 '15 at 10:33
  • Try reading this: http://stackoverflow.com/questions/9478957/unable-to-access-an-instance-of-sql-server-2008-r2-remotely – knkarthick24 Jan 19 '15 at 10:59

1 Answers1

4

I got this working partially.

sqlcmd -S "10.20.30.40,19001" -d MyPDW_DB -U PDW_User -P Password1 -I -Q "SELECT * FROM MyPDW_DB.dbo.SampleFact" -o "FactOut.txt" -s"|"

For setting the quoted_identifier OFF, the option to use is "-I". However, I'm still trying to find an alternative for "SET NOCOUNT ON" option which is not supported in PDW. If someone can help me with that, I'd greatly appreciate that.

Triumph Spitfire
  • 663
  • 15
  • 38