Generate JSON with property names that include dot using SELECT FOR JSON
I need to generate the folowing JSON payload (shortened) from a table in SQL Server. Please note the dot in the property name. This is a special syntax called OData.
I need to generate the folowing JSON payload (shortened) from a table in SQL Server. Please note the dot in the property name. This is a special syntax called OData.
I am having trouble designing a query. I have a list of PersonIds for records in a Persons table. I would like to have a single query that takes this list of PersonIds and returns other records in the table that match each input person’s date of birth and gender, aggregated by the InputPersonId, so each returned record would have:
I need your help please since I am stuck here and not sure how to fix this.
I’m trying to get Data inserted and then Deleted in the same query.
I found that one could use a menu to “discard” results in SSMS (TSQL language). Please see: Original Question about inhibiting results and its answer.
I need a T-SQL script to change two rows to one row. The rows are grouped by Student ID and Unique Course Identifier. The second row columns in the groups for the Days, Start Time, End Time, Start Date, End Date, Building and Room need to be on the first row in the columns on the right which are Days2, Start Time2, End Time2, Start Date2, End Date2, Building2 and Room2. There’s no aggregate so it doesn’t seem like I would want to use pivot. It looks like it might be possible with Union All or for xml path. What is the script for that? SQL Server 2014
I work on sql server 2012 i face issue i can’t make select statment
get Partid from last month until current month march (3)
.
I am using SQL Server 2019. I am using SQL Server Management Studio on the client side.
I have a date as varchar (dont ask why). I need to select Max(date). However, date can be faulty, like 2034-34-34. I would like to select max date that is valid and not greater than today. It’s t-sql.
I have a function (which I found here years ago) that uses STUFF
/ PATINDEX
to strip out non-alphanumeric characters from a string. When running on a Case Insensitive collation, it works fine. Recently I needed to use it on a Case Sensitive collation DB and found some odd behaviors. If the %pattern% for PATINDEX
is just specifying lower case (ex: %[^a-z0-9_-]% ), then all upper case “Z”s are removed when the Collation is Latin1_General_100_CS_AS. If the Collation is SQL_Latin1_General_CP1_CS_AS, then upper case “A”s are removed. Is this a bug or did I miss something?