Viewing 15 posts - 4,966 through 4,980 (of 6,036 total)
This function is about 100 times faster:
IF EXISTS (SELECT * FROM sysobjects WHERE name = N'DecimalPlaces')
DROP FUNCTION DecimalPlaces
GO
CREATE FUNCTION dbo.DecimalPlaces
(@A float)
RETURNS tinyint
AS
BEGIN
declare @r tinyint
IF @A IS NULL
RETURN NULL
set @r...
October 10, 2006 at 3:35 pm
Declare @ColumnList nvarchar(4000)
SELECT @ColumnList = ISNULL(@ColumnList + ',', '') + Column_Name
FROM INFORMATION_SCHEMA.Columns
WHERE Table_Name = 'puttablenamehere'
ORDER BY Ordinal_Position
PRINT @ColumnList
Don't worry about last...
October 9, 2006 at 11:28 pm
Almost there.
1) You must have unique index on EventName in TABLEMAIN.
2) Try to avoid "IF" in SQL. Use "WHERE NOT EXISTS".
It's not a problem in this case, but don't take...
October 9, 2006 at 11:01 pm
You must have some "natural key", unique combination of fields which distinguish different entities.
Then use something like this:
INSERT INTO TABLE
....
WHERE NOT EXISTS (SELECT ...FROM TABLE
...
October 9, 2006 at 2:07 pm
Want to use transactions - use transactional language.
VB is not transactional.
Need transactions - drop DTS and start programming Transactional-SQL, or T-SQL. With all its SP, triggers, etc.
Sorry.
October 9, 2006 at 1:46 pm
Did you notice this forum is about T-SQL?
October 9, 2006 at 4:20 am
What programming language do you use in your DTS?
October 9, 2006 at 3:15 am
My mate in University would say:
"It's not true. Make a note - I didn't say 'crap' "
![]()
October 8, 2006 at 6:43 pm
Don't you really care about duplicates in your database?
What if set of values you are trying to insert already exists in database?
I would suggest NEVER USE @@IDENTITY OR SCOPE_IDENTITY() to...
October 8, 2006 at 4:02 pm
BOL is Book-On-Line, "Help" for SQL Server.
Press F1 in EM or QA and you are there.
October 7, 2006 at 8:28 am
> I read that if you take on table wich has millions of records and your select is lazy, try to use "partitionary tables"
What you read is not true.
Just...
October 7, 2006 at 8:23 am
SELECT T.id, T.dateModified, T.clientId, T.Comments
FROM [tblTemp] T
INNER JOIN (select Max(DateModified) as LatestDateModified, clientId
from [tblTemp]
group by clientId) DT ON T.clientId = DT.clientId AND T.dateModified = DT.LatestDateModified
October 5, 2006 at 8:40 pm
What in the table tells you this is first row and that is third row?
In other words: can you post the SELECT statement for 3rd row?
October 5, 2006 at 5:23 pm
Viewing 15 posts - 4,966 through 4,980 (of 6,036 total)