Viewing 15 posts - 106 through 120 (of 1,435 total)
This can be achieved using a Cross-Tab query.
Static and Dynamic cross-tab queries are dealt with expertly and in great detail in these two Jeff Moden articles:
http://www.sqlservercentral.com/articles/T-SQL/63681/
http://www.sqlservercentral.com/articles/Crosstab/65048/
August 18, 2022 at 5:07 pm
DOUBLE is not a valid data type in SQL
https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-ver16
August 17, 2022 at 5:35 am
Looking at this from a different angle ....
If you click on the upper left corner, it highlights all the cells. That way you wont have a highlighted cell in the...
August 13, 2022 at 7:01 am
Try this
WHEN LTRIM(S1UPSP) LIKE 'RIOUS%' THEN '0'
or this
WHEN PATINDEX( '%RIOUS%', S1UPSP) > 0 THEN '0'
Is it possible that leading "spaces" are not char(32), but...
August 10, 2022 at 8:55 pm
Something like this ...
CASE
WHEN CHARINDEX(' ', S1UPSP) > 0 THEN '0' /* S1UPSP Contains spaces */
WHEN LEN(S1UPSP) = 10 THEN RIGHT(S1UPSP, 8) /*...
August 10, 2022 at 7:24 pm
You can read THIS ARTICLE on Splitter functions by Jeff Moden.
At the end of the article, you will find a link "The New Splitter Functions.zip" that will...
August 8, 2022 at 9:38 pm
Perhaps a small tweak to Piet's 1st answer
SELECT src.*, v.val
FROM #t1 AS src
CROSS APPLY (SELECT val = COUNT(DISTINCT(NULLIF(RTRIM(x.val), '')))
...
July 27, 2022 at 9:04 am
I believe that this can be simplified as follows
CREATE TABLE #parts ( PartNumber varchar(50)
...
July 26, 2022 at 6:03 am
I stand to be corrected, but the pattern appears to be as follows
July 25, 2022 at 2:03 pm
I gave you an example of how to use the OUTPUT clause, leaving you to modify it to work with your MERGE statement.
These links should help you further
July 22, 2022 at 2:28 pm
Doing this with a simple UPDATE, you can construct an output as follows
CREATE TABLE #Employee (
Emp int...
July 21, 2022 at 3:55 pm
You can't embed the varchar @BookId directly into your query.
You can make your whole query dynamic and embed @BookId into it. NOTE: This is very dangerous.
You can shred your @BookId...
July 10, 2022 at 9:04 am
As a 1st guess, I would think that either C2.ts_primarysecondaryfocus or C2.ts_ukrow has a BIGINT data type.
If that is not the case, then start by commenting all of the fields...
July 10, 2022 at 8:40 am
You can use PATINDEX to find the a=(any 3 integers), then use STUFF to replace the (any 3 integers) with 999
DECLARE @x table (y varchar(50));
INSERT INTO @x...
July 8, 2022 at 8:45 am
Viewing 15 posts - 106 through 120 (of 1,435 total)