Viewing 15 posts - 826 through 840 (of 2,645 total)
WITH SampleData2 (PERSONNUM, [ORGPATHTXT]) AS
(
SELECT 231089,'./Company/20-00001/120---30-00006/40-00506/50-99506/60-29145/97455001/0097455001/Fire-Grill'
UNION ALL
SELECT 121564,'./Company/20-00001/120---30-00006/40-00073/50-00075/60-26275/68990001/0068990001/Location3/Burger-Cook'
UNION...
August 31, 2021 at 7:24 pm
If you think it will be faster using a seek then just force the query to do a seek and see if it's faster
select ol.ord_no, pl.ID
...
August 25, 2021 at 6:04 pm
I generally never put error handling into a stored procedure unless I want to take some specific action inside the stored procedure for that error. If an error is raised...
August 23, 2021 at 4:01 pm
There are some caveats to that should've been mentioned. The string is declared as NVARCHAR(MAX) because I don't know that that's not appropriate. The ordinal splitter is name...
August 11, 2021 at 4:07 pm
August 2, 2021 at 11:14 am
Here's a way, though it would be pretty stupid to do it.
SELECT x.CustomerID
FROM (SELECT c.CustomerID, 0 Col1
...
July 29, 2021 at 11:27 pm
Maybe they meant using a set operator. In which case you would use EXCEPT not UNION.
SELECT c.CustomerID
FROM [Customers] c
EXCEPT
SELECT o.CustomerID
FROM [Orders]...
July 29, 2021 at 11:23 pm
The single query method did not work, even after changing s2.Value to s2.ColName in the necessary spots.
Yes, I see why now, the join on the update query returns more...
July 28, 2021 at 4:05 pm
Other than using dynamic SQL I think you will have to do it like this:
In 2 statements
UPDATE s
SET s.Col1 = s2.Value
FROM #sample...
July 28, 2021 at 3:42 pm
I don't understand how adding a column can add rows.
Can you show us the code?
July 12, 2021 at 4:09 pm
Is the table clustered on ID?
Have you got any other indexes on the table?
Have you looked at the execution plan?
July 1, 2021 at 4:36 pm
As we don't know what the processing is no one will be able to say whether or not a DYNAMIC READ_ONLY CURSOR is the best way to process your data. Can...
June 29, 2021 at 1:49 pm
Can this be achieved without using ranking function
Yes, the ROW_NUMBER() function is unused so does nothing.
June 29, 2021 at 11:23 am
What error are you are getting?
June 29, 2021 at 10:29 am
SELECT BusinessEntityID,
FirstName,
MiddleName,
LastName,
...
June 29, 2021 at 10:25 am
Viewing 15 posts - 826 through 840 (of 2,645 total)