using sql server, in azure.
a requested a stored procedure to return a next number from a developer.
This is what they returned.
BEGIN
exec ('
SELECT
(
SELECT FORMAT(getdate(),agencyFormat) FROM [dbo].[tblCardNextNum] WHERE agencyID = '+@agencyID+' and type = '''+@type+''') +
FORMAT(NEXT VALUE FOR [dbo].['+@agencyShort+'],
(
SELECT REPLICATE(''0'',
(
SELECT [agencyMaxLength] FROM [dbo].[tblCardNextNum] WHERE agencyID = '+@agencyID+' and type = '''+@type+'''
)
)
)
)
')
END
Now when i execute the stored proc in ssms, it will display the next number, but it will not return anything, just will display it.
So my question is....
what do i add to this stored procedure to actually return the newly created number to the calling function?
To those that are asking about the calling of this stored procedure...
EXEC [dbo].[GetCrudAgencyNextNum]
@agencyShort = N'PLFD',
@agencyID = 2,
@type = N'C'
small screen shot
and no, this is NOT a duplicate of the MVC solution - i looked.
my question is.. what do i add to this stored procedure to return the value.