|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Double Standby | |
I have a SQL Server 2019 instance and I run this: USE [master] RESTORE DATABASE [sandbox4] FROM DISK = N'D:\SQLBackup\New folder\sandbox_20210308.bak' WITH FILE = 1, MOVE N'Sandbox' TO N'D:\SQLServerData\SQL2017\Sandbox4.mdf', MOVE N'Sandbox_log' TO N'D:\SQLServerData\SQL2017\Sandbox4_log.ldf', STANDBY = N'D:\SQLBackup\New folder\sandbox_RollbackUndo_2023-08-07_11-51-39.bak', NOUNLOAD, STATS = 5 GOThis works and I see the database in standby/read-only. Now I run this: RESTORE LOG [sandbox4] FROM DISK = N'D:\SQLBackup\New folder\sandbox_20210308_1301.trn' WITH STANDBY = N'D:\SQLBackup\New folder\sandbox_RollbackUndo2.bak', NOUNLOAD, STATS = 5 GOWhat 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) |
Closing a Symmetric Key If I open a symmetric key with this code: OPEN SYMMETRIC KEY PIIKey DECRYPTION BY PASSWORD = 'MyS3cr#tP@ssword' When is it closed?
Answer: When the session ends or the key is explicitly closed Explanation: They key is for the connection and remains open through context changes. It is closed when the CLOSE SYMMETRIC KEY command is used or the session terminated. Ref: OPEN SYMMETRIC KEY - https://learn.microsoft.com/en-us/sql/t-sql/statements/open-symmetric-key-transact-sql?view=sql-server-ver16 |
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 2017 - Administration |
Central Management Server (CMS) on AlwaysOn for Failover Process - Good afternoon! Is there any type of documentation or process for failing over a CMS server? Do I have to remove them from Primary and add them to secondary (new primary)? This is cumbersome work. Let's assume it's HA and failed over every 2 weeks. Or assume a DR failed over for over a month. […] |
cost threshold for parallelism value to be set - Hi Everyone, Why and when should be set 'cost threshold for parallelism'? We are on SQL 2017 Enterprise Edition. What should be the value set for cost threshold for parallelism instead of default value 5 and why ? what benefit do we get if we set a high value and what should be the starting […] |
SQL Server 2016 - Administration |
Alwyason availability group can set primary role permanently? - Hi. Two node windows clusters Node1 and Node2 and configured alwayson availability group. Will it possible to Alwyason availability group can set primary role permanently any one of the node? Thanks |
Does multi-subnet with standardeditionofsqlserver supports DB Mirror Or AG group - Does multi subnet failover with standard edition of sqlserver supports DB Mirror or AG groups 1. can db mirror configured in different multi subnet with standard edition 2. can db always on configured in different multi subnet with standard edition |
SQL Server 2016 - Development and T-SQL |
get week number of month - I want to query a table that has a datetime column ([CreateDateTime]) and get the week number for that specific month. 2023-03-01 09:30:00 2023-03-12 11:15:22 2023-03-22 14:22:18 2023-04-02 15:12:30 I want to get these results from the above dates: 1 3 4 1 |
SQL Server 2019 - Administration |
Changing Database page Verify on a Database in an AG - I have a database on SQL 2019 in an Availability Group (AG) and I want to change the Page Verify attribute from NONE to CHECKSUM on all of the nodes in the AG for this database. The Page Verify attribute is the same on the database on all nodes of the AG. I do not […] |
High tempdb usage alternatives - Hi We have an stored procedure which runs frequently and it contain logic in which data are first dumped in temproray table and then moved to physical table .due to large data and frequent run of sp .tempdb database get filled up quickly .We cannot take server restart everytime so whats alternative to temp variables […] |
high latency in sql server transactional replication - Hi I am new to replication and we have database of size around 2TB and its has been set up for replication .there are 4 subscriber to it. Tables(articles) of database has been divided into 14 publishers. Issue sometime we face high latency on server with lakhs of undistributed command so what should i check. […] |
upgrade evalution editon reporting services to Stanadard - Hi All, I installed reporting services evaluation edition for testing purpose, but now 180 day trial period is expired and I am unable to generate reports. Is it possible to upgrade it with SQL server 2019 standard edition, without disturbing the existing configuration. I Installed SQL server 2019 database engine on same machine, but while […] |
SQL Server 2019 - Development |
Need to output table data into multiple CSV files - Hello, I created the below script to output 999 rows from SQL Server table into multiple CSV files. The SQL table has about 45,000 rows. We can only output max of 999 rows into the CSV files. I installed powershell sql server module. Since this is a powershell script, I may need to modify the […] |
need some help with spilt raw data - Hello, I am trying to split data, looks like there is some special character or white space that is not letting me to split. i try to split with space as delimiter even though there is space between two A2339 MC it will not split. -- test date DECLARE @TEST_STR TABLE ( TEST_STRING NVARCHAR(255) […] |
Convert Binary or Hex field to show text information - Hi all, I have an SQL database table with events, and within it a field of binary (32) datatype. I want to convert the info in binary field and show me the information that refers to the event. The info is of this type: 0x06-0000000006-0000000006-0000000006-0000000006-0000000006-000000002000. Can someone help? Thanks!! |
Convert columns result into rows with comma and single quotes - Hi All, Hi All, I want to convert columns result into rows with comma. Ex: Result should be - 'SQL1','ABCD100','XYZ123' #code: create table #tbl_db (name varchar(100)) insert into #tbl_db values ('SQL1') insert into #tbl_db values ('ABCD100') insert into #tbl_db values ('XYZ123') select * from #tbl_db Result needed: 'SQL1','ABCD100','XYZ123' |
Powershell |
Write https request to azure blobstorage - Hi All, I have been trying to download a csv file which is produced by calling an api and then to store the csv file directly in azure blob storage. I am able to download the file on my local machine and then copy it to azure blob storage. But I would like to copy […] |
Employers and Employees |
Master Data - Relational or Dimensional modeling? - Dears, In my company, we have certain master data domains like customer; Vendor; Product; Materials; Bill of Materials. So far we have been doing our modeling using relational modeling in the cloud. It consists of entire tables that we push from SAP ECC and SAP MDG like MARA; MVKT, etc... then we have views on […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |