Viewing 15 posts - 181 through 195 (of 414 total)
In fact, forget about extra columns, views and UDFs. Put an index on the TimeStamp column, then I think you can extract all the information you want from this table (if...
December 21, 2005 at 8:28 am
A side remark: Why sort by the result of the UDF? Why not sort by the TimeStamp column (or perhaps left(TimeStamp, 14))? That will amount to the same thing (as...
December 21, 2005 at 8:07 am
I am not sure what you want to do, but I think I would add a Date column and a LineNumber column, then transfer data in the TimeStamp column to...
December 21, 2005 at 7:08 am
Generally speaking, cursors are bad for performance, and should be avoided if you have large amounts of data.
The following is (I hope )...
December 21, 2005 at 7:02 am
Surely there is a better solution. But the following should work if rowcounts are always less than the number of rows in the sysobjects table (otherwise, consider using another table).
declare...
December 21, 2005 at 6:35 am
New columns are always last, as far as I know.
Instead of moving data to a temp table, you might want to simply rename the original table. Then you only have...
December 21, 2005 at 6:21 am
I had exactly the same doubts when I saw the statement, but I haven't found anything faster... I give up, you beat me... this time...
December 21, 2005 at 6:00 am
The following should return a list of columns on table TBL1:
select c.name from syscolumns c inner join sysobjects o
on c.id = o.id where o.name = 'TBL1'
December 20, 2005 at 2:26 am
Still just for fun I think the following might be a bit simpler (I use Jeff's code to create #yourtable)...
IF OBJECT_ID('TempDB..#MyMins') IS...
December 20, 2005 at 2:23 am
Sushila's method may link the wrong id to the wrong data, unless data are always sorted by grouping_id, urn when they are inserted into the table. Consider the following data (I have...
December 16, 2005 at 7:24 am
Why do you need to create a table in database DB1 from a stored procedure in your master database? I don't like creating tables in stored procedures, as creating a table is...
December 15, 2005 at 7:50 am
No way - experience is what it takes
December 15, 2005 at 5:12 am
You are actually making things more complicated than they are by using AVG - that's only possible if you have the same Qty all over. Try this instead:
declare @table table(ItemName varchar(10),...
December 15, 2005 at 5:09 am
I think this is the correct syntax (not tested, though):
update s
set s.desc = t.desc
from @temp s inner join table1 t
on s.id = t.id
December 15, 2005 at 4:41 am
Viewing 15 posts - 181 through 195 (of 414 total)