Viewing 15 posts - 211 through 225 (of 683 total)
Steve F. (4/18/2008)
I just updated the stats with a 20% sample size; this took about 30 minutes. The DISTINCT query's performance does not seem to have improved.
That's that then....
April 18, 2008 at 8:49 am
Ryan: The stats are updating right now. This takes time. I will try the query once this has completed.
Thanks Steve.
April 18, 2008 at 8:22 am
assuming the statistics on the table are reasonably up-to-date
I'm not convinced they are. I'm still waiting for my reply...
April 18, 2008 at 7:44 am
What do you actually want to do? Update the underlying data? Select the data but change it slightly? What do you want to change it from and to?
April 18, 2008 at 7:41 am
Can't see your query
Is the Day field indexed?
Am I seeing a different question to everyone else?
Anyway... is the index up-to-date?
April 18, 2008 at 7:17 am
Is this any help?
--SQL 2005 version
declare @s-2 varchar(1000)
set @s-2 = 'Company A,Department B,Manager C'
; with
integers1to100(i) as (select 1 union all select i+1 from integers1to100 where i...
April 18, 2008 at 6:44 am
GilaMonster (4/18/2008)
DECLARE @sSQL NVARCHAR(100), @rowcount INT
SET @sSQL = 'select * from sysobjects'
EXEC sp_executesql @sSQL
SELECT @rowcount = @@ROWCOUNT
PRINT '@rowcount = ' + CAST(@rowcount AS VARCHAR(4))
Output in the messages tab -...
April 18, 2008 at 6:18 am
This might be simpler...
Replace this...
EXEC @rowcount = sp_executesql @strSql
with this...
EXEC sp_executesql @strSql
set @rowcount = @@RowCount
April 18, 2008 at 5:58 am
I think you'll have to use dynamic sql to return a dynamic set of columns. I'd write a function which takes the xml and returns a sql query string, and...
April 18, 2008 at 3:52 am
How's this?
--data
declare @transactions table (TransactionDate datetime)
insert @transactions
select '20080418 08:31'
union all select '20080418 09:13'
union all select '20080418 10:26'
union all select '20080418...
April 18, 2008 at 3:43 am
Well, I've learned something here. Thanks guys 🙂
I've implemented this in my example to demonstrate it...
declare @Sample table (id int identity(1, 1) primary key, a int)
insert @Sample
...
April 17, 2008 at 6:41 am
April 17, 2008 at 4:08 am
2003? Wow - that is crazy.
I don't see how SQL Server will return anything other than 2008 when you ask it for the year of '12/1/2008'.
April 17, 2008 at 4:02 am
Assuming by 'primary key', you mean an identity column (they're not necessarily the same thing), you can use the technique in this example...
declare @Sample table (id int identity(1, 1) primary...
April 17, 2008 at 3:55 am
How's this?
--Data
declare @Sample table (error_reference_uid int, item_number int, error_code varchar(10))
insert @Sample
select 1234567, 13579, 'odd'
union all select 1234567, 2468, 'even'
union all...
April 17, 2008 at 3:39 am
Viewing 15 posts - 211 through 225 (of 683 total)