def add_category_for_query(conn, category_id, query_id):
    if (is_conn(conn) and is_int(category_id) and is_int(query_id)):
        cursor = conn.cursor()
        cursor.execute('SET IDENTITY_INSERT dbo.CategoryForQuery ON')
        conn.commit()
        cursor.execute('INSERT INTO dbo.CategoryForQuery (Id,QueryId,CategoryId)                 VALUES((SELECT max(Id)+1 FROM dbo.CategoryForQuery),?,?)', (query_id, category_id))
        conn.commit()
        cursor.execute('SET IDENTITY_INSERT dbo.CategoryForQuery OFF')
        conn.commit()
        return True
    else:
        raise AttributeError('Connection object or Category ID or Query ID                 was not provided')
def add_category_for_query(conn, category_id, query_id):
    if (is_conn(conn) and is_int(category_id) and is_int(query_id)):
        cursor = conn.cursor()
        cursor.execute('SET IDENTITY_INSERT dbo.CategoryForQuery ON')
        conn.commit()
        cursor.execute('INSERT INTO dbo.CategoryForQuery (Id,QueryId,CategoryId)                 VALUES((SELECT max(Id)+1 FROM dbo.CategoryForQuery),?,?)', (query_id, category_id))
        conn.commit()
        cursor.execute('SET IDENTITY_INSERT dbo.CategoryForQuery OFF')
        conn.commit()
        return True
    else:
        raise AttributeError('Connection object or Category ID or Query ID                 was not provided')