|
|
|
|
|
|
|
|
| Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Restoring On Top II | |
I have a database, DNRTest, that has a number of tables and other objects in it. The other day, I was trying to mock up a test and ran this code on the same server:
-- run yesterday CREATE DATABASE DNRTest2 GO USE DNRTest2 GO CREATE TABLE NewTable (id INT) GOToday, I realize that I need a copy of DNRTest for another mockup, and I run this: -- run today USE Master BACKUP DATABASE DNRTest TO DISK = 'dnrtest.bak' GO RESTORE DATABASE DNRTest2 FROM DISK = 'dnrtest.bak' WITH REPLACEWhat happens? | |
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) |
Upgrading Admin Queries I have a query from a former DBA that we run on SQL Server 2025 to check on database metadata. This query references sys.sysaltfiles. I want to refactor this code to be more modern. Which DMV should I reference instead?
Answer: sys.master_files Explanation: sys.master_files is the DMV to reference instead for this information. Ref: Mapping System Tables to System Views - https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/mapping-system-tables-to-system-views-transact-sql?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 2019 - Administration |
| Can an Azure App Service Managed Identity be used for SQL Login? - I'm fairly certain I know the answer to this from digging into it yesterday, but would like a second opinion. We're (finally) moving some applications to cloud-native, using Azure App Services and the developer would like to, if possible, use a Managed Identity and Key Vault for the application to connect to the SQL Server […] |
| SQL Server 2019 - Development |
| how to write this query? - hi everyone I am not sure how to write the query that will produce the expected results. Basically, I need to convert data found in columns and put them into rows. I have provided sample data and screenshot of expected result. Can someone please help me with this? Thank you Sample Data drop table if […] |
| SQL Azure - Administration |
| Azure Synapse database refresh - Hi Team, I am trying to refresh the Azure Synapse Dedicated pool from production to lower environment. Is there a standard documented process which we can follow similar to Azure SQL database. I have searched in various forums but none of them were worked in our environment due to policy restrictions. Please do the needful. […] |
| Editorials |
| I'm thinking about submitting some articles - I've written some documentation on using different Markdown types of files on GitHub. It's a series of documents. Some of them are long, but others are short. Anyway, what I don't know is if I should just submit them as separate articles or if they would qualify as a Stairway. Would someone with SQL Server […] |
| Not Just an Upgrade - Comments posted to this topic are about the item Not Just an Upgrade |
| Why End-User Testing Is Even More Important with AI - Comments posted to this topic are about the item Why End-User Testing Is Even More Important with AI |
| Writing as an Art and a Job - Comments posted to this topic are about the item Writing as an Art and a Job |
| Rollback vs. Roll Forward - Comments posted to this topic are about the item Rollback vs. Roll Forward |
| Article Discussions by Author |
| Restoring On Top I - Comments posted to this topic are about the item Restoring On Top I |
| Designing Delta Tables with Liquid Clustering: Real-World Patterns for Data Engineers - Comments posted to this topic are about the item Designing Delta Tables with Liquid Clustering: Real-World Patterns for Data Engineers |
| String Similarity II - Comments posted to this topic are about the item String Similarity II |
| Supervised versus Unsupervised Training of an Artificial Neural Network - Comments posted to this topic are about the item Supervised versus Unsupervised Training of an Artificial Neural Network |
| Foreign Keys - Foes or Friend? - Comments posted to this topic are about the item Foreign Keys - Foes or Friend? |
| Fun with JSON I - Comments posted to this topic are about the item Fun with JSON I |
| SQL Server 2022 - Development |
| Dynamic Unpivot - I have a table I didn't design that has tons of repeating groups in it... here's an abbreviated version: USE tempdb; go CREATE TABLE [dbo].[Toxicity2]( [RecordID] [int] IDENTITY(1,1) NOT NULL, [PatientID] [int] NOT NULL, [Cycle] [tinyint] NOT NULL, [ANEMIA] [tinyint] NULL, [Causality1] [tinyint] NULL, [Relatedness1] [tinyint] NULL, [ALOPECIA] [tinyint] NULL, [Causality2] [tinyint] NULL, [Relatedness2] [tinyint] […] |
| |
| ©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |