SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Interview questions - dont know answers
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

cshah1
Constraint Violating Yak Guru

347 Posts

Posted - 03/29/2005 :  08:59:17  Show Profile  Reply with Quote
Bravo! RobVolk..

Jeff(Dr. CrossJoin)..Tara (Tduggan), Mladen(spirit1)..Nigel(nr)

I have leanred more from readinig your posts here at SQL team then even reading several books on SQL..Thanks to all of you..!

Edited by - cshah1 on 03/29/2005 09:04:51
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

USA
4184 Posts

Posted - 03/29/2005 :  14:43:50  Show Profile  Visit derrickleggett's Homepage  Send derrickleggett an AOL message  Send derrickleggett a Yahoo! Message  Reply with Quote
Oh my, you REALLY need to check out some good books then.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

hgorijal
Constraint Violating Yak Guru

India
277 Posts

Posted - 03/30/2005 :  05:30:49  Show Profile  Reply with Quote
quote:
Originally posted by robvolk

I like to use this analogy a lot: you have a cup of coffee (or tea), and you want to put sugar in it. You can use tweezers, or a spoon. Cursors are tweezers.

Seriously. Suppose you will only drink one cup of coffee in your life, would you still use tweezers to sweeten it?




B-E-A-Utiful analogy. I always struggled for an analogy to explain to developers about using set based operations as opposed to cursors.

You haven't patented it. have you? Rob



Hemanth Gorijala
Exchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each.
Go to Top of Page

Xerxes
Aged Yak Warrior

USA
665 Posts

Posted - 03/30/2005 :  15:32:29  Show Profile  Reply with Quote
Using tweezers ain't so bad, maybe you're trying to knock down your cholesterol?

Semper fi,
XERXES, USMC(Ret.)
------------------------------------------------------
The Marine Corps taught me everything but SQL!
Go to Top of Page

robvolk
Most Valuable Yak

USA
15668 Posts

Posted - 03/30/2005 :  21:06:31  Show Profile  Visit robvolk's Homepage  Reply with Quote
Sugar has no cholesterol anyway. Thank god too, ever since I had to stop putting rare steak in my coffee I've been looking for a suitable substitute.

And have you ever tried putting a large sirloin into a cup of coffee with tweezers???? You thought sugar was tough...
Go to Top of Page

elwoos
Flowing Fount of Yak Knowledge

United Kingdom
2050 Posts

Posted - 03/31/2005 :  03:13:16  Show Profile  Reply with Quote
What about sugar cubes


steve


A sarcasm detector, what a great idea.
Go to Top of Page

coolerbob
Aged Yak Warrior

United Kingdom
841 Posts

Posted - 03/31/2005 :  08:59:50  Show Profile  Reply with Quote
robvolk,

you mentioned at the end of page one the usefullness of covering indexes. How much should I strive towards making these? Afterall sometimes you just cant have them because of bit/text columns and then SQL will have to go to the table. Is that a big performance hit?
Or can I ignore that and try and always get as close to a covering index as possible?
Go to Top of Page

robvolk
Most Valuable Yak

USA
15668 Posts

Posted - 03/31/2005 :  10:43:31  Show Profile  Visit robvolk's Homepage  Reply with Quote
You should always test any indexes you add to make sure they actually help. Run tests and check execution plans before and after creating a covering index. If you see an improvement (faster access and/or seeks instead of scans) then you should keep the index.

Indexes are always a balancing act; too many slow down INSERTs and UPDATEs, too few slow down SELECTs. There's no way to know for sure without trying.
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 04/08/2005 :  13:31:32  Show Profile  Reply with Quote
"What about sugar cubes"

Me too mate. I thought "Sugar lumps, and those nice silver sugar tongs my grandma had", those Yanks are bound to call them Tweezers!

Kristen
Go to Top of Page

jerryvn01
Starting Member

3 Posts

Posted - 07/08/2010 :  05:02:02  Show Profile  Visit jerryvn01's Homepage  Reply with Quote
quote:
Originally posted by coolerbob

I can't see how any of the objections you guys made effects me in my situation. I agree that in most situations it is not the best thing to use. But I am writing a one-off data conversition at the moment. The code will run once and then never again.
I am often running into all sorts of situations where cursors seem best. Like when I need to go through a whole table and depending on one of 7 possible values I need to: set a column value in the same table, set a column value in a different table, or insert a records in a different table.
I cant see why cursors are a bad idea in this situation and I cant see a better/faster option either.
Any takers?



Hi,

I do not agreed with you. Any way, your ideal make me thinking about some thing for my project.

Apart from that, this link below may be useful:
Please try to keep posting. Tks and best regards

Edited by - tkizer on 07/28/2010 13:12:10
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 07/08/2010 :  10:36:29  Show Profile  Reply with Quote
Check this out. See if all this folks can be wrong. There are enough compelling reasons to avoid them at almost any cost.

http://tinyurl.com/3a3294t

Edit: Any reason to reply to a topic that has been dormant for 5+ years?

Terry

-- A word to the wise ain't necessary - it's the stupid ones that need the advice. -- Bill Cosby

Edited by - tosscrosby on 07/08/2010 10:37:25
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 07/28/2010 :  11:52:34  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
Spam post?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 07/28/2010 :  13:12:26  Show Profile  Visit tkizer's Homepage  Reply with Quote
I edited out the spam link.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

vegetablevn
Starting Member

1 Posts

Posted - 08/05/2010 :  20:46:22  Show Profile  Reply with Quote
<spam removed>

Edited by - vegetablevn on 08/30/2010 03:03:55
Go to Top of Page

hamburg113
Starting Member

3 Posts

Posted - 04/20/2011 :  10:59:29  Show Profile  Visit hamburg113's Homepage  Reply with Quote
Hi

This topic help me a lot in developing my project. I will contribute more when I finished it.
Go to Top of Page

patricholier
Starting Member

3 Posts

Posted - 04/20/2011 :  22:29:39  Show Profile  Reply with Quote
Hi

I found that a member asked same question in this forum some months ago.

Pls use search box to find this questions with comments

If you want to get more materials that related to this topic, you can visit: unspammed

Best regards.

Edited by - patricholier on 04/27/2011 03:58:24
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 04/21/2011 :  01:36:54  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
If you look, this thread is 6 years old...

--
Gail Shaw
SQL Server MVP
Go to Top of Page

mmarovic
Aged Yak Warrior

Czech Republic
518 Posts

Posted - 04/21/2011 :  16:32:06  Show Profile  Visit mmarovic's Homepage  Send mmarovic a Yahoo! Message  Reply with Quote
Old it is, but it is worth bringing it to light. Too bad I did not know about it when I wrote my "real life analogy" for cursors.

Mirko

My blog: http://mirko-marovic-eng.blogspot.com/
Go to Top of Page

robvolk
Most Valuable Yak

USA
15668 Posts

Posted - 04/21/2011 :  16:36:58  Show Profile  Visit robvolk's Homepage  Reply with Quote
What was your real life analogy for cursors?
Go to Top of Page

reddymrk
Starting Member

USA
6 Posts

Posted - 04/21/2011 :  16:59:21  Show Profile  Reply with Quote
If you do not have integrity issues(Primary/Foreign key) on the particular table, you can copy 5000 rows to different table(temporary table) and truncate the original.
Once truncate the table, you can recopy the data from temporary table, so that you wont loose any constraints associated with original table.
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000