Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question In the attached scenario, one of the column “result” is showing fail in one of th…
Tag: sql-server
T-SQL – Flagging Common Values in One Column Based on ID and updating the database
Problem Statement: There are Two Columns, VariableName and ID. I want to map variables in the same column with a two-character alpha code such as ‘aa’, ‘ab’, ‘ac’, ‘ad’…. up to ‘zz’ in T-SQL. To Illustrate, Input Data: Desired Output As you can…
Didnt print on Procedure on SQL
So I try to print a message when I have any confirmation or error. I have this table [Friendship] that have the ID, friend mail, their mail and the date that have been confirm the friendship, Table without data When I use the EXEC for this PROCEDURE, I have the insert values, but not the print´s acctions̷…
Syntax issue with CTE to Pivot function
I’m having a problem getting syntax correct from variables to CTE to Pivot. I’m capturing sp_whoisactive to a table and am now aggregating CPU and Duration by Region. I then want to pivot those …
how to Update an empty table with the result of a query
i have a table name average rating. i want to update my table name final rating with the result of this query how can i do this? Answer Maybe something like or if the FinalRating table contains more information you could also specify the columns you can also add a where clause to either query if you need a su…
Extrapolate Data
I have the following two tables in my database. One holds transaction data and the other holds development periods. How can I extrapolate the data into the future development periods like below? Answer One method uses cross apply:
How can I select data from my database in time intervals?
Suppose I have the following table in a database: ID | Date | Data | —————————— 0 |2020-01-01 08:00 | 123 1 |2020-01-01 08:01 | 456 2 |2020-01-01 08:02 | 789 3 |…
Search function stored procedure with multiple fields not returning expected results
I have a simple table with 4 rows as follows: | person_ID | FirstName | LastName | Phone | Email | +———–+———–+———-+————+———————–+ | 1 …
How to convert date integer keys into datetime in SQL
after a lot of struggle, I cannot convert datekey (20200430) and timekey (103500) into proper datetime (2020-04-30 10:35:00). I do not have an option of joining on date dimension, the numbers must be …
Find Gaps in a single date column SQL Server
Good Day everyone, I need your help. I am trying to detect gaps in a single column of the type Date or DateTime in SQL Server. Say we have a list of schools and each school has many records and there is a field of uploadDate. So something like that: My outcome would be something like that: Thank you all.