Navigation:  Advantage SQL > System Procedures > Procedures >

sp_MoveDDObjectFile

Advantage SQL Engine

Previous pageReturn to chapter overviewNext page

Moves the physical file or files associated with a dictionary object.

Syntax

sp_MoveDDObjectFile(

ObjectType,Integer;

ObjectName,Character,200,

NewFilePath,Character,260,

IndexFiles,MEMO,

Parent,Character,260,

Options,Integer )

 

Parameters

ObjectType (I)

Object type of the object to move. Only ADS_DD_TABLE_OBJECT and ADS_DD_INDEX_FILE_OBJECT are supported at this time.

ObjectName (I)

Name of the object to move.

NewFilePath (I)

Fully qualified path to move the object file(s) to.

IndexFiles (I)

List of index files to move with a table file. Only used with table objects.

Parent (I)

Name of parent object. Name of Only used with index file objects.

Options (I)

Must be zero. Reserved for future use.

Remarks

sp_MoveDDObjectFile can be used to move a database object's file or associated files to a new location on the server. If ObjectType is 1 (ADS_DD_TABLE_OBJECT), ObjectName must be the database object name of a table. To move a table's index files along with the table, IndexFiles must contain a semicolon-delimited list of the index file's database object names (filename plus extension).

If ObjectType is 3 (ADS_DD_INDEX_FILE_OBJECT), ObjectName must be the database object name of an index file (filename plus extension). IndexFiles will be ignored, but the Parent must be the database object name of the index file's table.

Note The destination directory specified by NewFilePath must exist prior to calling sp_MoveDDObjectFile.

 

Note ALTER TABLE permissions are required to move a table or a table's index file.

 

Note This function can be called inside a transaction, but will not be part of the transaction. Any changes it makes cannot be rolled back.

Examples

EXECUTE PROCEDURE sp_MoveDDObjectFile( 1 /* ADS_DD_TABLE_OBJECT */, 'customers', '\\adsserver\data\newdirectory', 'business_ID.adi;business_name.adi', NULL, 0 )

EXECUTE PROCEDURE sp_MoveDDObjectFile( 3 /* ADS_DD_INDEX_FILE_OBJECT */, 'business_ID.adi', '\\adsserver\data\newdirectory', NULL, 'customers', 0 )

See Also

sp_RenameDDObject