The ST_BdPolyFromWKB function is equivalent to the following:
CREATE FUNCTION DBO.ST_BdPolyFromWKB( awkb LONG BINARY, srid INT DEFAULT 0 )
DECLARE mls ST_MultiLineString;
SET mls = NEW ST_MultiLineString( awkb, srid );
RETURN NEW ST_Polygon( mls );
The ST_BdPolyFromWKB function is not present by default in newly created databases.
Use the sa_install_feature system procedure to install the spatial SQL compatibility functions. See sa_install_feature system procedure.