This user account () has been banned from the forums
Viewing 15 posts - 1 through 15 (of 47 total)
This was removed by the editor as SPAM
April 2, 2025 at 8:04 am
This was removed by the editor as SPAM
April 2, 2025 at 7:41 am
Find below script to generate the shrink all log files in single shot.
DECLARE @dbname VARCHAR(256)
DECLARE @logname VARCHAR(256)
DECLARE @dbcursor CURSOR
SET @dbcursor = CURSOR
FOR
SELECT DB_Name(database_id), [name]
FROM sys.master_files
WHERE [type] = 1
OPEN @dbcursor
FETCH NEXT
FROM...
March 30, 2025 at 8:45 am
Find below script to generate the shrink all log files in single shot.
DECLARE @dbname VARCHAR(256)
DECLARE @logname VARCHAR(256)
DECLARE @dbcursor CURSOR
SET @dbcursor = CURSOR
FOR
SELECT DB_Name(database_id), [name]
FROM sys.master_files
WHERE [type] = 1
OPEN @dbcursor
FETCH NEXT
FROM...
March 30, 2025 at 8:44 am
Find below script to grant execute permission to user to all stored procedure in Databases
---- declare local variables
DECLARE @StoreProcedure VARCHAR(200)
---- User Variable to store the User Id which need the...
March 30, 2025 at 8:35 am
Find below script to grant execute permission to user to all stored procedure in Databases
---- declare local variables
DECLARE @StoreProcedure VARCHAR(200)
---- User Variable to store the User Id which need the...
March 30, 2025 at 8:34 am
Find below backup history.
Select T2.type, T2.is_copy_only, physical_device_name, user_name, database_name, server_name, backup_start_date, backup_finish_date, backup_size, DATEDIFF(MINUTE, backup_start_date, backup_finish_date) AS Total_Minutes
--DATEDIFF(HOUR, backup_start_date, backup_finish_date)
from msdb..backupmediafamily T1, msdb..backupset T2
where T1.media_set_id = T2.media_set_id
and T2.backup_start_date > getdate()...
March 6, 2025 at 1:47 pm
Find below backup script take backup on specific DB and will create the folder.
--Create target folder having +7 date
Declare @targetdate datetime = getdate() + 14
Declare @location nvarchar(3000) ='\\Servername\DB_Backup' + convert(nvarchar(10),@targetdate,112)...
March 6, 2025 at 1:45 pm
Find below backup script take backup on specific DB and will create the folder.
--Create target folder having +7 date
Declare @targetdate datetime = getdate() + 14
Declare @location nvarchar(3000) ='\\Servername\DB_Backup' + convert(nvarchar(10),@targetdate,112)...
March 6, 2025 at 1:41 pm
Find below script will help to get mdf & ldf file size and backup file size also.
USE MASTER
Go
SELECT @@SERVERNAME Servername,
CONVERT(VARCHAR(25), DB.name) AS dbName,
CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
(SELECT COUNT(1) FROM sysaltfiles...
March 6, 2025 at 1:39 pm
Find below script will help to get mdf & ldf file size and backup file size also.
USE MASTER
Go
SELECT @@SERVERNAME Servername,
CONVERT(VARCHAR(25), DB.name) AS dbName,
CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
(SELECT COUNT(1) FROM sysaltfiles...
March 6, 2025 at 1:37 pm
Thank you for suggestion. Could you please share the script if you have . That will help for me.
Thank you in Advanced !!
March 4, 2025 at 6:08 am
Find below script will help for fix the orphan users for all DB's.
Fix Orphan users in all databases
SET NOCOUNT ON
BEGIN
declare @UserName sysname
declare @NoOfUsers smallint
declare @dbname varchar(50)
declare @query varchar(2000)
declare @query_1 varchar(2000)
CREATE...
March 4, 2025 at 5:54 am
Find below script will help for fix the orphan users for all DB's.
Fix Orphan users in all databases
SET NOCOUNT ON
BEGIN
declare @UserName sysname
declare @NoOfUsers smallint
declare @dbname varchar(50)
declare @query varchar(2000)
declare @query_1 varchar(2000)
CREATE...
March 4, 2025 at 5:54 am
Viewing 15 posts - 1 through 15 (of 47 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy