|
|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Backing Up a Restoring Database | |
I have a database involved in log shipping. I have this database restored with the NORECOVERY option as we continue to add log restores to this. Can I back up this database with a BACKUP DATABASE command while it's in the restoring state? | |
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) |
Creating Two Keys On SQL Server 2019, I run this code. What happens? CREATE SYMMETRIC KEY PIISymKey WITH ALGORITHM = AES_128 , IDENTITY_VALUE = 'S0methingN3w' , KEY_SOURCE = 'Someth!ngBl&e' ENCRYPTION BY PASSWORD = 'MyS3cr#tP@ssword'; CREATE SYMMETRIC KEY HIPPASymKey WITH ALGORITHM = AES_128 , IDENTITY_VALUE = 'S0methingN3w' , KEY_SOURCE = 'Someth!ngBl&e' ENCRYPTION BY PASSWORD = 'MyS3cr#tP@ssword'; Answer: The first key is created and the second is not Explanation: The batch doesn't matter. We can create multiple keys in one batch. However, the identity_value must be unique for each one. This is used to derive a GUID and once used, it cannot be reused while a key exists that has used this same value. Ref: CREATE SYMMETRIC KEY - https://learn.microsoft.com/en-us/sql/t-sql/statements/create-symmetric-key-transact-sql?view=sql-server-ver16 |
Featured Script |
How to Move a Table into a Schema in T-SQL Parthprajapati from SQLServerCentral To move a table into a schema in T-SQL, you can use the ALTER SCHEMA statement along with the TRANSFER option. Here are the steps to do this: Assuming you have an existing schema named "NewSchema" and a table named "YourTable" that you want to move into this schema: Open SQL Server Management Studio or […] |
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 |
SSIS validation slow in SSISdb - We have a 2017 server in one location which is used as an SSIS execution box (SSISDB). It works perfectly fine, but due to consolidations, business decisions we had to move the projects to the new server. When we did that we noticed that package execution went up from few seconds to over a minute. […] |
SQL Server 2017 - Development |
Copying an old database to a new database - Hi All, I've got a write a program to copy the data from one database over to another. The destination database is empty(apart from the table names/columns) and is more or less the same as the old database BUT some columns have been removed from the tables and GUID fields have been added. I can […] |
SQL Server 2016 - Administration |
Transaction log full due to LOG_BACKUP - 1 of my production database's transaction log file is full due to some backup failure occurred overnight. This has caused the logs to grew until it ate up all available space. Our backup admin has manually kick start the backup, it is running at the moment but it's taking very long as the transaction log […] |
Development - SQL Server 2014 |
Weekly sales report - I have two tables InvHeader and InvDetail InvHeader table has the columns: InvNo, InvDate InvDetail table has the columns: InvNo, ProductNo, QTY, Price I Would like to generate weekly sales for the period 1/1/2023 to 8/31/2023. The week starts with Sunday. Amount column is calculated Qty\*Price. [![SQL output](https://i.stack.imgur.com/B1kqb.png)](https://i.stack.imgur.com/B1kqb.png) Thanks I tried this: ` SELECT DATEADD(WEEK, […] |
SQL Server 2019 - Administration |
How to Setup Backups and Restore planning in SQL Server Availability Groups? - I need some help regarding How to Setup Backups and Restore planning in SQL Server Availability Groups. Any details link to a blog post or video tutorial would be helpful. |
Error in SQL Server Management Studio launcher - Guys, good night! I have a situation in my SQL Server Management Studio where when I log in and click the "New Query" button in a new window/tab, the attached error is displayed. I tried reinstalling and repairing the installation, but the error still persists. I can't format the notebook to solve this problem due […] |
SQL AG 3servers and problem with DTC and HADR_SYNC_COMMIT - Hello, I would like to have a few questions and a little discussion about the experience of users here. we have 3 servers, where there are fews AG, and all work almost all the time well. But sometimes, and we cannot find directly when and why, there are a lot of blocks and a lot […] |
SQL Server 2019 - Development |
Query goes crazy. - Hi. I have a query that returns few rows (out of 7 table join, tables have milions of records). On our server it's fast, takes 46ms to complete. On client's server it takes 25-60 sec. The execution plan is similar in relations and indexes used, but almost every node has info like this: cost 10% […] |
Best CI/CD or release process - Hello my SQL friends, I want to know about few of the best approaches/methodologies/applications being used in industry for CI/CD (or release management for SQL server database). Your opinion will be really helpful to me as I want to learn one or two of them to upscale myself. |
Reporting Services |
Just upgraded SSRS from 2016 to 2022 - I just upgraded SSRS from 2016 to 2022. This is my first time doing it so I thought I'd ask the group for some help. I followed this document https://www.mssqltips.com/sqlservertip/6768/side-by-side-ssrs-install-upgrade-minimize-downtime/ and was able to install SSRS successfully. I worked with the server team to redirect DNS, shutdown the old SSRS server and I am able […] |
Calender Error in SSRS with SSAS Tabular Source - I have a report which get a Date Parameter.. I don't want to display That as a default list.. I found what I want exactly on https://www.mssqltips.com/sqlservertip/3451/calendar-date-picker-for-mdx-based-sql-server-reporting-services-reports/ when I go with tutorial I did This I used the following Function ="[DIM_CREATE_DATE].[Date].&["+format(Parameters!DIMCREATEDATEDate.Value,"yyyyMMdd")+"]" an now I get the following Error any one can help me how to […] |
Calender Error in SSRS with SSAS Tabular Source - I have a report which get a Date Parameter.. I don't want to display That as a default list.. I found what I want exactly on https://www.mssqltips.com/sqlservertip/3451/calendar-date-picker-for-mdx-based-sql-server-reporting-services-reports/ when I go with tutorial I did This I used the following Function ="[DIM_CREATE_DATE].[Date].&["+format(Parameters!DIMCREATEDATEDate.Value,"yyyyMMdd")+"]" an now I get the following Error any one can help me how to […] |
SQL Server 2022 - Administration |
Partition Large Tables needed - Hello Gurus, I have a requirement and need to implement the solution quickly. SQL DB is on Azure MI, so only one file group is allowed. There are 4 Very large tables of 50 Million Records in each Table, and time stamp is createdon column which has data from 9/2019 to 9/2023 , These are […] |
SQL Server 2022 - Development |
table with varcahar(max) - Gurus, there is a table which is very slow to query , it has only 3 months data, logid is PK, indexed and datecreated is the TS. It has a column called error with varchar(max) and saves the error msg which is slowing the table down. Will partioning this table improve the performance with varchar(max) […] |
Migration from Sybase SAP SQL Anywhere to SQL Server 2022 - We are working on a project to migrate a client from a version of SAP Sql Anywhere (Sybase) to SQL Server 2022. However, we have encountered a challenge. The current application calls stored procedures and passes parameters, e.g. CALL TheStoredProc @a, @b+@c, @d However, to my knowledge, SQL cannot receive parameters that contain mathematical operators. […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |