Restore Server/Database users/roles
Restore server/database users and roles from another server when we are restoring databases to another server.
2012-04-12 (first published: 2007-10-23)
3,111 reads
Restore server/database users and roles from another server when we are restoring databases to another server.
2012-04-12 (first published: 2007-10-23)
3,111 reads
This script was designed to restore a backup of a SQL Server 2000 database from disk file to SQL Server 2005.Unfortunatelly the RESTORE will leave land mines for you to find the hard way, this script was updated to fix all that I have found:Change CONCAT_NULL_YIELDS_NULL ON, PAGE_VERIFY CHECKSUM, Compatibility level to 90, remove the […]
2007-09-14
4,522 reads
2011-06-01 (first published: 2007-09-02)
10,468 reads
A quick procedure to check which full recovery databases have not had a tran log backup in the given period (default is 7 days). This could mean that the recovery mode might need changing or the transaction log backup jobs need investigating.
2011-09-22 (first published: 2007-08-03)
1,708 reads
This procedure is used to shrink the databases. Many times we use shrink option to shrink the databases for backup. and we do it N number of times, when we take the back of databses or make free space of drive.instructions:- Follwo the step.1. run script.2. And execute the statement, exec shrink_databasesI m new, if […]
2007-06-27
793 reads
This script was written to solve a problem where we needed to dynamically create bch files for Veritas Backups direct to tape backups. We needed to parse the sysdatabases daily and create the bch files that veritas would use to backup each server and database. This SQL Script uses xp_cmdshell to call a windows shell […]
2007-10-02 (first published: 2007-06-18)
453 reads
The following script performs log, differential or full backups of a single, or all databases on your SQL Server. It then copies or moves the file(s) over to a network share drive. It also removes old backups from both locations if needed. Don't forget to set the local drive path and network share for each […]
2007-09-14 (first published: 2007-05-16)
19,156 reads
A simple script to find the database recovery model. Cut & paste into Query Analyser
2007-05-17 (first published: 2007-05-08)
2,973 reads
This is just a quick method to determine the backup mode of all databases on a server. No cursor involed.
2007-05-18 (first published: 2007-05-07)
425 reads
2007-04-27 (first published: 2007-04-03)
1,288 reads
By Steve Jones
Fear is fueled by a lack of imagination. The antidote to fear is not...
The slidedeck and the SQL scripts for the session Indexing for Dummies can be...
By Chris Yates
Change is not a disruption in technology; it is the rhythm. New frameworks appear,...
Comments posted to this topic are about the item Building AI Governance and Policies-...
Why is sql doing a full scan VS seeking on the index? I've included...
We have a report that has multiple tables that list the top 15 performers...
The DBCC CHECKIDENT command is used when working with identity values. I have a table with 10 rows in it that looks like this:
TravelLogID CityID StartDate EndDate 1 1 2025-01-11 2025-01-16 2 2 2025-01-11 2025-01-16 3 3 2025-01-11 2025-01-16 4 4 2025-01-11 2025-01-16 5 5 2025-01-11 2025-01-16 6 6 2025-01-11 2025-01-16 7 7 2025-01-11 2025-01-16 8 8 2025-01-11 2025-01-16 9 9 2025-01-11 2025-01-16 10 10 2025-01-11 2025-01-16The docs for DBCC CHECKIDENT say this if I run with only the table parameter: "If the current identity value for a table is less than the maximum identity value stored in the identity column, it is reset using the maximum value in the identity column. " I run this code:
DELETE dbo.TravelLog WHERE TravelLogID >= 9 GO DBCC CHECKIDENT(TravelLog, RESEED) GO INSERT dbo.TravelLog ( CityID, StartDate, EndDate ) VALUES (4, '2025-09-14', '2025-09-17') GOWhat is the identity value for the new row inserted by the insert statement above? See possible answers