|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Checking Identities | |
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? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
Changing the Recovery Time I want to change the recovery time for a database running on SQL Server 2022. What are my options for setting the value in my ALTER DATABASE statement. If I run this code, what can I use in place of the xxx to define what 12 means? ALTER DATABASE Finance SET TARGET_RECOVERY_TIME = 12 xxx; Answer: You must enter "Seconds" or "Minutes" for xxx Explanation: This is a required parameter. Either "Seconds" or "Minutes" must be entered after the scalar value. Ref: Change the target recovery time of a database - https://learn.microsoft.com/en-us/sql/relational-databases/logs/change-the-target-recovery-time-of-a-database-sql-server?view=sql-server-ver17 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2016 - Administration |
how to get notification that my database has corssed 8gb - i have sqlexpress on rds, is there any way i can get notifacation that my datatbas has crossed 8gb? |
SQL Server 2019 - Administration |
statistics callection intervel in query store ? - Statistics Collection Interval: Defines the level of granularity for the collected runtime statistic, expressed in minutes. The default is 60 minutes. Consider using a lower value if you require finer granularity or less time to detect and mitigate issues. Keep in mind that the value directly affects the size of Query Store data. Use SQL […] |
SQL Server 2019 - Development |
Is there a way for SP to know who called it? - Hi everyone I am writing an SP where there is logic inside the SP that depends how the SP was called. For example, Start of SP ....code.... If SSIS called SP then do A else do B .... code .... End of SP Is there a way for SP to know who asked it to […] |
Editorials |
All the Costs of Downtime - Comments posted to this topic are about the item All the Costs of Downtime |
Planning for tomorrow, today - database migrations - Comments posted to this topic are about the item Planning for tomorrow, today - database migrations |
Remembering Phil Factor - Comments posted to this topic are about the item Remembering Phil Factor |
Article Discussions by Author |
Single User SQL Server on Linux - Comments posted to this topic are about the item Single User SQL Server on Linux |
How Well Does the MSSQL Extension in VSCode Work? - Comments posted to this topic are about the item How Well Does the MSSQL Extension in VSCode Work? |
The Tightly Linked View - Comments posted to this topic are about the item The Tightly Linked View |
Build a Test Lab of SQL Server 2025 on Windows Server 2025 using Hyper-V Virtual Machines - Comments posted to this topic are about the item Build a Test Lab of SQL Server 2025 on Windows Server 2025 using Hyper-V Virtual Machines |
SQL Server, Heaps and Fragmentation - Comments posted to this topic are about the item SQL Server, Heaps and Fragmentation |
Stairway to Azure SQL Hyperscale – Level 2: Page Server Architecture Explained - Comments posted to this topic are about the item Stairway to Azure SQL Hyperscale – Level 2: Page Server Architecture Explained |
SQL Server 2022 - Administration |
Bottlenecks on SQL Server performance - We have a BI-application that connects to input tables on a SQL Server 2022 Standard edition. This is installed on a Windows Server 2022 in Azure with the size Standard E32s v5, having 32 vCPUs, 256 GB RAM, 32 data disks and 51200 max IOPS. The SQL Server is used for reading, updating and writing […] |
SQL Server 2022 - Development |
Is there some good routines for updating SQL Server database objects with GitHub - At work we've been getting better at writing what's known as GitHub Actions (workflows, YAML). I've got it deploying applications to websites, etc. It is cool. One thing users would like to have is a means of deploying updates to SQL Server database objects using GitHub Actions. I've thought about this and have come up […] |
Rounding Off issue in SQL Server - I am using Microsoft SQL Server 2022 (RTM-CU17) (KB5048038) - 16.0.4175.1 (X64) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Facing issue in rounding off where this query is retuning 0.0000170000 instead of 0.00001672. Actual datatype is numeric(28,8), tried increasing precision - changing data type (which i cannot do in production) to […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |