Viewing 15 posts - 1,141 through 1,155 (of 10,144 total)
Yuri55 (10/12/2016)
October 12, 2016 at 7:47 am
mcampoam (10/12/2016)
Any difference in results or performance between the 2 examples? Names of tables/columns are generic below:
#1
update customer t1
set column_1 = x.value
FROM
(select id
, case
when column_2 is null ...
October 12, 2016 at 5:32 am
Can you post the actual execution plan of the update run in dev as a .sqlplan attachment please? As Jeff has pointed out, there may be tuning opportunities.
October 12, 2016 at 4:53 am
wendy elizabeth (10/11/2016)
October 12, 2016 at 2:32 am
Grant Fritchey (10/11/2016)
DesNorton (10/11/2016)
Grant Fritchey (10/11/2016)
If you're going to attempt to tune the query, you absolutely have to have the execution plans. There is no...
October 11, 2016 at 8:24 am
It shouldn't be too hard to replace this awful mess with something sensible and streamlined.
Here's an attempt to rewrite cte2 along more conventional lines. It's about 10 minutes worth
of effort...
October 11, 2016 at 3:49 am
This query has more repeats than the Disney channel. It's pointless attempting to tune it as it is. Pass it on to a professional TSQL dev to rewrite from scratch....
October 11, 2016 at 2:21 am
Jeff Moden (10/8/2016)
Eirikur Eiriksson (10/8/2016)
Ouch ...biting the tongue....😎
We all know the reason for the given answer... she simply doesn't know any better method even after she's been shown how to...
October 10, 2016 at 1:53 am
pietlinden (10/7/2016)
Isn't this as simple asSchool--(1,M)--Locker--(1,M)--LockerAssignment--(M,1)---Student
and
LockerAssignment--(M,1)--SchoolYear
From that you can join the tables and get all the current locker assignments etc.
I guess it could be, if there's a...
October 7, 2016 at 9:32 am
wendy elizabeth (10/7/2016)
Since the data is duplicated for each school per school year,...
I didn't say that. I said that if you query for any school year, you will...
October 7, 2016 at 9:13 am
Eirikur Eiriksson (10/7/2016)
😎
USE TEEST;
GO
IF OBJECT_ID(N'dbo.temp') IS NOT NULL DROP TABLE dbo.temp;
create table dbo.temp(Companyid varchar(10) not null,companyname varchar(100) not null,DateFrom datetime not null, DateTo datetime null);
INSERT INTO temp values('A1','A...
October 7, 2016 at 8:11 am
Your request is almost certainly possible, however your own difficulty with it hints that there may be a simpler option. What about this?
SELECT t.*
FROM #temp2 t
WHERE t.DateTo IS NULL...
October 7, 2016 at 7:26 am
Super_Grover (10/7/2016)
Turned out I was thinking waaay too complex. I ended up with...
October 7, 2016 at 6:42 am
wendy elizabeth (10/6/2016)
Note: I did not list the following...
October 7, 2016 at 3:34 am
This becomes a little more interesting if you increase the complexity of the query:
CREATE PROCEDURE [dbo].[test04]
(@NUM INT)
AS
SET NOCOUNT ON;
IF (@NUM > 0)
BEGIN
SELECT p.n --
FROM dbo.Numbers NM
INNER...
October 7, 2016 at 3:02 am
Viewing 15 posts - 1,141 through 1,155 (of 10,144 total)