
Resize Your TempDB in SQL
You can resize the tempdb temporary database in SQL by using the ALTER DATABASE command, as shown below: ALTER DATABASE tempdbMODIFY FILE (Name = tempdb_data, filesize = 100MB),MODIFY FILE (NAME

You can resize the tempdb temporary database in SQL by using the ALTER DATABASE command, as shown below: ALTER DATABASE tempdbMODIFY FILE (Name = tempdb_data, filesize = 100MB),MODIFY FILE (NAME

You can get the language ID with the following Select statement: SET LANGUAGE ‘French’SELECT @@LANGID AS ‘Language ID’

You can write results of a SELECT query into a text file in the following way: master..xp_cmdshell ‘osql -S SERVERNAME -U USERNAME -P PASSWORD -Q “SELECT * FROM TABLE” -d

One good way to quickly diagnose System slowdowns is to make use of the sp_who2 SQL function in the following way: EXEC sp_who2 This helps identify High CPU Usage, Blocking

You can identify tables that store a GUID (Globally Unique Identifier) value with the following script: SELECT [table] = s.name + N’.’ + t.nameFROM sys.tables AS tINNER JOIN sys.schemas AS

Using sys.dm_db_missing_index_group_stats?returns summary information about groups of missing indexes, excluding spatial indexes. An example follows: SELECT TOP 5 * FROM sys.dm_db_missing_index_group_stats ORDER BY avg_total_user_cost * avg_user_impact * (user_seeks + user_scans)

The DATALENGTH SQL returns the length of columns in a table. SELECT length = DATALENGTH(ColumnName) FROM TableName ORDER BY ColumnName

SQL Server automatically loads the data it needs to work with into its cache. This is called pages. These data pages stay in SQL Server’s cache until there is no

Compress: Compresses input data and returns the binary data of type VARBINARY(MAX) Decompress: Decompresses compressed input binary data and returns the binary data of type VARBINARY(MAX) Here is small example