|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Upgrading User Information | |
I have some DBA code that looks at the system table, sysusers, to get information about the database users and check their access. I want to upgrade this in my SQL Server 2019 instance to use the current view. Which one should I choose? | |
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) |
Restoring the Deleted Azure Database I have configured long term retention for the Sales database in Azure, setting this to retain backups for 6 months. This is an Azure SQL Database. After this has been running for 3 months, we have a major issue and need to restore from a previous backup. We do this, restoring the backup as Sales_New, then deleting the Sales database and renaming Sales_New back to Sales. I then realize that the retention period for this new database (Sales_New)was reset to 7 days. What has happened to the other backups from the original Sales database? Answer: The remain in Azure until the original retention period for each file expires. Explanation: From Docs: If you delete a database, the system keeps backups in the same way it would for an online database with its specific retention period. You cannot change backup retention period for a deleted database. Ref: Automated backups - Azure SQL Database & SQL Managed Instance (Backup Retention) - https://docs.microsoft.com/en-us/azure/azure-sql/database/automated-backups-overview?tabs=single-database#backup-retention |
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 - Development and T-SQL |
Query - How to show below result in sql ID=205&SID=1005&TID=3 ID=25&SID=1005&TID=3 ID=2&SID=1005&TID=3 ID=2006&SID=1005&TID=3 Result 205 25 2 2006 |
Administration - SQL Server 2014 |
Sudden PLE drop - Hi Experts, We are observing sudden drop in PLE. Buffer cache rit hatio, check point pages/sec ,lazy writes/ sec are all normal. I tried running trace to find if any query causing issue but didnt find any. The DB is getting logged from BizTalk servers. Can you guide me on how to troubleshoot this? |
Development - SQL Server 2014 |
Transpose Rows - Hi, I'm using a recursive CTE to build a family tree. All works fine but instead of having a row for each person in the family tree, I want one row as the result with each constituent person as a column. How do I do this? I will have the same maximum number of generations […] |
Nolock hint - In our stored procedures we have (nolock) hints everywhere in a code. Can I replace them all with a single SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED on the top of S.P.? Is it safe? These stored procedures are for reporting. Thanks |
How to cumulate the columns - Hi I wrote this query and I want the result to be cumulated by period so period 1 result is 1 and periode 2 result is 2+1 and period 3 is 3+2(2+1) etc... SELECT dbo.grtbk.reknr, dbo.grtbk.oms25_0, SUM(CASE WHEN MONTH(ReportingDate) = '1' THEN (AmountDCDebit - AmountDCCredit) ELSE 0 END) AS [1], SUM(CASE WHEN MONTH(ReportingDate) = '2' […] |
SQL 2012 - General |
How to select data based dynamically based on start and end of AffectedProduct ? - I work on SQL server 2012 I need to get data from #partsdata table where part number matches Affected Product both start and End as Example where I have Affected Product as APAMS-***G then I will get Parts That have start APAMS- and End by G start must be end with dash (-) this roles […] |
SQL Server 2012 - T-SQL |
Create a view... - hello, i have a customer table and than a customer group group table which is basically grouping customers Than i have a table price like: cust1 item1 price cust2 item2 price cust3 item2 price cg1 item5 price where cg1 is a group and has cust1 and cust2. I need to create a view with the […] |
SQL Server 2019 - Administration |
T-sql performance tuning help Please! thanks - USE [Repository] GO /****** Object: StoredProcedure [dbo].[uspExportGetValues] Script Date: 7/23/2020 6:31:48 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO /*------------------------------------------------------------------------------------------ This stored procedure is a key components of the Repo Export application process. It captures all user selected values from user interface List Box and DateTimePicker controls and stores them into separate database […] |
SQL Server 2019 - Development |
How to check format of string number variable will format to Decimal(32,6) - I have an incoming set of string values which need to be checked so they can be formatted as Decimal(32,6) in a table These can range for example: 100000 23.6767 4567.12121212 Whats the best way to check these incoming values ? is it to using string manipulation using the decimal point to count digits? I […] |
Reporting Services |
Using Text Boxes, no table, with more than one data row. - Good morning. I'm not really sure how to write the title so let me explain my issue. I have a two page SSRS report with Text boxes and Expressions. It is a summary of benefits and pay for an individual employee and works great. I used Text boxes because of the layout, how it appears, […] |
SSRS 2012 |
Errors when clicking "Report Builder" - Hello, So my company uses SSRS 2012 to allow our users to run reports and build their own. And the only person at the company who knew much about it just left. I know very little about SSRS in general, unfortunately. Here is what I can say about the issue: We can connect to the […] |
General |
Impossible to create an SQL Server function that calls an Oracle function? - Hi, I have been trying too many hours to create an SQL Server Scalar Function that calls an Oracle function. Imagine you have a function in oracle named "Stock_Orcl" that returns the stock for a product passed in parameter and you want an SQL server function (named "Stock_sql") that calls the oracle function above "Stock_Orcl". […] |
Integration Services |
ssis execute sql task doesnt work? - Hello, so here is something weird i come across... maybe its a simple setting fixed... but what i have below runs on a SQL execute SQL task, and runs fine... HOWEVER for some reason, doesnt insert the Always on AG information... here is the tsql below: truncate table dbo.Backup_Metrics ;WITH backupsetSummary AS ( SELECT bs.database_name […] |
Employers and Employees |
short & part time contracts - So I'm interested in finding short term contracts or the kind of work where I can be on call for issues & upgrades on a contract basis or a couple of days a week. Over the course of my career I have found that a full time DBA or developer is often not required and […] |
Microsoft Access |
ACCESS Expression convert to SQL - Need help on writing an expression created in ACCESS in SQL. I am new to SQL so bare with the long written queries. I think I need everything spelled out so I can get a good grasp on the basics. I am at a lost with trying to figure out how to even begin re-writing […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |