Jump to content
  • Clearing SQL database with Scribe


    Manoj Chaurasia

    Question:
    Recently working on a migration project using Scribe, we load big volumes of testdata in SQL staging tables, but when we want to clear the tables it takes a very long time to clear all records for reloading data.

    Is there a quicker way to clear a SQL database table using Scribe without deleting records one by one?

    Answer:
     

    1) With the Scribe Microsoft SQL Server Connector:

    Use the "Native Query" Block with a double SQL statement and add "for each result Block", make sure you test and validate your native query and save your map.



    SELECT  1 AS One;

    DELETE FROM [dbo].[mytablename];

    2) Alternatively, you can use storedprocedures(to clear the data faster) and call/trigger them from a Scribe map using 

    Scribelabs Tools connector Query block to trigger one scribe run with current timestamp then call the storedprocedure once. 

    See Scribe Tools Connector documentation here: https://support.tibco.com/s/article/Scribe-Labs-Tools  

    See SQL Server Connector documentation on using Storedprocedures: https://help.scribesoft.com/scribe/en/index.htm#sol/conn/sqlserver.htm


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...