-->

Table Size in SQL Server | Find Rows and Disk space Usage

There are two ways to find out the table size; first option will be to run the system stored procedure “sp_spaceUsed” 1: EXEC sp_SpaceUsed ' table_name ' Option 2 uses the dmv sys.dm_…

Generating Calendar in SQL Server 2008

Here is the simple query that generates a calendar. 1: DECLARE @startDay DATE = ' 20110101 ' 2: ,@endDay DATE = ' 20130101 ' 3: 4: ; WITH calendar ( [ Date ], [ Y…

Is TRUNCATE TABLE transactional ?

1: CREATE TABLE tTest ( i INT ) 2: INSERT tTest ( i ) VALUES ( 1 ) 3: INSERT tTest ( i ) VALUES ( 1 ) 4: INSERT tTest ( i ) VALUES ( 1 ) 5: INSERT tTest ( i ) VALUES ( 1 ) 6: 7: BEGIN …

How to remove blank line in SSMS “Find and Replace” dialogue

The answer is simple; in Management Studio go into Find and Replace (ctrl+H ) , in "Find Options" check "Use" and select "Regular Expressions". Now, in the Find what: …

How to find relationship between tables

As a DBA or even as a SQL Server Programmer, we may need a quick script to find relationship  between tables. Here is the script which helped me a lot, hope this will be useful for you too 1: SEL…
Subscribe Our Newsletter