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_…
Here is the simple query that generates a calendar. 1: DECLARE @startDay DATE = ' 20110101 ' 2: ,@endDay DATE = ' 20130101 ' 3: 4: ; WITH calendar ( [ Date ], [ Y…
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 …
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: …
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…