Transfer or Restore Logins to New Server
Not my script, but this script will transfer the logins to a new server or help you restore the in a DR situation with their correct passwords (encrypted).
2003-11-03
1,150 reads
Not my script, but this script will transfer the logins to a new server or help you restore the in a DR situation with their correct passwords (encrypted).
2003-11-03
1,150 reads
This script Notifies the user(s) whenever there is an Error logged in the Error message. It excludes the Error messages 15457 and 1073759806. These 2 Errors can be ignored. (I know we like to keep our Elogs clean but for some time you need to yield to them J ). You’ll see the first error […]
2003-10-30
1,205 reads
This script will join a single selected column from a select statement into a varchar variable. This works similarly to the javascript join function with a few additional features. By default the values will be joined with commas unless an alternate delimiter is supplied. The user can specify if the delimited values should quoted. To […]
2003-10-30
523 reads
MSSQLServer has got sp_depends system sp to display the dependencies for a stored procedure, table and view. sp_depends does not support to display the User-defined data type dependencies. For custom database, we will create user defined data types (UDDT) and add this UDDT to a column/variable in a table/stored procedure. This sp (UDTDepends) will help […]
2003-10-30
454 reads
This sp is used to update index in a database. This sp has got three optional varchar parameters. First parameter will take the tablename. Second parameter will take the indexname. Third parameter will take the fillfactor. The following option we can execute the sp in a user database.1. exec StabilizeIndexIt will update all index in […]
2003-10-29
283 reads
This script allows for testing if rows will cause a primary key violations prior to inserting the data. Offending rows are stored in a table so they can be used in subsequent queries or used to debug bad data issues. This updated version adds a timestamp to the duplicates table so that identifying when the […]
2003-10-28
1,825 reads
Stored procedure that return range of data from any table without using temp table or cursors. You don't even need to use the IDENTITY field in your target table. Check out and comments are welcomed
2003-10-27
286 reads
Provides a method to regularly recycle the sql server error logs based on a given file size. If the current log file is larger than that size, then the current log is closed and a new log created.This proc takes one parameter, @MaxFileSize, which is the target file size. This parameter defaults to 10 MB. […]
2003-10-27
921 reads
It creates documentation for all user tables in a specific database. A server name/ database name was added on the top of the HTML file also a column datatype field was added to the HTML file. Now the @strHTML can have 8000 chars, before only 4000 - still for tables with a lot of columns […]
2003-10-27
654 reads
Sound like old hat ... but this procedure accepts the two database names as input parameters; therefore, it must dynamically generate the SQL and use Exec(@command) to execute it. It also reports on tables that exist in one database but not the other ... Finally, it uses count(*) to provide more accuracy than using sysindex […]
2003-10-24
295 reads
By Chris Yates
Change is not a disruption in technology; it is the rhythm. New frameworks appear,...
No Scooby-Doo story is complete without footprints leading to a hidden passage. In SQL...
By James Serra
A bunch of new features for Microsoft Fabric were announced at the Microsoft Fabric Community...
Comments posted to this topic are about the item Checking Identities
We’re running SQL Server 2019 with database compatibility level 150, and after recent tuning...
Comments posted to this topic are about the item Changing the Recovery Time
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