The AddObjectByName method appends the database object named to the list of those objects copied when the Transfer method of the Database object is used to copy database schema or data.
object.AddObjectByName( Object , ObjectType , [ Owner ] )
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list. |
Object | String specifying an existing Microsoft® SQL Server™ database object by name. |
ObjectType | Long integer specifying the type of object named as described in Settings. |
Owner | Optional. String specifying an existing database user by name. When specified, restricts the method to add only an object owned by the user. |
Specify the value of the ObjectType argument by using these values.
Constant | Value | Description |
---|---|---|
SQLDMOObj_Default | 64 | Database object added is a SQL Server default |
SQLDMOObj_Rule | 128 | Database object added is a SQL Server rule |
SQLDMOObj_StoredProcedure | 16 | Database object added is a stored procedure |
SQLDMOObj_Trigger | 256 | Database object added is a trigger |
SQLDMOObj_ UserDefinedDatatype |
1 | Database object added is a SQL Server user-defined data type |
SQLDMOObj_UserTable | 8 | Database object added is a user-defined table |
SQLDMOObj_View | 4 | Database object added is a view |
SQL-DMO implements copying of database schema and data by using the Transfer object and methods implemented on the Database object. The Transfer object is used to define what database objects are affected by the copy and how the copy is performed. Use the AddObject and AddObjectByName methods to add database objects to those affected by the copy.
HRESULT AddObjectByName(
SQLDMO_LPCSTR szObject,
SQLDMO_OBJECT_TYPE ObjectType
SQLDMO_LPCSTR szOwner = NULL);