Viewing 15 posts - 571 through 585 (of 1,114 total)
I have noticed one interest thing from all the three methods ( My old method, new method , Chris's method ), i got the same output.
ID ...
July 17, 2008 at 9:10 am
Thanks Chris !
I am not offending you, i am asking this question politely.
Jeff's Sample code:
--===== Right way to do a "Joined" update
UPDATE TableA
SET SomeTableAColumn =...
July 17, 2008 at 9:07 am
Nearly correct, Karthik, but not quite...
I think i have followed the new join method.
Can you highlight where i did mistake ?
July 17, 2008 at 8:52 am
As you suggested, i have tested both the scripts with SET STATISTICAL TIME ON.
update #t1
set #t1.Name = T.Name
from T inner join #t1
on #t1.ID =T.ID
Execution Time 0.
SQL Server cpu time:...
July 17, 2008 at 8:49 am
After modifying Name column as Name = convert(varchar(50),'') , i have executed my modified code.
select distinct ID, Name =Convert(varchar(50),'')
into #t1
from T
update #t1
set #t1.Name = T.Name
from T inner join #t1
on #t1.ID...
July 17, 2008 at 8:44 am
What size column do you thing NAME = '' will make?
Jeff,
Thanks for highlighting this area.
I have executed my previous code.
select distinct ID, Name =''
into #t1
from T
update #t1
set #t1.Name =...
July 17, 2008 at 8:42 am
In order for it to be "legal", TableA must also be in the FROM clause or the huge performance problem could take place. General rule to follow on joined...
July 17, 2008 at 8:39 am
Jeff,
Sorry for the delay !
create table T
(
ID int,
Name varchar(50)
)
insert into T
select 1,'John'
union all
select 2,'Mary'
union all
select 1,'Jerry'
union all
select 2,'Karthik'
union all
select 3,'Kumar'
union all
select 3,'Raghu'
select distinct ID, Name = CONVERT(varchar(50),'')
into #t1
from T
Here, i...
July 17, 2008 at 8:31 am
Because i saw more than 4 answer for this post so far.
July 16, 2008 at 7:47 am
which one is good when we think performance ?
July 16, 2008 at 7:46 am
Jeff,
how about my code ?
July 16, 2008 at 7:45 am
Select distinct id, Name = ''
into #t1
from Data
update #t1
set Name = Name
from Data
where #t1.id = Data.id
July 16, 2008 at 3:12 am
use distinct keyword
July 15, 2008 at 5:37 am
Viewing 15 posts - 571 through 585 (of 1,114 total)