|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Collins): | |
Scalar function string replacement | |
You create the following scalar function in SQL Server:
create function dbo.scalar_string_replace( @stringnvarchar(max)) returns nvarchar(max) as begin select @string = replace(@string, v.str_key, v.str_val) from (values (N'a', N'x'), (N'b', N'y'), (N'c', N'z')) v(str_key, str_val); return @string; endYou run the following: select dbo.scalar_string_replace(N'abc');What is the output? | |
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) |
Choosing Business Continuity Options Which of these business continuity topics are deprecated in SQL Server 2019? Answer: Database Mirroring Explanation: Of these technologies, only database mirroring has been deprecated. If you are using this, you ought to change to Availability Groups. Ref: Database Mirroring - https://docs.microsoft.com/en-us/sql/database-engine/database-mirroring/database-mirroring-sql-server?view=sql-server-ver15 |
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 |
Column Level Encryption In SQL Server 2016 - Hello, I'm planning to use different certificate instead of self signed certification while implementing Column level encryption in SQL server 2016. So, it is like we have to create a Symmetric key but in order to secure a Symmetric key, we should have a 'different ( not self signed) digitally certificate. How can I accommodate […] |
Possible to Side Load a DB to AOAG then rename - Hi, I have a large database within an 2016 AOAG that needs to be refreshed quite in a test environment from a copy in production. In order to minimise restore time due to tight maintenance windows, i was looking at an option to restore a copy of the database alongside the existing database in a […] |
Failover Clustering Queries - Hello, We are planning to setup failover clustering on windows server. We are currently having sql server 2016 standard edition. I have few queries in mind. Do we need to move on to enterprise edition/ sql 2019 before configuring clustering nodes, in case we want to move on future so is it better to move […] |
SQL 2012 - General |
Filter clause query - Hi, I need help on a query to extract all rows between the period - 01/04/2021 and 31/03/2022 based on last_modified_date column. However, the problem is I need to include all rows where balances are above 0 but the last_modified_date is out of the above range. This is because the balance has remained unchanged in […] |
First post here - help with installation of 2012 or 2019 Sql Server Express - Hi everyone! This is my first post on this subreddit. I'm absolutely new to the Sql world and I just signed up for a Udemy course to start learning about SQL. The first thing the teacher requires us to do is to install Microsoft Sql Express 2012 from the Microsoft website. However, when I went […] |
SQL Server 2012 - T-SQL |
Comparison in the WHERE condition - Hi all, I would like to add some condition to the query but not for how it will be correct. For example, my query: SELECT Product_Id, Product_Name, Created_Date FROM Product I want to add condition: if product_id are 1 and 2 them created_date < 20220301, if not - any filtering. Could you please help me? […] |
SQL Server 2019 - Administration |
Service Master Keys with Group Managed Service Accounts - Hello, for anyone familiar with group managed service accounts and SQL Server. The Microsoft docs for Group Managed Service Accounts state that ...When a gMSA is used as service principals, the Windows operating system manages the password for the account instead of relying on the administrator to manage the password... and for SQL Server's Service […] |
Transactional Replication [CLOUD Publisher/Distributor] to [OnPrem Subscriber] - We are on the planning stages on moving our production servers to the [C] (Cloudwave). This includesa replicated DB that we use for all reporting needs. Before we do a cutover, we wanted to test any issues with TR so we setup a copy of our [C] test sql server and another [OP] sql server […] |
SQL Server 2019 - Development |
Parsing / importing Costco Receipt data - OMG. I think CostCo doesn't want anyone to do anything with their own purchase data. If you've ever tried to read a Costco receipt, it's some brutal horrible shorthand. If you try to import it, it's even worse. So I asked Costco to e-mail a PDF of my last 6 months of purchases. Either that's […] |
SS2019 Running Extremely Slow - Hi everyone I got a new computer and copied over the DB from my old machine. I backed up the DB from the old machine onto an external drive and then restored it on the new computer. I ran one stored procedure and it is super slow on the new machine. On the old machine […] |
Having a case or if statement in where clause on Max Date - The issue is that I need to select the MAX date when: If the Max Date from my_column is equal to today's date, I need to select the Max Date from yesterday. If the Max Date from my_column is not equal to today's date, I can select the Max Date from today. I am trying […] |
SQL Azure - Development |
Should I use Azure for this? - A friend of mine owns a bakery. His data needs are pretty simple, so in theory I could use Access (shudder)... It's basically Recipes, Recipe Ingredients, Ingredient Purchases, and Sales of finished product. He uses Square for sales, and Fillet (ingredient costing, inventory, etc) and a funky Dough Calculator to scale ingredients, and Quickbooks for […] |
Azure Data Factory |
Any good resource to learn Data Factory ? - I just joined a company and I'm new to Azure. It's a powerful tool but I don't like Data Factory because it reminds me of SSIS and I think it's just clumsy and quite difficult to create pipelines, let alone debug them. Although, I don't know of I hate it because I don't know how […] |
Powershell |
make script more robust - This script works, but I would like to add a few more things to the process, and need some help. 1) Search multiple folders 2) Search for multiple strings patterns (error,failed) 3) use a dynamic error log filename instead of hard coded in the export-csv 4) Email results. Get-ChildItem ` -Path "\\ftpsrv\logs\" | ` Select-String […] |
Integration Services |
dynamic excel connection in ssis - Hi Expert, i wanted to user variable name in connection string . I tried [User:IntegrationFIle] in table or variable name property of excel connection string but did not worked also tried entering in connection manager properties but did not work Provider=Microsoft.ACE.OLEDB.12.0;Data Source=@[User::IntegrationFile].xlsx;Extended Properties="EXCEL 12.0 XML;HDR=YES"; |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |