In order to shrink the Database, follow the below steps. 1. Take a Full back up of your current database using SSMS (SQL Server Management Studio) 2. Log in as System Administrator (SA). Expand your Databases folder. Right click on
How to replace part of String (SQL Server)
You can simply use Replace in order to replace partial text in SQL Server data table. SELECT REPLACE(YOUR_COLUMN, ‘string_to_replace’, ‘new_string’ * FROM YOUR_Table in order to update the database table. UPDATEYOUR_TABLE SET YOUR_COLUMN = REPLACE(YOUR_COLUMN, ‘string_to_replace’, ‘new_string’) WHERE YOUR_CONDITION Keep smiling and
How to Limit Transaction Log file in SQL Server
There are two ways you can limit the size of your transaction log files. 1. Using SSMS (SQL Server Management Studio) 2. By writing a manual script. Below are the steps to limit transaction log files. Open your Microsoft SQL
How to delete a database with In Recovery mode (SQL Server)
There are situations where sometimes a database is stuck in recovery mode. 1. During the Restore process without running this command – RESTORE DATABASE mydatabase WITH RECOVERY 2. when the drive space is not sufficient and the transaction log size
How to get specific columns and their data types in SQL Server
Please run the below query to get specific details about a table. SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, IS_NULLABLE, CHARACTER_MAXIMUM_LENGTH FROM [DATABASE_NAME].INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N’TABLE_NAME’ Other Database Objects that can be used: – CONSTRAINT_COLUMN_USAGE – CONSTRAINT_TABLE_USAGE – DOMAIN_CONSTRAINTS – DOMAINS –
How to Setup SQL Server 2012 SP3 and SSMS (SQL Server Management Studio) on Windows Server 2012 R2
In order to set up SQL Server 2012 SP3 – I downloaded the files using Microsoft Subscription. Please follow below steps to run the installation. Please make sure to install .Net Framework versions 2.0 and 3.5 from Server Manager. Download
How to solve SMTP Service issue: 5.7.1 Client was not authenticated on Windows 2012 R2
After configuring email server on Windows 2012 R2. There is a possibility that emails might not be sent to addresses outside your domain. When I was using Pickup Directory option to send emails outside our network, I was constantly getting
How to Bulk upload SQL Server Reports (version ssrs 2008 r2)
Recently, I ran into an issue where we have to upgrade our servers to accommodate better hardware. As a part of this migration, one of the task was to upload SSRS reports (rdl) files to the new server. I found
How to enable File Stream on SQL Server Database
For one of my web project, we were asked to implement a functionality for Document upload and let the users upload and store the documents via the site. One of the requirement was to store the document in BLOB format.
How to restore your SQL server database using T-SQL
Hi there, in this post I’ll try to explain you how you can restore a database using SQL script. Before I dig deep, I want to share my experience about why use SQL script when you can do it from