I want to call SCOPE_IDENTITY() within a parameterized query
I know using the statement works in SQL, and I know I can do it if I don't use a parameterized query.
insert_stmt = 'INSERT INTO [some_table] ([value_1], [value_2], [value_3], [value_4]) VALUES ( ?, ?, ?, ? )'
insert_values = [some_varchar_1, some_int_2, SCOPE_IDENTITY(), some_varchar_4]
with cnxn:
cursor.execute(insert_stmt, insert_values)
I expect the function to execute on the server to correctly populate that value