Viewing 15 posts - 49,126 through 49,140 (of 49,566 total)
and statistics cannot be mintained on them, so the optimiser has little to no idea how many rows are in the table variable when it generates a query plan.
May 12, 2006 at 3:31 am
If you are going to be doing this kind of query, create a linked server and map the windows authenticated logins on one to a sql authenticated login on the...
May 11, 2006 at 3:42 am
Cursors, especially nested cursors are not going to work very well, ever. I suggest a set-based solution.
This isn't a complete solution, but should give you a good idea where to...
May 11, 2006 at 2:55 am
IF EXISTS(SELECT 1 FROM mytable)
RAISERROR (...)
No need for variables or anything.
May 10, 2006 at 12:35 am
I usually use this when I'm optimising queries.
set
statistics io on
set statistics time on
May 4, 2006 at 5:53 am
From books online
status | int | Status bits for the growth value in either megabytes (MB) or kilobytes (KB). 0x2 = Disk file. 0x40 = Log file. 0x100000 = Growth. This... |
May 2, 2006 at 4:17 am
I tend to use this one. Not sure if it's the best, but it is way better than the usual cast as varchar version. Haven't seen any strange issues
SELECT CAST(FLOOR(CAST(GETDATE()...
April 28, 2006 at 12:08 am
What does this return?
DECLARE @val VARCHAR(50)
SELECT name from dbo.sysobjects where OBJECTPROPERTY(id, N'IsConstraint') = 1 AND name like 'PK__TestTable%'
select @val = name from dbo.sysobjects where OBJECTPROPERTY(id, N'IsConstraint') = 1 AND name...
April 21, 2006 at 3:56 am
If you print the string instead of executing it, what does it contain?
April 21, 2006 at 3:28 am
You'll need to use dynamic SQL in this case, as an alter table can't take a variable.
DECLARE @val VARCHAR(50)
select @val = name from dbo.sysobjects where OBJECTPROPERTY(id, N'IsConstraint') = 1 AND...
April 21, 2006 at 1:51 am
Easiest, yes, fastest, no.
Using a function on a column in the where clause of a query will prevent the optimiser from using any index that may exist on that...
April 21, 2006 at 1:48 am
What type is the TAB lock? S, X, IX, Sch-S?
An IX lock on table level is fairly normal when doing modifications. It's not a full exclusive lock, it's there in...
April 20, 2006 at 12:35 am
I'd love to work in the 3D graphics industry. I do modelling and rendering as a hobby, but I'm no where near as good as the professionals
That, or be an...
April 19, 2006 at 4:09 am
Table A to be able to create 1 row for each distinct gr# with first occurence of toname and fromname
What do you mean by first? First alphabetically? Is there another...
April 13, 2006 at 2:48 am
Apparently they don't. ![]()
Sorry, I wrote those a while back and they did work then. Haven't used them in ages. Will check.
April 11, 2006 at 11:48 pm
Viewing 15 posts - 49,126 through 49,140 (of 49,566 total)