Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Development |
Job is empty SQL - Hi guys, I really do not understand why I still receive empty emails. Please check my code: EXEC msdb.dbo.sp_send_dbmail @profile_name = '#####' , @recipients = 'a###' , @subject = 'queryresultset' , @body= 'test tes tesl' , @execute_query_database = 'dbo.rates' The mail I get is: |
SQL Server 2016 - Development and T-SQL |
Creating a unique value for a certain period & staff - I'm trying to build some business logic for my ETL which gives a unique ID (Integer in this case) groups for a particular Date period related to a Staff and I'm stuck on how to achieve it. Only way I can think of is using case statements as I will have so many of them […] |
Write 2 complex queries - I have a DB: CREATE TABLE cabinet ( id_cabinet INT PRIMARY KEY, area INT NOT NULL ); CREATE TABLE doctor ( id_pib INT PRIMARY KEY, speciality VARCHAR(50) NOT NULL, surname VARCHAR(100) NOT NULL, id_cabinet INT NOT NULL, FOREIGN KEY (id_cabinet) REFERENCES cabinet(id_cabinet) ); CREATE TABLE nurse ( id_pib INT PRIMARY KEY, pib VARCHAR(255) NOT NULL, […] |
Foreign key in the column values of another table - I have trouble in writing a SQL query. I have a data table with below columns. DataTable 1 id notes ---------------------------------------------------------------- 1 develop document disseminate to {{param = "ac- 1_prm_1"}} 2 develop document to {{param = "ac-1_prm_2"}} Data table Parameter parameterid […] |
How to increase performance to load a factless date-date-interval table - Hi all, I am currently having performance issues by populating one of my factless fact tables (fact_Datum). My business relevant fact table is not point-in-time but time-interval-based, because I am dealing with the whole history of the customer. Because we have use cases to analyse the data point-in-time, I have modelled that in the following […] |
SQL 2012 - General |
Azure SQL backup policy strategies and best practices? - What are best practices for setting up long term retention for an Azure SQL DB? Are there any common strategies to keep the costs low? How should one go about implementing it for keeping 10 year backups. When I select weekly snapshots for 10 years, the cost is going through the roof (3.5x the cost […] |
Deadlock occurred while trying to perform multiple inserts into the same table - We wrote the script to split inserting data the same table. There is an error occurred on one of the session as "ERROR: CLI execute error: [Microsoft][ODBC SQL Server Driver][SQL Server]Transaction (Process ID 185) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction." So, when […] |
SQL Server 2012 - T-SQL |
Problem understanding SUM function with GROUP BY - I have code I'm trying to write to sum the time in decimal for each user_name: SELECT [user_name], dbo.fnGetDecimalTime([event_sec]) as 'Decimal_Time', SUM(dbo.fnGetDecimalTime([event_sec])) as 'Decimal_Time_SUM' FROM [Charter].[dbo].[ConvoHrs] group by [user_name], [event_sec] order by [user_name], [event_sec] desc But my data comes back looking like this: user_name Decimal_Time Decimal_Time_SUM (b) Alexander Pierson 2.00 2.00 (b) Alexander Pierson […] |
Problem understanding SUM function with GROUP BY - I have code I'm trying to write to sum the time in decimal for each user_name: SELECT [user_name], dbo.fnGetDecimalTime([event_sec]) as 'Decimal_Time', SUM(dbo.fnGetDecimalTime([event_sec])) as 'Decimal_Time_SUM' FROM [Charter].[dbo].[ConvoHrs] group by [user_name], [event_sec] order by [user_name], [event_sec] desc But my data comes back looking like this: |
SQL Server 2019 - Administration |
Guardian Botanicals Blood Balance Reviews: Benefits & Price? - Data about Guardian Botanicals Blood Balance lately, glucose issues have become more pervasive. These issues are brought about by an assortment of clinical and way of life factors, and treating them requires the utilization of costly, manufactured drugs that as often as possible have secondary effects. Guardian Botanicals Blood Balance has set up a good […] |
SQL Agent step won't write to SQL log directory - I have a SQL 2019 (RTM-CU14) installation with an Agent job which constantly fails with the error: Unable to open Step output file. The step failed. The "Output file" value attempts to write to the SQL error log directory using agent tokens - although I've tried with a fully specified filename as well. Using C:\Temp […] |
High Log Reads on Readable Secondary Databases - I've an AoHA environment where some of the Readable Secondary databases are being quite heavily read for reporting purposes. We are seeing that on these database there are high reads against the transaction logs. This image shows the levels of IO on the 3 main databases (highlighted), and one can see the Readable Secondary node […] |
Activity Monitor always paused for "sa" login - Hi Everyone, I'm also experiencing the issue of a constantly "paused" SSMS Activity Monitor on a recently setup server. I've followed all the steps outlined in this blog post, without success: https://bobcares.com/blog/ssms-activity-monitor-paused/ I'm using SQL Serer 2019 v15.0.4188.2 with SSMS v18.10. I've tried remote connections, local connections, using the "sa" user as well as another […] |
General Cloud Computing Questions |
Recommended course with lab for Kubernetes CKA cert - Im a DevOps and cloud engineer and want to learn kubernetes because most opportunities that I come across are requiring experience with it. I know linux and have a solid and useful understanding of containers. Moreover, I have experience with Docker, bash, Python and Powershell. That said, I'm more of a hands on learner but […] |
Powershell |
List file shares from TAR file - How can I list just the directories from a TAR file, then extract just 1 file share from that TAR file. Thanks. |