Transaction Log Cannot Be Truncated After Memory-Optimized Filegroup Removal
Hello there, One of our clients is facing an issue with a database where the memory-optimized filegroup was forcibly removed using DBCC CHECKDB (test, REPAIR_ALLOW_DATA_LOSS). The database remains functional, but the transaction log continues to grow and…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
Sortable MVC Tables with Stored Procedure
Hello everyone and thanks for the help in advance. I am developing a MVC application that requires a sortable table. The issue is that the tables utilize queries that are best suited for stored procedures. While researching, I cam across older…
![](https://techprofile.blob.core.windows.net/images/BShhHLCLI0-r4Esm5bkqDQ.png?8D8B44)
How granting the execute permission for several stored procedures - SQL Server 2019
Hi, in order to review some security aspects about a SQL Server 2019 instance I need to assign the execute permission for several stored procedures to a db_datareader and db_datawriter user without operating one by one. How could I accomplish a such…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
Best practices for joining tables of different collation property database
Hi, I am trying to join two tables of databases present on same server but with different collation property and getting following error: What are the best practices to join tables of different databases present on same server but with different…
Scalability LEFT JOIN vs MERGE
Hi there, I'm UPSERTING AND handling 70 + millions of rows of UPSERT. I'm the only developer on the DB. GP_Gen5_6 LEFT JOIN DURING UNIT TEST OF ALL RECORDS 12 mins SCALED UP OVERNIGHT PROCESS GP_Gen5_20 History of existing MERGE process same operation…
![](https://techprofile.blob.core.windows.net/images/LaMnhm6dYUm819lrFKr8rA.png?8D834F)
How to access skillpipe.com site
Hello, A few years ago I took a Microsoft course related to Transaction-SQL. All learning materials were provided by instructors from skillpipe.comsite. I liked it very much.. Obviously I have an account to access it. Now I can’t access it. I used this…
![](https://techprofile.blob.core.windows.net/images/YC3KiAudCk6A0I6NB9vOyA.png?8DA953)
Breakdown text into multiple records
Greetings... I'm working on a SQL Server query where I have to breakdown text stored in Comments column which is of datatype varchar(max) into multiple records. For instance, if there are 280000 characters in the Comments column then it should be…
![](https://techprofile.blob.core.windows.net/images/YC3KiAudCk6A0I6NB9vOyA.png?8DA953)
An expression of non-boolean type specified in a context where a condition is expected
Hi, I have an issue with this stored procedure (code below), it returns me the following error: An expression of non-boolean type specified in a context where a condition is expected, near 'seque'. Can you please help me with it ? Thank you DECLARE…
Select with Conditional COUNT
Hello everyone and thanks for the help in advance. In a prevous post https://learn.microsoft.com/en-us/answers/questions/2148980/counting-occurrences-in-a-table, Erland Sommarskog built a query for me that counted the occurrences of vaccines by patient.…
Invalid object name 'STRING_SPLIT' in SQL Server 2019
Hi Support, Our SQL server version is 2019 and check the compatibility level is 150, but it still have error "Invalid object name 'STRING_SPLIT' ". We also tried the case sensitive according to this link, both of them have the same error. …
How to figure out the total number of doses within a time span given to a client as dose are being added and stopped.?
If the cadence values are different, even if the dates overlap the records must be separate. If an order for the same dose and cadence value (including nulls) starts on the same day or the next day (+or-1 day) the record should continue. outlook of…
Run SQL Statements Parallel within a SP
Hi there, Is there a way to run SQL Statements in parallel within the same SP? Thanks for your time. CREATE PROCEDURE CustomerPARALLEL AS BEGIN EXEC DBO.CUST1 - TAKES 20 MINS (INDEPENDENT) EXEC DBO.CUST2 - (TAKES 20 MINS (NO DEPENDENCY)) HOW TO…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
Microsoft SQL Server Studio - Dark Mode
Is there any official method to use Microsoft SQL Server Management Studio Studio with Dark Mode?
![](https://techprofile.blob.core.windows.net/images/XHDS-x5WFEm9V1LmsTe7Fg.png?8DBFD6)
How to get a CSV file from a T-SQL in SQL Agent
I am using SQL agent to schedule a task. This task is the execution of a script that performs a query to several databases and concatenates the output. I have managed to obtain a file but not a CSV file, that is, I cannot obtain a file separating the…
![](https://techprofile.blob.core.windows.net/images/kOe4pxb1uU20oy6qmzWJZQ.png?8DAD2E)
SQL gaps and island issue
Greetings!!! We're working on migrating data from a legacy application and have a requirement to get all the consecutive SESSION START_DATE & END_DATE. For the SESSION_ID - 8642, SESSION_TYPE - 3256, based on the requirement using sql server query…
![](https://techprofile.blob.core.windows.net/images/c4mRkDtLdU6n6fSv2i9uBg.png?8D843C)
A Simple SQL Query
I have the following table:- I want Col 1 and Col 2 where Col2 =1 and the corresponding all the values of Col 1 where Col 1 =2. But this is an example. I can find 1st part (i.e,, Select Col1, Col 2 from Table1 where Col 2 =1). But my problem is how do…
![](https://techprofile.blob.core.windows.net/images/_KR_hQAAAwAAAAAAAAAAAA.png?8D8440)
Find ALL UNUSED columns on SQL DB Tables
Hi there, Is there a way in AZURE SQL Server to find all columns of a table which are NOT used by ANY SPs or Views. I have 65000+ columns in DB based on information schema columns. I do see 200+ SPs of which not all columns are used. Some have select *…
How to write a Simple TSQL
I have the following table:- I have two requirements. the 1st one is, I need ColA and ColB when ColB is 1. So the query would be:- Select ColA, ColB from Table1 where ColB =1. The Output of the 1st requirement is:- Now the 2nd requirement is, as the…
UPSERT - CAPTURE UPDATED ROWS INTO ANOTHER AUDIT TABLE
Hi there, I'm trying to do soft delete on a target table which are not in source. Basically if the ID is not in source but ID is in target, update that RecordStatusKey of that specific target ID. I would like to capture the records updated in merge. Is…
Counting Occurrences in a Table
Hello everyone and thanks for the help in advance. I need to develop a MVC application that reads a SQL database of patients who have received vaccines. The table looks like: [ID] [int] IDENTITY(1,1) NOT NULL, [MRNumber] [varchar](50)…