Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
Need to optimize the SP - Please advise on the attached execution plans - Please advise on the actual execution attached plan. Thank you! I zipped them us as I was unable to attach individual plan file which are for SAME SP PROC. However I grabbed one after creating IDX's which are part of missing IDX hints and one after dropping them. Please let me know your thoughts. […] |
Rebuilding and Reorganizing Indexes - Hi all, I have SQL Server 2017 Edition and see harmful fragmentation for all tables in DB. I would like to rebuild and reorganize my indexes, but our system works 24/7. Could I do it with the online option because I read the different articles and see a different meaning regarding this? |
SQL Server 2017 - Development |
Creating and joining multiple queries (more than 2) - Hi, I know how to create and join 2 queries but on occasion Ive needed to join more than 2 and Im unsure how to achieve this? The method I use for joining to is as per the example below - can you just extend this as required? Select * from ( SELECT Stuff.Example1 Stuff.Example2 […] |
SQL Server 2016 - Administration |
Help with Actual execution Plan - Please advise on the attached execution plan. If they open as XML then please rename them as .sqlplan. I did save them as .sqlplan for now. You might need winzip to extract since I was unable to attach direct files. Thank you! |
SQL Server 2016 - Development and T-SQL |
Odd query question i did some basic digging but didn't find anything relevant. - SQL Server 2016 cursor and query: select * from table1 where col1 = '1' and col2 = '00001' and col3='I' and col4 = 'JULY--2015' this is a dynamically created query and for the most part the col1, col2 and col3 stay the same only the col4 changes in this test case. while all the other […] |
SQL query for First swipe in and Last Swipe Out for each day for each pay period - Hi, "EMPLOYEE" table has EmpName,EMPID . "SWIPE" table has SwipeTime_UTC,Swipe_location,EmpID . Note:Swipein and swipeout locations are different. SwipeTime_UTC is UTC time format. Looking for SQL query to generate the first swipe in and last swipe out for each employee on each day for given pay period.(Display time should be in EST). Any suggestions pls. Thanks. |
Running Sum w Window Function: is ROWS BETWEEN... clause required? - When creating a simple query to compute a running sum/total for each row using a window function [SUM() OVER(...)], I noticed that I forgot to include a clause to limit the frame from the first row to the current row. Nonetheless, the query returned the correctly calculated running total for each row, and I need […] |
Substring SELECT query from CREATE VIEW statement - Hi all, If you had the string "CREATE VIEW AS SELECT * FROM ;" How would you extract just the "SELECT * FROM ;" piece? I know you're probably thinking, "Uh, this is pretty fundamental...just use SUBSTRING with CHARINDEX". Maybe something like: DECLARE @sql AS VARCHAR(100) = 'CREATE VIEW AS SELECT * FROM […] |
Administration - SQL Server 2014 |
Slow database performance - Hi All, We are seeing serious I/O contentions issues on one of our database called "MarketingDB". Looking for some suggestions on how we can improve I/O demands for this database. Enabled Instant file initialization for data files to get some performance gain. All data files are in one drive and log file is in a […] |
SQL 2012 - General |
How to get duplicate on PartId and Company Id both and have different Status ? - How to get duplicate on Part Id and Company Id both and have different Status ? I work on SQL server 2012 I have issue I can't get duplicate on company id and part id and on same time have different status as partid 1211 and companyid 3030 repeated two times meaning two rows but […] |
There is insufficient system memory in resource pool - Not a DBA here. Now that that is out of the way... I am troubleshooting an issue where our SQL service is stopping. We are on SQL 2012 Express x64 11.0.2100.60 running on Windows Server 2008 R2 Standard x64. The Windows application event logs show: -Event ID 701: There is insufficient system memory in resource […] |
SQL Server 2012 - T-SQL |
Need help trying to find MAX Value in column - Good evening, I'm trying to find the MAX value on the TOC column, my current query does show all the values within the date range. What I just want to achieve is to just display a row with the MAX value of the TOC and the date. Note: I'm doing this query into an […] |
SQL Server 2019 - Administration |
Good book for a DBA that includes documentation on SSMS standard reports - Hey there! I recently took on a new position that entails more DBA type work, rather than development. (Although I am still developing on a day to day basis as well). Does anyone have any good recommendations on a book that goes in depth to administering and maintaining a SQL server? The company I currently […] |
SQL Server 2019 - Development |
CONCAT and CASE WHEN combined - Hi everyone, I'm trying to create a query that concatenates the directions field that were involved in each transaction_id. I've tried to do it by creating a flag table with multiple case whens, and then querying on it, but as you can see in the image below, I'm having trouble to get a multiple 1's […] |
Ranking number of occurrences - I am trying to add a column to a table that ranks the number of occurrences of repeated data. All I can currently find is how to count the repeated data, but I want the first occurrence to return 1, the second to return 2, and the third to return 3 ID Subtype Column […] |