This is a weird one - try this query
CREATE INDEX idx_test ON table_test(col_one,col_two);
WIth plain SQLcmd.exe
e.g. SQLCMD.exe -S server\instance -q "USE mydb; CREATE INDEX idx_test ON table_test(col_one,col_two);"
It fails with this error
Msg 1934, Level 16, State 1, Server THOMAS-TESTSQL\DEV1, Line 1 CREATE INDEX failed because the following SET options have incorrect settings: ' QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed vie ws and/or indexes on computed columns and/or filtered indexes and/or query notif ications and/or XML data type methods and/or spatial index operations.
but if I run the same with powershell Invoke-Sqlcmd it works just fine.. as well as in sql-server studio
Quoted identifier setting is off (turning it on doesnt make any difference).
i tried with file-input as well, tried changing encoding etc - but pretty much seems anything with multiple columns in a create index just simply fails with plain sqlcmd.exe - single columns are fine.
user has db_owner role - but tried with a sysadmin user as well (windows auth only box).
tried from multiple hosts as well as on the db server itself - the target is sql-server 2014 std, not sure what more info I can provide that helps..
I guess my first question out there is if it is just me or is it a real bug?
I have been unable to find anything specifically related to this out there