Viewing 15 posts - 1,606 through 1,620 (of 14,953 total)
yousui (4/25/2012)
Hello GSquared, if this can't be implemented by CTE. Do you have a way to do this?Thanks.
I'm accustomed to doing this via VB.NET CLR functions in SQL Server 2005...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 12:39 pm
Lynn Pettis (4/25/2012)
Does anyone see anything wrong with this where clause?
Where PortfolioBaseCode = Replace(@Portfolios,'@','') as reportheading1
"as" then column alias in a Where clause.
Which won't parse.
Which means it's not the actual...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 10:02 am
Because it's not actually a hierarchy, a recursive CTE isn't the right way to do this. You'll just frustrate yourself with that approach to it.
Recursive CTEs are really only...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:58 am
Lynn Pettis (4/25/2012)
GSquared (4/25/2012)
Then the error is somewhere else in your code. Post the right part.
Gus, walk away. You will never get a full answer to any of...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:53 am
Then there's something else wrong.
If you're getting that error message, some piece of your query is trying to convert a string (NVarchar) to a floating point value, and it's incompatible....
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:52 am
I currently use Confio Ignite to do that. I'm doing some testing on Quest Performance Analyzer to see if it works better for what I need on that.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:47 am
m.eissa85 (4/25/2012)
My query is
DECLARE @var AS VARCHAR(4)
SET @var =...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:44 am
Then the error is somewhere else in your code. Post the right part.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:42 am
Sean Lange (4/25/2012)
It doesn't check for SSNs issued from Connecticut for people born and raised in Hawaii.
ROFL!!!! 😛
Yeah, I couldn't resist. Or, more honestly, I could have, but chose...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:41 am
Either column "PortfolioBaseCode" is datatype Float, or variable "@Portfolios" is. Can't tell which one from your post, but it's one or both.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:38 am
Something like this will work:
SELECT *
FROM ( VALUES ( '123-45-6789'), ( '123-54-6789'), ( '923-00-1234'), ( '123-00-1234'), ( '123-45-0000'),
(...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 9:35 am
You might still have problems with that function.
If, for example, you have a double-space inside the string, instead of just at the end of it, then you won't end up...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 7:40 am
You've misunderstood what a Case statement is for in T-SQL. It's a common confusion. What you wrote looks like Visual Basic or some language related to that.
In SQL,...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 7:36 am
The inserted and deleted tables behave a little differently than regular tables. No indexes, for one thing. No stats. So querying them can be a performance issue....
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 7:28 am
The problem rows have DIDOC# values. Your subquery (the Cross Apply query) requires that they be the same as per the first item in the Where clause. You...
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
April 25, 2012 at 6:42 am
Viewing 15 posts - 1,606 through 1,620 (of 14,953 total)