Viewing 15 posts - 256 through 270 (of 320 total)
I find it hard to think of a scenario where this would be the optimal choice.
I'd be interested to know the business requirements as Ninja requested.
November 14, 2011 at 12:15 pm
Here's the situation I'm in:
I have the same 10 fields coming from two different systems, system1 and system2. I would like to do a comparison of all of the fields...
November 4, 2011 at 8:05 am
Lowell (11/4/2011)
if all the columns are the same, it might look like this:
--find what doesn't match from Table2
SELECT PK,ColumnList FROM Table1
EXCEPT
SELECT...
November 4, 2011 at 7:48 am
That's what I thought. I'm running under "NT AUTHORITY\NETWORKSERVICE" but apparently you can't add permissions to folders in windows using that verbiage. I think it uses "Network Service"
Thanks,
Mike
October 26, 2011 at 1:10 pm
Jeff Moden (7/8/2011)
1. We have two tables which will ALWAYS have a corresponding row in the other table.
2. If...
July 8, 2011 at 3:00 pm
opc, thanks for laying all of that out.
Nevyn, yes, I'd like to see all NULLs if wherever there aren't hobbies (even if there's 0/4 hobbies populated I'd like to see...
July 8, 2011 at 11:06 am
opc.three (7/8/2011)
mikes84 (7/8/2011)
Regarding these two requirements mikes84:
1) Do you want duplicates shown in the results?
2) Does order matter?
Using our two tables hobby1 and hobby2 here is an example that should...
July 8, 2011 at 10:03 am
tommyh (7/8/2011)
SELECT t.id,
RTRIM(SUBSTRING(t.s, 1, 36)),
...
July 8, 2011 at 10:02 am
Regarding these two requirements mikes84:
1) Do you want duplicates shown in the results?
2) Does order matter?
Using our two tables hobby1 and hobby2 here is an example that should answer both...
July 8, 2011 at 6:31 am
opc, what about this for the PARSENAME method?
SELECT h1.id,
REVERSE(PARSENAME(REVERSE(REPLACE(RTRIM(
CASE WHEN h1.hobby1 IS NULL THEN '' ELSE h1.hobby1 + ' ' END +
CASE WHEN h1.hobby2 IS NULL THEN ''...
July 7, 2011 at 2:36 pm
OK, how about this?
;WITH data(hobby1,hobby2,hobby3,hobby4)
AS
(
SELECT 'basketball',NULL,NULL,NULL UNION ALL
SELECT NULL,'basketball',NULL,NULL UNION ALL
...
July 7, 2011 at 1:22 pm
Actually that won't work. I think some derivative of that would though.
July 7, 2011 at 1:04 pm
Yeah, I sure wasn't expecting so many answers. I started to revisit the problem again. What do you think of this (also not that pretty):
SELECT
ISNULL(REVERSE(PARSENAME(REVERSE(REPLACE(ISNULL(hobby1, ' ') + ISNULL(hobby2, '...
July 7, 2011 at 12:57 pm
I suppose I could union the fields between the two tables and remove the NULLs that way, then convert the rows into columns if that's what you mean.
July 6, 2011 at 12:15 pm
Thank you, all!
Kramasawy, I would say that it was fairly even mixture (at least for me) of practical questions and theoretical. Some of the material I never knew prior to...
July 6, 2011 at 10:39 am
Viewing 15 posts - 256 through 270 (of 320 total)