Viewing 15 posts - 1 through 15 (of 17 total)
Yep, you're right...didn't catch that subtlety in the requirements. This should do the trick:
select yr,
month,
member,
(select count(distinct code)
from #testtable t3
where t1.yr = t3.yr
and...
November 21, 2011 at 10:54 pm
I believe all you need is a delete with an EXISTS:
delete a
from tableA a
where exists (select 't'
from tableB b
where a.Name= b.Name)
Let me know if that works.
SB
November 21, 2011 at 9:32 pm
There are several problems here. First, we don't have the structure of my_table. I'm assuming in the code below that it includes 3 columns and that you want...
November 21, 2011 at 9:24 pm
Jeff, are you referring to the IGNORE_DUP_KEY option?
November 21, 2011 at 8:32 pm
By "inserting in batches" do you mean breaking up the insert into batches? Such as doing 10,000 rows at a time instead of doing all 1 billion rows at...
November 21, 2011 at 8:26 pm
Try this: (I'm using the test data posted by Jeff Moden earlier...tks Jeff 🙂 )
selectyr,
month,
member,
count(*),
(select CASE
WHEN ROW_NUMBER() OVER (ORDER BY t1.yr, t1.month, t1.member) = 1...
November 21, 2011 at 8:02 pm
Greetings,
It depends on 2 things:
1. Do you want to delete all the rows or just leave one of the duplicates in there?
2. If you just want to...
November 21, 2011 at 7:36 pm
If you open up the table in Object Explorer and expand the columns, do they have the right names? (Be sure to right-click on the table and hit 'Refresh'...
November 21, 2011 at 7:02 pm
aschoch: Finally got around to trying your CDATA suggestion, but it only prints out 8,192 characters. I think the key is to use the FOR XML clause. ...
August 21, 2009 at 3:13 pm
That is interesting. Does this work for anyone else out there?
SB
August 21, 2009 at 5:57 am
mjarsaniya suggested that in a previous post, but I tried it and it only printed out 8,192 characters.
August 20, 2009 at 3:02 pm
OK...I have fixed the bug and reposted the SQL as an update to this article. It's a very simple fix. Just remove the '+ 1' in Line 70...
August 20, 2009 at 10:27 am
Sorry for not replying sooner...
thakur_samir: The option you mentioned DOES affect the length of the string that is displayed, but it has a max value of 8192. Try...
August 19, 2009 at 6:47 am
Regarding the reply by aschoch: I'm not sure how your suggestion works...you mentioned that you ran this query:
SELECT CONVERT(xml, '') AS DataXML FROM MyTable
However, I don't see a column...
July 30, 2009 at 8:52 am
Referring to the last post about the XML FOR PATH functionality, this is very interesting, but it has one issue: when you have the "" characters in the string,...
July 29, 2009 at 1:01 pm
Viewing 15 posts - 1 through 15 (of 17 total)