|
|
|
|
|
|
|
| Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Which Result II | |
I have this code in SQL Server 2022:
CREATE SCHEMA etl;
GO
CREATE TABLE etl.product
(
ProductID INT,
ProductName VARCHAR(100)
);
GO
INSERT etl.product
VALUES
(2, 'Bee AI Wearable');
GO
CREATE TABLE dbo.product
(
ProductID INT,
ProductName VARCHAR(100)
);
GO
INSERT dbo.product
VALUES
(1, 'Spiral College-ruled Notebook');
GO
CREATE OR ALTER PROCEDURE etl.GettheProduct
AS
BEGIN
exec('SELECT ProductName FROM product;')
END;
GO
When I execute this code as a user whose default schema is dbo and has rights to the tables and proc, what is returned? | |
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) |
Encoding URLs I have this data in a table: CREATE TABLE Response ( ResponseID INT NOT NULL CONSTRAINT ResponsePK PRIMARY KEY , ResponseVal VARBINARY(5000) ) GO If I want to get a value from this table that I can add to a URL in a browser, which of these code items produces a result I can use? Answer: SELECT BASE64_ENCODE(responseval,1) FROM dbo.Response WHERE ResponseID = 1 Explanation: The correct answer is to use BASE64_ENCODE(,1). The second parameter specifies if a URL safe value is needed, Ref: BASE64_ENCODE() - https://learn.microsoft.com/en-us/sql/t-sql/functions/base64-encode-transact-sql?view=fabric-sqldb&viewFallbackFrom=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 |
| Database file shrink issue. - Hi experts, I have a 3+ TB database on a 2019 sql server which has more than 50% free space. I know database or data file shrink is not a good practice so please not go there, I tried with 100 mb in a loop which is taking much longer time so it's not feasible. […] |
| Anything that is NOT about SQL! |
| Fantasy Football 2026 - The thread for the league in 2026. Players from last year have priority. |
| Editorials |
| Where Your Value Separates You from Others - Comments posted to this topic are about the item Where Your Value Separates You from Others |
| Your AI Successes - Comments posted to this topic are about the item Your AI Successes |
| Minimally Viable Security - Comments posted to this topic are about the item Minimally Viable Security |
| Article Discussions by Author |
| Fixing the Error - Comments posted to this topic are about the item Fixing the Error |
| T-SQL in SQL Server 2025: Encoding Functions - Comments posted to this topic are about the item T-SQL in SQL Server 2025: Encoding Functions |
| Which Table I - Comments posted to this topic are about the item Which Table I |
| Using Python notebooks to save money in Fabric: The Fabric Modern Data Platform - Comments posted to this topic are about the item Using Python notebooks to save money in Fabric: The Fabric Modern Data Platform |
| Encoding NULL - Comments posted to this topic are about the item Encoding NULL |
| Loading a Database for USD$5 - Comments posted to this topic are about the item Loading a Database for USD$5 |
| SQL Server 2022 - Administration |
| Certificates expired - Can't restore after creating new certificate - The previous DBA created a certificate which expired 12/31/2025. I came in hoping to have an easy day for New Year's Eve and found all of the backups were failing. After doing the research, I found the certificate had expired. 1. I created a new certificate since I couldn't update the expiry date. 2. I […] |
| SQL Server 2022 - Development |
| advice on diving into devops for managing BI projects - hi , i know this is a sql server forum but i think my brain is aligned more with members of this forum than any other. we have a large netsuite migration in which multiple erps are involved. The technologies on which those erp's run vary from db2 to all flavors of sql server based […] |
| Simplifying WHERE Condition with LIKE test on multiple columns - Good Evening, Is there a simpler way to rearrange the following WHERE condition: [Column_1] LIKE 'Beta08%' OR [Column_1] LIKE 'Beta11%' OR [Column_1] LIKE 'Beta16%' OR [Column_1] LIKE 'Beta17%' OR [Column_1] LIKE 'Beta15%' OR [Column_1] IN ('Beta192') OR [Column_2] LIKE 'Beta08%' OR [Column_2] LIKE 'Beta11%' OR [Column_2] LIKE 'Beta16%' OR [Column_2] LIKE 'Beta17%' OR [Column_2] LIKE […] |
| Switch partition: NULL boundary id - I have table: t1 in schema1 with 19 billion records. I have another table with same name: t1 in schema2. My goal is to move data from schema1 to schema2 and leave the empty table in schema 1. To achieve this, I'm using switch partitions. There are 30 boundary ids for the table schema1.t1 but […] |
| |
| ©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |