Viewing 15 posts - 5,671 through 5,685 (of 8,416 total)
mstjean (3/4/2010)
Wow... that is a surprise to me... Is there a working title for this article? I've gotta keep my eyes peeled for it-- it sounds like a MUST read.
It's...
March 4, 2010 at 5:45 pm
John,
That link seems to be broken, which is a shame since I would like to be one of the cool kids that's in on the joke. :unsure:
Paul
March 4, 2010 at 5:35 pm
Either method will work fine, though the Tally solution is more flexible and generally performs a little faster. Some DBAs would prefer the UNPIVOT solution for its economical syntax....
March 4, 2010 at 5:33 pm
Just to add an alternative, if the number of columns is fixed:
DECLARE @TABLE_FROM
TABLE (
A1 VARCHAR(100),
...
March 4, 2010 at 7:17 am
Without duplicating the expression:
DECLARE @temp
TABLE (
id INTEGER NOT NULL,
phn INTEGER...
March 4, 2010 at 6:40 am
Yes, but your solution is documented and supported 😎
March 4, 2010 at 6:29 am
If you're not authorized to change anything, it can't be changed :laugh:
Do it application-side, or explain yourself clearly, and provide a valid reason for doing this.
Paul
March 4, 2010 at 6:28 am
parthi-1705 (3/1/2010)
Which is good Sub query or Joins?
It is possible to write any JOIN as the equivalent sub-query. The reverse is not true, however.
SQL Server doesn't care too much...
March 4, 2010 at 6:26 am
If this is new development, you should avoid NTEXT it is deprecated, and will be removed from SQL Server. If you need to store large Unicode strings (> 4,000...
March 4, 2010 at 6:22 am
One other small thing: PRIMARY KEY is CLUSTERED by default, UNIQUE constraints are NONCLUSTERED by default.
Paul
March 4, 2010 at 6:17 am
Seems an odd requirement, and the wrong place to do it as Lutz mentions.
Nevertheless...
DECLARE @demo
TABLE (
data ...
March 4, 2010 at 6:14 am
RBarryYoung (3/4/2010)
There's some pretty cool tricks that you can play with it too. Besides the obvious nesting trick above, you should also see how it tears up an INSERT..EXEC.
Yes...
March 4, 2010 at 6:04 am
David,
If I ever end up having to maintain that code, you may expect a cold stare or two in the hallway 😀
Paul
March 4, 2010 at 6:03 am
Hey Steve,
Good code - but if you wrap it in [ code="sql" ] [ /code ] tags (remove those extra spaces), it will look much nicer on the page 😉
The...
March 4, 2010 at 6:01 am
Viewing 15 posts - 5,671 through 5,685 (of 8,416 total)