I have a problem where I can't my sp to return me the correct value.
the sp code is:
CREATE PROCEDURE getKeyField
@tableRef NVARCHAR(128),
@keyField NVARCHAR(128) = NULL OUTPUT
AS
SELECT @keyField = constraint_name FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS (NOLOCK) WHERE TABLE_NAME = tableRef AND CONSTRAINT_TYPE = 'PRIMARY KEY'
***************
If run the sp from Query Analyser, it works, but not from the asp.net web pages.
The output parameter always returns null.
Does anyone have any idea?
Thanks,
Eka