My goal is to pull out the values shown in red in the picture. I used this query to pull the data together. The rows are associated via ActionID and filtered with the ‘AND’ conditions shown. SELECT […
Tag: sql-server
How to extract list of values from JSON in SQL Server
In a SQL Server database, I have a table that contains 2 columns, ID and JSON. The JSON column contains JSON-formatted text. I have access to ISJSON, JSON_VALUE and JSON_QUERY, but not OPENJSON. I am …
T-SQL Convert Arithmetic Formula into its Components
Problem Statement: I have a Formula column that has the arithmetic operation in it. I want to extract the variable names from the formula, and delimit the variables with a comma and create a New …
SQL select single row number x only
For processing SQL data in VBA I want to use a loop (For…Next) that reads line by line from a SQL database. As records were deleted the ID column has gaps. The table looks for example like this: Having four lines I would like to run of course a “For each” would do good, too. Answer If you wa…
T-SQL: removing Time and Preceding characters from nvarchar column
I have a comments column in a SQL Server database table of type nvarchar and typically contains text along the lines of: I am trying to find a way in the select statement to remove the character pattern of ‘#:#:# AM/PM’ and everything preceding it leaving me with “Blah Blah…” In …
Creating Flutter Web Server that connects to an SQL server
I want to create a Flutter web server that has an SQL connection. Just like in PHP we can connect to the SQL server like this: // Connecting to DB $conn = new mysqli($servername, $username, $password, …
How to get just one result when using MAX and GROUP BY
I would love some help on this query: select * from STORAGE_MOVEMENT where object_id = 43500 and current_location != 6411 and object_class = ‘SAMPLE’ Here’s what I get: I’m trying to fetch only …
Error in SSMS when running query from SQL On-Demand endpoint
I am attempting to pull in data from a CSV file that is stored in an Azure Blob container and when I try to query the file I get an error of File ‘https://.blob.core.windows.net/&…
SQL delete except select result
I have these 3 tables, and i want to delete from all records except some already used request Registry Record Request and i use this query which brings me all the rows i want to delete. How to use delete in this case? Answer
SQL: read text inside the span HTML element returned by a query
I have one query that returns the following HTML element: My query currently looks something like this: How shall I change this query to return only the text inside the span element shown above? In the example above the result should be the string: I am not sure how to extract this text using SQL.. DBMS imple…