Estimating the Size of Backup Files

How to estimate the next backup size? When we want to estimate the next backup size we can use the following stored procedure which gives some information about the backup size. The reserved column value approximately gives information about size of uncompressed backup size. Reserved column defines the database size which consists of data and... » read more

.BAK File Size vs Actual Database File Size

The space was allocated to the database files, but not used. You can create a new database, make it 10GB in size, and see the files allocate that amount of space on disk. However, until you put data in the database, the file is essentially empty, and your backup file size will be minimal. For... » read more

Check and Reset Table Identity

Checks the current identity value for the specified table and, if it’s needed, changes the identity value. You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column. Examples A. Resetting the current identity value, if it’s needed The following example resets the current identity value, if it’s... » read more

Installing SQL Server 2017 Reporting Services

With SQL Server 2017, Reporting Services is a separate install. Download install from Microsoft site. https://www.microsoft.com/en-us/download/confirmation.aspx?id=55252 After you have installed it, you will need to configure it via Report Server Configuration Manager. Once configured, you will be able to access SSRS via link http://server01/ReportServer.

SQL Server Named Pipes

After SQL Server install, need to enable Named Pipes in order to be accessible from SQL Server Management Studio. Go to SQL Server Configuration Manager to enable Named Pipes and TCP/IP. Also need to restart services.

Create SQL Login Account Script

sp_change_users_login Maps an existing database user to a SQL Server login.  Syntax Arguments [ @Action= ] ‘action‘Describes the action to be performed by the procedure. action is varchar(10). action can have one of the following values. Value Description Auto_Fix Links a user entry in the sys.database_principals system catalog view in the current database to a SQL Server login of the... » read more

Create Database Script

Example 1 Example 2 Make sure the following folders are created already. C:\MSSQL\MyDatabase01\Data C:\MSSQL\MyDatabase01\Log Result: C:\MSSQL\MyDatabase01\Data\MyDatabase01.mdf C:\MSSQL\MyDatabase01\Data\fgData_01.ndf C:\MSSQL\MyDatabase01\Data\fgIdx_01.ndf C:\MSSQL\MyDatabase01\Log\MyDatabase01Log_01.ldf

int, bigint, smallint, and tinyint in SQL Server

Data type Range Storage bigint -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807) 8 Bytes int -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647) 4 Bytes smallint -2^15 (-32,768) to 2^15-1 (32,767) 2 Bytes tinyint 0 to 255 1 Byte Sources: https://docs.microsoft.com/en-us/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-2017