Viewing 15 posts - 301 through 315 (of 1,464 total)
You can take this further and split the rows into columns like this
DECLARE @XMLData xml;
SET @XMLData = '<PlaceDescriptions>
<descriptions>0|Home</descriptions>
<descriptions>1|Office|False</descriptions>
<descriptions>2|Play Ground</descriptions>
<descriptions>3|School|True</descriptions>
<descriptions>4|Movie Hall</descriptions>
</PlaceDescriptions>';
WITH cteXML AS (
SELECT descriptions...
October 25, 2020 at 5:32 am
Firstly, you don't need to use sp_xml_preparedocument and OPENXML.
Secondly, your xml is not properly formed - There is an extra ">" before "</PlaceDescriptions>"
Below is code that will extract the descriptions...
October 25, 2020 at 5:09 am
I love the use of math to solve this. However, I am stumped as to why/how the math works. An explanation for Dummies would be greatly appreciated.
y /7...
October 22, 2020 at 8:25 am
I love the use of math to solve this. However, I am stumped as to why/how the math works. An explanation for Dummies would be greatly appreciated.
y /7 -- Full...
October 21, 2020 at 7:40 am
You will need to test, but using PATINDEX *might* give you slightly better performance.
SELECT T1.DocumentNo, T2.LongSentence
FROM Table2 T2
INNER JOIN Table1 T1 ON PATINDEX('%' + T1.DocumentNo + '%',...
October 20, 2020 at 4:39 am
Since your query is returning no results, it cannot display a yes/no answer.
What you need to do is change it so that it always returns a result
SELECT...
October 19, 2020 at 8:43 am
Looks like you are missing a closing quote in the WHEN part of your case statement.
October 19, 2020 at 8:11 am
Here's my version, also no recursion, with added alias names for more clarity:
SELECT
start_date, end_date,
full_weeks * 2 +
...
October 16, 2020 at 3:33 pm
You can use a splitter function, and a cross tab to get what you are looking for
DECLARE @TestData table (JoinedData varchar(50));
INSERT INTO @TestData ( JoinedData )
VALUES (...
October 14, 2020 at 6:53 am
In my previous post I stated that you would find more data anomalies - Wonder how I knew that.
This is not something that can be fixed with a single query. ...
October 9, 2020 at 7:12 am
Based on the latest sample data that you provided, this code works.
However, I fully expect that you will get other non-compliant records.
You can keep tweaking the code to the point...
October 8, 2020 at 10:14 am
Your downfall here is going to be trying to do it all at once.
You cannot touch the vendor DB, but there is nothing stopping you from creating your own staging...
October 8, 2020 at 9:32 am
That speaks to a record whose data does not match the pattern of data that was used for creating the solution at hand.
You will need to find the record(s) that...
October 7, 2020 at 2:38 pm
That code will not work for a declared table variable.
It is for a table parameter as requested in the original post.
Also note that the code is looking for the declared...
October 7, 2020 at 7:24 am
Viewing 15 posts - 301 through 315 (of 1,464 total)