Viewing 15 posts - 286 through 300 (of 330 total)
RBarryYoung (1/5/2009)
OK, on my box, I am getting the following results:Original cursor: 410ms
RowNum (mine): 45ms
Identity (Matt's): 123ms
I can imagine that's about what you'd get - i...
January 5, 2009 at 4:10 pm
not afaik but Jeff will correct me if there is a way to do it.
You can create a unique constraint across multiple columns, but not a clustered index over multiples...
One...
January 5, 2009 at 4:09 pm
here's a ss2000 compatible version, using an indexed table variable for good measure 🙂
DECLARE @countordered TABLE ([RowNum] INT IDENTITY (1,1) primary key clustered,
...
January 5, 2009 at 3:58 pm
If your table was
CREATE TABLE someData
(
type varchar(20),
month_nbr int,
month_name varchar(20),
amount decimal(10, 4)
)
then your query would be
SELECT month_nbr,
...
January 5, 2009 at 3:29 pm
Farrell Keough (1/5/2009)
...as you cannot Index a @TableVariable...
I thought that until Jeff Moden set me straight. You can declare a table variable like this
declare @myTable TABLE (ID INT IDENTITY (1,...
January 5, 2009 at 3:21 pm
DBCC InputBuffer (SPID) will give you the text sent to the SQL Server, if that helps.
January 5, 2009 at 3:18 pm
I would use something similar to Chris' SQL - but I would create #BatchControl manually with a clustered index on the RowID, then use a counting loop similar to gyesql's...
January 5, 2009 at 1:03 pm
jacroberts (1/5/2009)
There are no indexes useful to these queries on the WeblogEvents table. All queries do a full table scan and it looks like the UNION ALL one does two.
I...
January 5, 2009 at 10:36 am
Here's my take. )
declare @numberBusinessDaysToAdd int
declare @basedate datetime
set @numberBusinessDaysToAdd = 14
set @basedate = '20090101 17:30'
-- first move base date on to the start of the next day
set @basedate = dateadd(d,...
January 4, 2009 at 3:27 pm
TheSQLGuru (1/4/2009)
Bottom line: DO NOT USE THIS UPDATE @VAR ... TRICK UNLESS YOU a) DON'T CARE ABOUT GETTING INCORRECT RESULTS OR b) YOU ARE VERY KNOWLEDGEABLE ABOUT YOUR SYSTEM,...
January 4, 2009 at 2:14 pm
Jeff Moden (1/3/2009)
Well, I'll be... ...snip... I've gotta do some checking...
I'm glad i'm not the only one doing all the learning! 😛
January 3, 2009 at 5:28 pm
It's been interesting actually - this thread has really reminded me that it's better to ask about intent rather than mechanic. By trying to ask 'how do I achieve X'...
January 3, 2009 at 5:14 pm
Jeff Moden (1/3/2009)
January 3, 2009 at 5:10 pm
Jeff Moden (1/3/2009)
Nope... unless you changed it for your server, the default Fill Factor is 90.
Are you sure? On all the servers i've found, i get this result set for...
January 3, 2009 at 5:02 pm
Ok I guess you peeps have hit the hay 🙂
@jacroberts - can you include that last one in your test runs monday? I know it's cheating, but I think coming...
January 3, 2009 at 4:23 pm
Viewing 15 posts - 286 through 300 (of 330 total)