Return inserted key with stored procedure

Ignition's getKey() infrastructure can only get 32-bit integer keys. Larger integers are truncated to their lower 32 bits, and other types yield NULL. An alternative for many databases is available here:

But note that MS SQL Server always returns a double, which only has fifty-something bits to hold integers.

In your situation, I'd use a stored procedure, called via the stored procedure scripting methods, with a registered output parameter to deliver the SCOPE_IDENTITY.

1 Like