Many a time we need copies of an object but with different names. I also got a requirement to process the files in parallel using SSIS. We had already implemented the parallelism, but at the entity level. For example, if there are 5 entities such as Customer, Product, Order, Transaction, Balance etc. then we had … Continue reading Script to create copies of the existing object
Tag: Scripts
Divide the rows of a column in equals batches in grid format
I published an article Divide the rows in equals batches few days ago. One of my reader requested me to help him with a requirement to divide a column's data in equal groups and batches in grid format. I came up with a script which accepts the dynamic group size and divides the column data … Continue reading Divide the rows of a column in equals batches in grid format
Divide the rows in equals batches
Here is a simple and practical use-case of the NTILE function. We've used it to divide the rows of sys.columns into N groups. N is the number of groups. We've used the number of groups as 7. So the entire rows will be aligned equally to any of the group between 1 to 7. When … Continue reading Divide the rows in equals batches
Get the month end dates of last N years
Here is a simple T-SQL script that may come handy if you need the month end dates of last N years. N is the number of years. /* Assign the dynamic number of years here. You can write a procedure / table-valued function to accept this value as a parameter. */ DECLARE @Last_N_Years INT = … Continue reading Get the month end dates of last N years
Get the month end dates of last N months
Here is a simple T-SQL script that may come handy if you need the month end dates of last N months. N is the number of months. /* Assign the dynamic number of months here. You can write a procedure / table-valued function to accept this value as a parameter. */ DECLARE @Last_N_Months INT = … Continue reading Get the month end dates of last N months