cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for Pre and Post Export SQL queries examples

Highlighted
NiCd Battery
Looking for Pre and Post Export SQL queries examples
Labels (1)
0 Kudos
2 Replies
Highlighted
Linear Actuator

Pre-import SQL
Custom SQL that executes before an import. You can use the {user.name} macro for the Paxata user name. For example, for Microsoft SQL Server, add user impersonation using:

EXECUTE AS user = 'mydomain\${user.name}'

Post-import SQL
Custom SQL that executes after an import. You can use the {user.name} macro for the Paxata user name.
EXECUTE AS user = 'mydomain\${user.name}'

hope that helps, M.

0 Kudos
Highlighted
Linear Actuator
@H369199

A common use for these pre and post queries is to optimize for loading data into an existing table.  In this case, you would use these as follows to avoid the index overhead when inserting rows: 
  • Pre SQL: drop indexes using SQL appropriate for your RDMBS
  • Post SQL: create indexes using SQL appropriate for your RDMBS
You might also want to use Post SQL to update statistics on the table to which you added data in order to ensure performant queries: 
  • SQL Server:  update statistics <tablename>
  • Postgres: analyze <tablename>
Thanks,
Bill
0 Kudos