|
|
|
|
|
|
|
| Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Switching Schemas I | |
I run this query:
SELECT s.name AS schemaname , o.name AS objectname FROM sys.objects o INNER JOIN sys.schemas s ON s.schema_id = o.schema_id WHERE o.name = 'Beer'I get one row back for an object named dbo.beer. There is an ETL schema and both of these are nonpartitioned tables. I run this code: ALTER TABLE dbo.beer switch TO etl.beerWhat 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) |
Too Many Choices I have a table, dbo.MasterBrands, with this data: BrandID OfficialName 1 Samsung 2 Apple 3 Microsoft 4 Adidas 5 Coca-Cola I run this query. What is returned for Coca-Cola? SELECT CHOOSE(BrandID, 'Conglomerate', 'Tech and Design', 'Desktop', 'Apparel') FROM dbo.MasterBrands; Answer: NULL Explanation: For an out of range index, the value returned is null. Ref: CHOOSE() - https://learn.microsoft.com/en-us/sql/t-sql/functions/logical-functions-choose-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 - Development |
| MERGE in a nested TRY/CATCH won't roll back - I have a section of code similar to the following abstract: DECLARE @loop [int] = 0, @savepoint [varchar](4) BEGIN TRY BEGIN TRANSACTION _OUTER_ WHILE (@loop < 10) BEGIN SELECT @loop = @loop + 1, @savepoint = '_' + CAST(@loop AS [varchar](2)) BEGIN TRY BEGIN TRANSACTION SAVE TRANSACTION @savepoint MERGE ... -- This transaction works MERGE […] |
| SQL Azure - Administration |
| Managed Instance vs Azure Database - is this a good option? - We're currently in Azure, however as we had a very tight migration timeline when we moved, we've been using SQL Server on Azure VMs for the last several years. There's a push in the organization to go "cloud native," and on the database side, well, I see some potential headaches. My question can be boiled […] |
| General |
| Access + ODBC Driver 18 + SQL Server 2025: ~150–250 ms per request - Has anyone encountered recurring request latency when using Microsoft Access with SQL Server 2025 through ODBC Driver 18? In several existing Access applications, a simple DAO test behaves as follows: No forms open: approximately 0–4 ms per request after the initial execution. Certain bound forms open: approximately 150–250 ms per request. Closing the affected objects […] |
| Editorials |
| Planning for Change - Comments posted to this topic are about the item Planning for Change |
| Great Things - Comments posted to this topic are about the item Great Things |
| PostgreSQL 19 Is Late - Comments posted to this topic are about the item PostgreSQL 19 Is Late |
| A Heavy Heart - Comments posted to this topic are about the item A Heavy Heart |
| Article Discussions by Author |
| The ##MS_DatabaseConnector## User - Comments posted to this topic are about the item The ##MS_DatabaseConnector## User |
| Importing Excel files into SQL Server, Azure Edition - Comments posted to this topic are about the item Importing Excel files into SQL Server, Azure Edition |
| SQL Server Vector Support II - Comments posted to this topic are about the item SQL Server Vector Support II |
| Troubleshooting Slow Queries That Already Have an Index - Comments posted to this topic are about the item Troubleshooting Slow Queries That Already Have an Index |
| Hyperscale Replicas V - Comments posted to this topic are about the item Hyperscale Replicas V |
| Calculating Weighted Average in Power BI - Comments posted to this topic are about the item Calculating Weighted Average in Power BI |
| SQL Server 2025 Server-level Roles - Comments posted to this topic are about the item SQL Server 2025 Server-level Roles |
| SQL Server 2022 - Administration |
| Perfermance result aftet purge operatio - Hello everyone, I am planning to implement a data purging solution that is expected to reduce the size of one of our main databases by nearly 50%. One of my colleagues believes that the performance benefits will be limited. His argument is that most queries access data through Index Seeks, so reducing the amount of […] |
| |
| ©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |