Viewing 15 posts - 5,956 through 5,970 (of 6,036 total)
It's just silly mistake:
cast(od.Orderid as char(8))
or
convert(char(8), od.Orderid)
September 13, 2005 at 6:36 pm
Use noeld suggestion or make a view from you UNION statement and select from this view using any kind of WHERE clause you like.
September 13, 2005 at 6:27 pm
Varchar values use typically 36 different combinations per each byte instead of 256 possible. So you use only 14% out of each page in your index. Your index (and column...
September 12, 2005 at 4:02 pm
If your sysadmin role registered as login for SQL Server?
September 12, 2005 at 3:35 pm
I'm not sure about @@trancount. It will count all transaction started within the connection - in procedure called this SP and in another procedure is called by this SP (e.g....
September 11, 2005 at 4:39 pm
Clause in your UDF appian.dbo.udf_A
"WHERE ... datediff(day, [login_log].[dt_login], Convert([@date]))<=[@last_x_day"
eliminates all indexes and makes server scan whole table and return all rows, because it cannot predict result of the calculation.
Change it...
September 11, 2005 at 4:01 pm
Everything is cool, but who did tell you that collation for this patricular column is the same as default collation for the database?
Yes, typically nobody bothers to change collations after...
September 10, 2005 at 8:48 am
Yes, if you know TableA_Collation and sure it will never be different.
September 8, 2005 at 5:46 pm
Create one @sql for both operations:
SET @sql='UPDATE @tbl SET fieldname=@fieldname, lookupvalue=@lookupvalue, lookuporder=@lookuporder WHERE lvid=@lvid'
INSERT INTO @tbl (fieldname, lookupvalue, lookuporder,...
September 8, 2005 at 12:41 am
For big tables better to use joins:
delete M
from Milestones M
left join GeneralInfo on GeneralInfo.YNumber = M.YNumber
left join Imports on GeneralInfo.XNumber = Imports.XNumber
where Imports.XNumber IS NULL
September 8, 2005 at 12:26 am
And if you do SELECT much more often than INSERT,DELETE, UPDATE, create computed column and make it = dbo.Function2ComputeSeqNumber(OrderNum).
Function must be :
SELECT COUNT(*) ...
where OderNum = @OrderNum and ... <=...
September 7, 2005 at 10:12 pm
No, that was a query to get COUNT without actually performing count.
Server does COUNT everytime table is updated and stores value in sysindexes. So why do it again and again?
And...
September 7, 2005 at 9:53 pm
Select rowcnt from sysindexes
where id = object_id (@TableName) and indid in (0,1)
0 exists for all tables without PK, 1 is PK index. Any particular table has only one of those indexes.
September 7, 2005 at 7:09 pm
Almost right.
But this must be better:
select * from TableA A join TableB B on A.KeyFld collate SQL_Latin1_General_CP1_CI_AS = B.KeyFld collate SQL_Latin1_General_CP1_CI_AS
September 7, 2005 at 6:53 pm
There is no index on QuestionId in table vts_tbAnswer.
That's why SQL Server creates hash table with millions rows to get all possible joins with table vts_tbQuestion. Because therwe is no...
September 7, 2005 at 6:46 pm
Viewing 15 posts - 5,956 through 5,970 (of 6,036 total)