Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2016 - Administration |
First responders kit - BlitzIndex question - Hello, hope someone can help, maybe a simple question so i am using the Blitzindex from Brent Ozar, and its great, but one question, with some of the findings being "Missing Index" or "Index phobia", it does say estimated impact or missing index request... I am looking for a way to find out "This would […] |
SQL Server 2016 - Development and T-SQL |
Quick SQL challenges for mid-experienced+ DBAs (and advanced T-SQLers) - (1) Sort rows with year column and month column == Jan, Feb, Mar, etc. == correctly, without using CASE or other conditional expressions. (2) Table "emp_training" has (emp_id, training_id, status) where status = F(fail)/P(pass). Each employee (emp_id) may pass a class only once but may fail it (multiple times even). Write all necessary DDL to […] |
Designing a table - Hi, I have this list of training courses: Course_Code|Description 1 |Health and Safety 2 |cusomter relations 3 |IT training 9 |None Thanks. I have this scenario: A worker may attend up to 4 training courses per year. I need to design a table "WorkersCourses" where I can enter multiple records per worker. This will need […] |
Which table design is better ? - Hi, I have a scenario where a worker can do multiple training courses each year (max 4). Is it better to create a table this way: WorkerID |Year |Courses Worker01 |2021 |CourseCode01 Worker01 |2022 |CourseCode01 Worker01 |2022 |CourseCode02 Worker01 |2022 |CourseCode03 Or this way: WorkerID |Year|course1 |Course2 |Course3 |Course4 Worker01 |2021|CourseCode01| | | […] |
CAST AS DATE Assistance - Can someone let me know why I'm not able to use CAST method to cast a field as date ;WITH numbering AS ( SELECT MontaguOwner, CurrentOpportunityStatus, LastDateStatusChanged, OpportunityName, rank() OVER (PARTITION BY MontaguOwner, CurrentOpportunityStatus ORDER BY LastDateStatusChanged DESC) AS rank, row_number() OVER (PARTITION BY MontaguOwner, CurrentOpportunityStatus ORDER BY LastDateStatusChanged DESC) AS row_number FROM enrorigination.opportunities_hv […] |
Put result of one query into another - Hi all! I have to do this 177 times more, and it must be possible to make it a bit more automatic. I have to deliver +200 sets of queries, whish tells that two values should be updated. When finished, it will be run by my Customer. First query; SELECT per_personal_id FROM dbo.personal WHERE […] |
Administration - SQL Server 2014 |
SQL Server 2014 Question - So I have inherited an older SQL 2014 Server and have been working on understanding what I need to migrate or can shutdown without affecting our current applications. There is only one DB i know for a fact that relates to a digital faxing server we use I have a collection of 6 Databases with […] |
SQL Server 2019 - Administration |
Drop database on Secondary Node from Primary for automatic restore job - hi all We've ventured into the world of AAG's as we have now moved across to SQL2019. We have a Primary node and two secondary nodes. We have a training database that is autoamtically created from the main production database. This was initially added to the AAG manually and syncs fine. What we are now […] |
SQL Server 2019 HA - Looking for a HA solution for SQL server for our branch offices. Current setup has our 3 offices running independent standalone servers with SQL server. No redundancy in place. My aim is to centralise the servers in 2 locations. Location A and B has one server each. Both running windows server vm and sql in […] |
SQL Server 2019 - Development |
Combine tables with SQL in power bi - Hello everyone, i hope everyone is fantastic!! I've done some SQL queries in power bi to get my data and do some ETL. I have 6 companies, therefore, 6 queries. Now i would like to append them, combine(?) them in order to have just one sales table. What would you think it would be my […] |
Removing UNION and getting the same result - Hi, I need to update my sql script and remove the UNION but get the same result - Current result from script using Union - DDL- For Accounts and bp_table1 /****** Object: Table [dbo].[bp_Account] Script Date: 04/07/2022 10:48:17 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[bp_Account]( [bp_id] […] |
Employee Hierarchy Recursive CTE Different Top Level Directors Overtime - Hi, I have looked at some examples of Employee > Manager Hierarchy using Recursive CTE. The issue I have is the Top of Chain i.e. the Chairman there was different Chairman's over a period of time for example: Final Results I require If you look at EmpId 129 Rafael Nadal he left at the time Jeff […] |
Add a column with default value - Hi guys I have a query with a SELECT statement, that joins 2 other queries, filter a column and order another one. I did it in SSMS. I would love to add a new column with a static value for all records, past and future. I believe i should add these lines, but i'm not […] |
SQL Azure - Administration |
Deploying a standalone Azure VM running SQL Server into an availability zone - If i deploy a standalone Azure VM running SQL Server into an availavility zone; what will this achieve? Will i get two load balanced copies of the instance running from VM's out of two data centers in the zone with the data being synced? I think that is what the documentation is suggesting, but I […] |
Design Ideas and Questions |
Multiple Fact Tables - Please assist? I would like to do a data model of the tables here: https://developers.google.com/doubleclick-advertisers/dtv2/reference/match-tables Any idea how i would go about to break this down and build a decent data model/links to tables? |