GetObjectByName Method

SQLServer.Database Object

Description

Returns a DBObject object that contains the specified SQL Server object.

Visual Basic

DBObject = Database.GetObjectByName (
[ObjectName :=] idSQLObject,
[[ObjectType :=] tObjectType] )

C++

HRESULT pDatabase->GetObjectByName (
SQLOLE_LPCSTR
idSQLObject,
LPSQLOLEDBOBJECT*
ppDBObject,
SQLOLE_OBJECT_TYPE
tObjectType =
SQLOLEObj_AllDatabaseObjects );

Elements

Element Type Description

DBObject DBObject Returned DBObject object
idSQLObject Identifier Name of SQL Server object to return
tObjectType SQLOLE_OBJECT_TYPE Type of object. If you do not know the object type, SQL-DMO must query the server to determine it. If you pass it in, this overhead is not required.