Issue You have a database in MS SQL that is tagged as (suspect) and you are unable to connect to the database. Possible Causes The database could have become corrupted. There is not enough space available for the SQL Server to recover the database during startup. The database cannot be opened due to inaccessible files… Continue reading How to repair a suspect DB in MSSQL
This Script will allow you to backup all dbs in the fly. the script looks for .mdf file in your sql instance and back all of the files it find except the system databases … Job done !
**THIS IS A REPOST** SharePoint 2013 has introduced significant enhancements in how file content is stored and retrieved in the database. Specifically, files are now split into many parts (“Shredded”) and stored in individual rows in the content database. This is related to the Cell Storage API introduced in 2010 that support(s/ed) things like co-authoring… Continue reading SharePoint 2013 Shredded Storage vs. RBS
Well, technically it is possible to shrink a mirrored LOG. What is doing trouble is to backup log with truncate_only. Mirroring doesn’t accept it. So one way is to perform a backup log to disk: USE [DATABASE_NAME]; BACKUP DATABASE [DATABASE_NAME] TO DISK=’E:\Backup\DATABASE_NAME_FULL.bak’ WITH FORMAT; CHECKPOINT; WAITFOR DELAY ’00:00:02′; BACKUP LOG [DATABASE_NAME] TO DISK = ‘E:\Backup\DATABASE_NAME_TL.trn’;… Continue reading Shrinking the transaction log of a mirrored SQL Server 2014 database
Many a times we may need to get the Time, Hour, Minute, Second and Millisecond Part from DateTime in Sql Server. In this article we will see how we can get these parts of the DateTime in Sql Server. You may like to read the other popular articles on Date and Time: How to get… Continue reading How to get Time, Hour, Minute, Second and Millisecond Part from DateTime in Sql Server
I have a table of students: id | age ——– 0 | 25 1 | 25 2 | 23 I want to query for all students, and an additional column that counts how many students are of the same age: id | age | count —————- 0 | 25 | 2 1 | 25 |… Continue reading Count occurrences of a column value efficiently in SQL
how to get the middle string you need something like that declare @text varchar(64) set @text = ‘123|456|798’ SELECT SUBSTRING(@text,CHARINDEX(‘|’, @text) + 1,LEN(@text) – CHARINDEX(‘|’, @text) – CHARINDEX(‘|’, REVERSE(@text)) )