Viewing 15 posts - 3,841 through 3,855 (of 3,956 total)
Perhaps one of these is the shorthand the OP is looking for?
Select *
from TEST
where ISNULL(Col1,'')+ISNULL(Col2,'')+ISNULL(Col3,'')+ISNULL(Col4,'') = ''
Select *
from TEST
where COALESCE(Col1,Col2,Col3,Col4) IS NULL
Could it be that the...
April 1, 2012 at 10:47 pm
This might also work for you:
CREATE TABLE #abc (ID INT, val VARCHAR(10), other CHAR(4))
CREATE TABLE #load (ID INT, val VARCHAR(10))
INSERT #abc (ID, val)
SELECT 1 AS ID, 'ABC' as val UNION...
April 1, 2012 at 8:10 pm
As I alluded to in my response above to Jeff, there is no reason to have either loop (see the INSERT at the end):
DECLARE @FRACAS TABLE
(ID varchar(50), Region varchar(100), Site...
April 1, 2012 at 6:57 pm
I recently heard tell that passing data through table variables is a bit slow. Guess I'm finally going to have to setup a table variable and pass it to a...
March 30, 2012 at 3:33 am
You may want to try to see if this runs any faster:
Declare @Date as int
Set @Date = 3
Select * from TempTable where correct_date between DATEADD(day,-@date,GETDATE()) and GETDATE()
--
March 29, 2012 at 8:21 pm
I know this is going to seem silly but I'm assuming 25 and 28 are not hardcoded but they come in as parameters that the OP has no control over...
March 29, 2012 at 8:01 pm
I have some suggestions but they're pretty involved:
1. First you'll need a good split string function (http://www.sqlservercentral.com/articles/Tally+Table/72993/) like the one from Jeff Moden in the link.
2. Modify your stored procedure...
March 29, 2012 at 7:48 pm
STUFF with PATINDEX is cool! This will also work:
SELECT REPLACE(LTRIM(REPLACE(Y, '0', '#')),'#', '0')
FROM (SELECT '123' UNION ALL SELECT '0123'
UNION ALL SELECT '000123' UNION ALL SELECT '0001230') AS X(Y);
Assuming...
March 29, 2012 at 7:25 pm
I just wanted to clarify because it sounds like dwain.c might be a little confused at this point.
Actually after ColdCoffee's prior post, I was no longer confused. I was...
March 29, 2012 at 6:27 pm
Drew - Yes I am aware of hidden RBAR gotchas and if I can I usually try to remove them. In this case, I didn't see that way but...
March 29, 2012 at 6:24 pm
f you don't know anything about the query or don't have any suggestions, its better you don't make a fool of yourself and keep everything to youself.
Did you even...
March 29, 2012 at 6:40 am
Complicated? You haven't seen complicated until you also introduce effective dates for the rules.
I actually support an application that has a similar look up approach to calculating a charge....
March 29, 2012 at 2:41 am
ColdCoffee:
So I think what you're saying (I am not an XML Plan-master, nor even a Paduan) is that COUNT(column_name) returns the number of rows that have non-NULL values? I...
March 29, 2012 at 1:02 am
So what happens with JayK's solution when there is a third rule?
I would do it like this:
DECLARE @r TABLE
(ID INT, [Min] MONEY, [MAX] MONEY, Fee MONEY)
INSERT INTO
March 29, 2012 at 12:06 am
You also should not need:
date_final_settlement is not null and
Assuming of course that your database is set to sort NULLs to before any non-NULL entry.
March 28, 2012 at 11:43 pm
Viewing 15 posts - 3,841 through 3,855 (of 3,956 total)