Viewing 15 posts - 226 through 240 (of 247 total)
If you are not temporary table adverse...
set nocount on
select col1, col2, col3, IDENTITY(int,1,1) as [Index]
from some_table
order by col1, col2, col3
into #temp
set nocount off
select * from #temp
drop table #temp
It is easy...
October 7, 2003 at 9:01 am
Without the subquery...
set nocount on
-- setting up base data
declare @a table (a char(2), b char(2), c char(2))
insert into @a values ('a1', 'b2', 'b3')
October 6, 2003 at 8:56 am
I would suggest using inner joins. Also, way use an alias if it is the same as the table name?
October 2, 2003 at 9:40 am
Would not casting to an int will result in grouping by the 24 hour period from noon to noon, not midnight to midnight?
I suppose you could pick the...
October 2, 2003 at 9:26 am
There is also sp_helplogins.
September 30, 2003 at 11:07 am
FYI. A bit column takes at least 1 byte. However, SQL Server will store up to 8 bit columns in the same byte. So, 52 state bit...
September 29, 2003 at 9:01 am
I never use unicode except when using sp_executesql because the @stmt and @params parameters. I'd not use it then, but it seems to require it.
September 29, 2003 at 8:46 am
See "Recovery Interval Option" in BOL and the contained links. The documentation states that a checkpoint does not depend on time, but depends on how many records are in...
September 29, 2003 at 8:34 am
We use such a "execute" role also. We also use only role based security so that we can move objects into production with object permissions (no login worries). ...
September 10, 2003 at 9:49 am
Some mention of this is at http://www.microsoft.com/technet/treeview/default.asp?url=/technet/itcommunity/chats/trans/SQL/sql0513.asp. There they recommend a fixed size. Also interesting is the MemToLeave question. BOL describes a –g startup option to control the...
September 9, 2003 at 10:20 am
I remember reading a post with a comment about a difference between using a proc input parameter versus a local variable in a case like this. For some reason,...
September 5, 2003 at 10:06 am
If you can't touch the table structure, a loop using SET ROWCOUNT will limit the number of records deleted. Perhaps a cursor with using a select something like
SELECT...
September 4, 2003 at 9:06 am
The identity increment can't be easily undone because another connection doing inserts into the same table might be affected.
A COMMIT or ROLLBACK will not affect the next identity value to...
September 2, 2003 at 12:04 pm
The time to do most math calculations is small compared to network IO. I'd be very surprised if you could see much difference. An index on a wide...
September 2, 2003 at 11:49 am
Viewing 15 posts - 226 through 240 (of 247 total)