Viewing 15 posts - 2,416 through 2,430 (of 2,462 total)
Kirby1367 (8/3/2012)
-- Itzik Ben-Gan 2001
August 3, 2012 at 4:32 pm
I agree with everyone re: "Why the big ol' index?"
Do you have any idea how many reads this table gets vs writes?
If the index is not used often...
-- Itzik Ben-Gan 2001
August 3, 2012 at 3:16 pm
Here is my solution:
DECLARE @i varchar(50)='122333444455555';
WITH val(x,n) AS
(
SELECT LEFT(@i,LEN(@i)),'0'
UNION ALL
SELECT LEFT(x,LEN(x)-1),RIGHT(x,1) FROM val WHERE LEN(x)>0
)
SELECT SUM(CAST(n AS int)) FROM val
What's cool is you can replace SELECT SUM(CAST(n...
-- Itzik Ben-Gan 2001
August 3, 2012 at 2:59 pm
SomewhereSomehow (8/3/2012)
Here is my solution
declare @i int = 985;with nums(n) as(select n from (values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10))nums(n))
select sum(convert(int,substring(convert(varchar(10),@i),n,1)))
from nums where n <= len(convert(varchar(10),@i))
This is good. A couple things to note:
First, the...
-- Itzik Ben-Gan 2001
August 3, 2012 at 2:43 pm
james.massey (8/3/2012)
-- Itzik Ben-Gan 2001
August 3, 2012 at 12:09 pm
Kirby1367 (8/2/2012)
Koen Verbeeck (8/2/2012)
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table A'
INTERSECT
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Table B';
You can also use a INNER JOIN instead of INTERSECT to accomplish the...
-- Itzik Ben-Gan 2001
August 2, 2012 at 4:36 pm
GilaMonster (8/1/2012)
Growing the log is an expensive operation, the file has to be zeroed out...
-- Itzik Ben-Gan 2001
August 1, 2012 at 4:29 pm
sestell1 (8/1/2012)
-- Itzik Ben-Gan 2001
August 1, 2012 at 4:10 pm
polkadot (7/31/2012)
-- Itzik Ben-Gan 2001
August 1, 2012 at 3:57 pm
prasadau2006 (7/31/2012)
Is their a way we can manage Transaction log even before it fills up? I have some archive tables, my requirement is to add fields to this tables...
-- Itzik Ben-Gan 2001
August 1, 2012 at 1:53 pm
jshahan (7/25/2012)
-- Itzik Ben-Gan 2001
July 25, 2012 at 2:27 pm
Lynn Pettis (7/25/2012)
-- Itzik Ben-Gan 2001
July 25, 2012 at 2:03 pm
Lynn Pettis (7/23/2012)
-- Itzik Ben-Gan 2001
July 25, 2012 at 1:23 pm
Gosh, that's quite confrontational.
My sincere apologies if I came off as confrontational; that was not my intent.
I, too, get quite a bit of information on the Internet...
-- Itzik Ben-Gan 2001
July 25, 2012 at 1:16 pm
Jeff Moden (7/23/2012)
XMLSQLNinja (7/23/2012)
ChrisM@home (7/20/2012)
XMLSQLNinja (7/18/2012)
...There are other ways to do this but using recursion is generally the fastest.
Recursion is the third fastest; CLR > "Quirky Update" > rCTE >...
-- Itzik Ben-Gan 2001
July 23, 2012 at 10:34 pm
Viewing 15 posts - 2,416 through 2,430 (of 2,462 total)