This user account () has been banned from the forums

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 47 total)

  • Reply To: Performance Tuning with SQL Server 2014 Standard

    This was removed by the editor as SPAM

  • Reply To: Super long running queries (bad users)

    This was removed by the editor as SPAM

  • Reply To: 100% CPU for long periods

    This was removed by the editor as SPAM

  • Reply To: Shrink Database Log Files One by One

    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...

  • Reply To: Shrink Database Log Files One by One

    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...

  • Reply To: GRANT EXECUTE for ALL stored procedures to User/Group

    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...

  • Reply To: GRANT EXECUTE for ALL stored procedures to User/Group

    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...

  • Reply To: Viewing backup history with T-SQL

    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()...

  • Reply To: SQL SCript for Backup Compression

    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)...

  • Reply To: SQL SCript for Backup Compression

    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)...

  • Reply To: Check .mdf and .ldf file size using T-SQL

    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...

  • Reply To: Check .mdf and .ldf file size using T-SQL

    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...

  • Reply To: Fix orphaned users after restoring database to another server.

    Thank you for suggestion. Could you please share the script if you have . That will help for me.

    Thank you in Advanced !!

  • Reply To: Orphan users fpr all user databases

    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...

  • Reply To: Orphan users fpr all user databases

    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...

Viewing 15 posts - 1 through 15 (of 47 total)