I have the following function
CREATE FUNCTION GetIdentity() RETURNS INT AS
BEGIN
RETURN (IDENT_CURRENT('tblTempPo'))
END
GO
I need to call it with create table
create table tblTempPo
(
ID int null,
BrickVolume AS
(
GetIdentity()
)
)
I’m getting the error
‘GetIdentity’ is not a recognized built-in function name.
How can I solve this?
You need to add
dbo(or whatever the schema name is) to properly call the function:Although, for your example to work, you’d want to do something like this:
The
SELECTstatement will yield the results: