Viewing 15 posts - 5,176 through 5,190 (of 6,036 total)
select col1, count(CASE col2=1 THEN 1 ELSE NULL END)/count(col2) as rate, count(A) as total
from Test
group by col1,col2
_____________
Code for TallyGenerator
August 9, 2006 at 4:58 am
Just to begin:
SUBSTRING( P.CUST_BANK_ID , 1 , 3) = CM.CITY_CODE
causes full table scan. Follow normalization rules and don't store rubbish in tables.
AND CUST_BANK_ID IS NOT NULL AND RTRIM(CUST_BANK_ID) !=...
_____________
Code for TallyGenerator
August 9, 2006 at 2:44 am
Did you try BOL?
_____________
Code for TallyGenerator
August 8, 2006 at 6:19 pm
No, I mean tables, not only table variables.
_____________
Code for TallyGenerator
August 8, 2006 at 5:07 pm
Joe, just in case you did not hear about it,
the name for array in SQL is "table".
You don't need to create arrays, they are already there. Just use...
_____________
Code for TallyGenerator
August 8, 2006 at 3:44 pm
August 8, 2006 at 3:20 pm
GROUP BY ...., WRnotes
_____________
Code for TallyGenerator
August 8, 2006 at 2:22 pm
Create new table and set up trigger to transfer inserted/data from old table to new one. Do select from new table.
If you store rubbish, you'll get rubbish back. No other...
_____________
Code for TallyGenerator
August 8, 2006 at 2:18 pm
Why?
One table with list of servers, databases, SP names and probably list of parameters will do it all.
Cursor through this table, build the query from names stored there and EXEC...
_____________
Code for TallyGenerator
August 8, 2006 at 5:44 am
EXEC RemoteServer.Database.dbo.StoredProcedure @Parameter1, @parameter2
_____________
Code for TallyGenerator
August 8, 2006 at 5:21 am
You must catch an error in the very next statement after attemting insert.
_____________
Code for TallyGenerator
August 8, 2006 at 5:19 am
What stops you from answering your own question?
Why not just try?
Believe me, there is no bomb inside, it will not blow if you cut the wrong wire. ![]()
_____________
Code for TallyGenerator
August 8, 2006 at 3:33 am
case when MIN(Type) = MAX(Type) then MIN(Type) else Min(type) + '/' + MAX(Type) end
_____________
Code for TallyGenerator
August 7, 2006 at 11:35 pm
Create scalar UDF taking varchar value as an argument and returning integer value.
Then update your table once using this function.
Don't be afraid to use loop inside of this UDF. Even...
_____________
Code for TallyGenerator
August 7, 2006 at 11:23 pm
declare @m money
set @m =100
select replace(STR(@m*100), space(1), '0')
_____________
Code for TallyGenerator
August 7, 2006 at 11:07 pm
Viewing 15 posts - 5,176 through 5,190 (of 6,036 total)