Wednesday, April 12, 2023

MS-SQL Server - Fast & SSIS

Fast & SSIS


Today we will learn how can things be faster than standard process. There are some other ways to complete the task quickly.


- Fast way to shrink database
There are different aspects to consider while shrinking
     a) Data Files - We must run Index Maintenance before shrinking data file. Also need to analyse total free space out of which maximum 5 GB in one Go.
     b) Log Files - We must take backup before shrinking log file. Re-Size again is also recommended to reduce the number of VLFs as there are some environments where initial size of Log file is large.
    
- Fast way to delete records
Use Truncate instead of delete.

- Fast Insert
Use BCP

- Fast Index Maintenance
Switch to Bulk Logged Recovery Model and revert.

- Fast way to create duplicate table.
--T-SQL
Select * into YourNewTableName from ExistingTable where 1=1


SSIS

SQL Server Integration Services helps to Develop data transfer packages.

https://learn.microsoft.com/en-us/sql/integration-services/sql-server-integration-services?view=sql-server-ver16


TRIM

https://learn.microsoft.com/en-us/sql/t-sql/functions/trim-transact-sql?view=sql-server-ver16


Additionally,

LATCHES

https://learn.microsoft.com/en-us/sql/relational-databases/diagnose-resolve-latch-contention?view=sql-server-ver16


Best Regards


T. Amit Vaid S.

No comments: