Error SQL Insert into table with SumIndexFields

MaX99MaX99 Member Posts: 4
edited 2014-01-20 in SQL General
Hello,

I have made a simple SQL query to instert information from table [A] to table , this two tables are Navision tables.

This is the query:
INSERT INTO SELECT * FROM [A]

I execute the query and it works well, the problem is if I put in a table in Navision key any value in field SUMINDEXFIELD, if I add information in this field and I try to call the query from cmd the program fail, this is the error:

Msg 1934, Level 16, State 1, Server ESWS52NBT7JXT\NAVDEMO, Line 1
INSERT failed because the following SET options have incorrect settings: 'QUOTED
_IDENTIFIER'. Verify that SET options are correct for use with indexed views and
/or indexes on computed columns and/or filtered indexes and/or query notificatio
ns and/or XML data type methods and/or spatial index operations.

If I execute the query directy in SQL Manager Server it works well but if I try to do the call for SQL server Agent o in cmd appers this error.

Thanks for your help.

Comments

  • krikikriki Member, Moderator Posts: 9,112
    Your SSMS studio has certain setup that is set for each query-execution. Check SSMS in Tools=>Options=>Query Exectution=>SQL Server=>Advanced.
    When you run the query from SQL Server Agent job, you probably have different settings and need to set them manually using one of the following:
    SET QUOTED_IDENTIFIER OFF;
    
    or
    SET QUOTED_IDENTIFIER ON;
    

    It is also possible that you get other errors on other SET-tings. In that case, you need to SET it too.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.