Sunday, January 19, 2020

Query to list number of records in each table in a database

Hi Friend,

Using the below query you can get all rows, indexName, etc you can change the query according to your need.

SELECT 
    t.NAME AS TableName,
    i.name as indexName,
    p.[Rows],
    sum(a.total_pages) as TotalPages, 
    sum(a.used_pages) as UsedPages, 
    sum(a.data_pages) as DataPages,
    (sum(a.total_pages) * 8) / 1024 as TotalSpaceMB, 
    (sum(a.used_pages) * 8) / 1024 as UsedSpaceMB, 
    (sum(a.data_pages) * 8) / 1024 as DataSpaceMB
FROM 
    sys.tables t
INNER JOIN      
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN 
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN 
    sys.allocation_units a ON p.partition_id = a.container_id
WHERE 
    t.NAME NOT LIKE 'dt%' AND
    i.OBJECT_ID > 255 AND   
    i.index_id <= 1
GROUP BY 
    t.NAME, i.object_id, i.index_id, i.name, p.[Rows]
ORDER BY 
    object_name(i.object_id) 

If you want only table name and records then go with the below query.
SELECT t.NAME TableName, i.ROWS Records
FROM sysobjects t, sysindexes i
WHERE t.xtype = 'U' and i.id = t.id and i.indid in (0,1)
order by TableName;

The result areas above.

Thank you for your valuable time keep in touch.

Tuesday, January 14, 2020

vendor.bundle.js size is around 10 MB when we deployed angular 6 project.

Hi All,

when you are new in angular so this is the correct place for you here we will learn how to deploy our angular project.

1st used

ng build

ng build --prod --aot

ng build --prod --aot --vendor-chunk --common-chunk --delete-output-path --buildOptimizer


Thank you Hope it is useful for you.

wagah border (entertainment)

Hi Friend ,

Today i am upload videos from wagah boarder.




Tuesday, January 7, 2020

How to enable developer mode windows 10?

If you want to activate developer mode in window 10 you are in the correct place.

Let's start

Go to Windows Settings



When you click on settings the below window is open.

Click on the "update and security" tab the below screen see than click on "For developers" tab Than you can able to see all mode.
Thank you hope it helps you .

TypeScript: sleep a thread

Hi All,

Today i am stuck in one functionality so using the thread in typescript i a solve it so thing share Knowledge to all people.

Sometimes you see within the second your method code is executed and you not understand how to stop our method so the simple idea is to use thread.

If we need to sleep e thread, we can implements a delay method that returns a Promise object (which represents the eventual completion, or failure, of an asynchronous operation, and its resulting value) and through the setTimeout method (that sets a timer which executes a function or specified piece of code once after the timer expires) resolve the Promise.

private delay(ms: number)
{
  return new Promise(resolve => setTimeout(resolve, ms));
}


Now we can call the delay method where we need to sleep the thread. To call the delay function we have to use the keyword await, so we must declare the method where we will make the call as async.

async downloadMyFile(id: number) {
    this.isLoadingSpring = true;
    const link = document.createElement('a');
    link.setAttribute('target', '_blank');
    link.setAttribute('href', '/assets/files/' + id + '/Year-Book.pdf');
    await link.setAttribute('download', 'Year-Book.pdf');
    document.body.appendChild(link);
    link.click();
    link.remove();
    await this.delay(3000);
    this.isLoadingSpring = false;
  }


Thank you for your valuable time hope it will help you