Data can be exported from an InMemory Database format to SQL Server using the EXPORT command.
Syntax:
EXPORT {destination data source}.[Destination Table Name] from {source data source}.[Source Table Name]
Example:
EXPORT a1.orders FROM me.orders
Adding WITH TRUNCATE forces truncation of the existing table before export.
Example:
EXPORT with TRUNCATE a1.orders FROM me.orders
To help prevent accidental deletion of data, it is necessary to run the command ALLOW TRUNCATE on the
target data source before using the command.
allow truncate on a1
Adding WITH DROP forces dropping of the existing table before export.
Example:
EXPORT WITH DROP a1.orders FROM me.orders
To help prevent accidental deletion of data, it is necessary to run the command WITH DROP, run the
command ALLOW DROP on the target data source before using the command.
Example:
ALLOW DROP ON a1
Complete Example:
DATASOURCE db1=local targitdb 'c:\databases\data\northwind.targitdb'
DATASOURCE a1=SQLSERVER 'Data Source=localhost;Initial Catalog=ir_export_test;User
Id=ir;Password=mypassword;'
slurp db1
allow drop on [a1]
export with drop a1.orders from me.orders
export with drop a1.[order details] from me.[order details]
export with drop a1.[customer] from me.[customers]
export with drop a1.[employees] from me.[employees]
export with drop a1.[Products] from me.[products]
export with drop a1.[shippers] from me.[shippers]
export with drop a1.[suppliers] from me.[suppliers]
Comments
Please sign in to leave a comment.