|
|
|
|
|
|
|
| Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Switching Schema II | |
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 two rows back for the objects, named dbo.beer and etl.beer. Both the tables have identical schemas and are not partitioned. There are 25 rows in dbo.beer and 0 rows in etl.beer. 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) |
Server-level Roles In SQL Server 2025, can I alter a fixed server role? Answer: No Explanation: No, you cannot change the fixed-server roles. You can add user-defined server roles. Ref: Server-level Roles - https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles?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. |
| Anything that is NOT about SQL! |
| Life hack that has worked well for me - I wrote about this several years ago but will contribute again a life hack that has helped me. It comes to mind again as I have just had to have a new pair of glasses made again because they did not follow my prescription. Many of us spend many hours looking at computer displays, in […] |
| Editorials |
| Pay for Performance - Comments posted to this topic are about the item Pay for Performance, which is is not currently available on the site. |
| Helping an English Student with R - Comments posted to this topic are about the item Helping an English Student with R |
| PASS Summit Week - Comments posted to this topic are about the item PASS Summit Week |
| My PASS Summit West 2026 - Comments posted to this topic are about the item My PASS Summit West 2026 |
| Article Discussions by Author |
| Adding Bits I - Comments posted to this topic are about the item Adding Bits I |
| Implementing System-Versioned Temporal Tables in SQL Server: A Practical Guide - Comments posted to this topic are about the item Implementing System-Versioned Temporal Tables in SQL Server: A Practical Guide |
| Switching Schemas I - Comments posted to this topic are about the item Switching Schemas I |
| Enforcing Unique Customer Emails When Duplicates Already Exist - Comments posted to this topic are about the item Enforcing Unique Customer Emails When Duplicates Already Exist |
| Too Many Choices - Comments posted to this topic are about the item Too Many Choices |
| Table Partitioning in SQL Server: A Practical Guide to Managing Very Large Tables (VLDBs) - Comments posted to this topic are about the item Table Partitioning in SQL Server: A Practical Guide to Managing Very Large Tables (VLDBs) |
| Packing and Decoding Device Status Codes with LEFT_SHIFT() and RIGHT_SHIFT() in SQL Server - Comments posted to this topic are about the item Packing and Decoding Device Status Codes with LEFT_SHIFT() and RIGHT_SHIFT() in SQL Server |
| SQL Server Audit Failures - Comments posted to this topic are about the item SQL Server Audit Failures |
| SQL Server 2022 - Development |
| Trying to make this faster using not exists - Hi I have this query that is slow during the 'not in' part of the statement: LEFT JOIN dbo.benefitplan BP ON BP.benefitplan_id = ci.benefitplan_id LEFT JOIN dbo.benefitplan_type pt ON pt.benefitplan_type_id = BP.benefitplan_type_id WHERE k.BatchSeq BETWEEN '1' AND '1000000' AND ci.claim_procedure_id NOT IN (35381320,35381310,35381304,35381305,35381311,35381306,35345478,35381307,35381293,35381308,35392585, 35392587,35381298,35381321,35345407,35381324,35392582,35381326,35381299,35381325,35381295,35381323,35345410,35381297, 35336186,35381314,35345409,35381319,35392584,35336187,35336218,35336217,35381312,35381294,35381303,35381296,35381318, 35381300,35381327,35381315,35381317,35336185,35381309,35381322,35392586,35381313,35345408,35392583,35345477,35381316) where k.BatchSeq BETWEEN '1' AND '1000000' So I thought […] |
| Slow - Linked server query - Hi I have this slow query that is pulling data from a linked server. This is the slow part of the statement: SELECT c_sub.claim_id, MAX(cs.status_type) AS clm_status_type FROM dbo.tblBatchKeys k_sub INNER JOIN [SQL22.CARE.NET\SQL22NODEASTAGE]PROD.dbo.claim c_sub ON c_sub.claim_id = k_sub.claim_id INNER JOIN [SQL22.CARE.NET\SQL22NODEASTAGE].PROD.dbo.claim_procedure ci_sub ON c_sub.claim_id = ci_sub.claim_id AND ci_sub.claim_procedure_id = k_sub.claim_procedure_id INNER JOIN [SQL22.CARE.NET\SQL22NODEASTAGE].PROD.dbo.claim_procedure_status cs ON […] |
| |
| ©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |