Viewing 15 posts - 2,101 through 2,115 (of 5,678 total)
David Moutray (12/10/2011)
Here is the result set I got when testing Craig's query:Order ID-Detail ID-Item ID--Item Type---------Equipment Group
463-----1--------500------Equipment---------500
463-----2--------550------Equipment---------550
463-----3--------732------Accessory---------500
463-----4--------744------Accessory---------525
463-----4--------744------Accessory---------592
463-----5--------785------Accessory---------550
463-----5--------785------Accessory---------500
463-----6--------788------Accessory---------788
I'm curious how. Here is my result set, with a direct copy/paste...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 10, 2011 at 11:21 am
David Moutray (12/10/2011)
Craig's solution looks perfect to me, but I think there may be a logical flaw in the question.Here is the result set I got when testing Craig's query:
Odd,...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 10, 2011 at 11:17 am
sqlfriends (12/9/2011)
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 5:45 pm
texpic (12/9/2011)
Jeff, yes. In probably 1/2 the databases I have full permissions, the rest I work with temp files.
Pull the data over into a local sandbox? There's really...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 5:42 pm
Rob Schripsema (12/9/2011)
General dairy farm labor (lots of manure)
General chicken/egg ranch labor (more manure)
Soda jerk (as in ice cream sodas, OK?)
Furniture mover
More farm labor (apple orchards)
Psychiatric hospital aide (more...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 4:50 pm
LutzM (12/9/2011)
Wouldn't the UNPIVOT approach be a little easier?
:blush: Yes.
Pardon me, I need to find a mirror. I know someone who deserves a facepalm and I need to...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 3:15 pm
A note or two as comments in the code, but let me know if anything here ends up confusing.
SELECT
o.*,
CASE WHEN o.ItemType = 'Equipment' THEN CONVERT( VARCHAR(20), o.ItemID)
ELSE ISNULL( CONVERT(...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 3:01 pm
tarr94 (12/9/2011)
I added a couple of records to the RelatedItems table to further clarify my problem (I've updated my initial...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:53 pm
It's possible you just aren't familiar with the proper terminology for what you're looking for.
Google: T-SQL Proper Case
You'll get a few hundred hits.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:46 pm
Marios Philippopoulos (12/9/2011)
My bad, you are right! 🙂
LOL, no worries, we all do it occassionally. 😉
Here is a script that creates a table and populates it with two records...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:44 pm
rwsmith 38519 (12/9/2011)
Craig, by the way, Evil Kraig is a cool pen name....
Heheh, thanks. It really started with a mis-spelling by someone ubobservant, but I couldn't resist the concept...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:28 pm
Parakiti,
I think I get what you're asking for, but I'm not quite sure. As mentioned above, sample schema, data, and desired results from that sample set would be helpful....
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:22 pm
NineIron,
Can you setup a sample data set with schema and the like that's consumable? We can most likely help you but you'll need to give us a starting point...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:20 pm
JJ B (12/9/2011)
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 2:15 pm
L' Eomot Inversé (12/9/2011)
Koen Verbeeck (12/9/2011)
So...
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
December 9, 2011 at 1:05 pm
Viewing 15 posts - 2,101 through 2,115 (of 5,678 total)