Viewing 15 posts - 5,566 through 5,580 (of 6,036 total)
Secret of success is to have number of open brackets equal to number of closed brackets.
February 27, 2006 at 4:45 pm
There is no return for dbo.udf_date_only(@StartDate) > dbo.udf_date_only(@EndDate)
And you repeat the same checks again and again. Not really good for performance.
This thing does the same stuff but it's shorter and it...
February 27, 2006 at 4:05 pm
I use to have UDF to return a table with 2 columns: instance name (or ID) and it's level in hierarchy.
February 27, 2006 at 2:43 pm
The only possible error in this script - people like to record datetime without time portion.
That's why you gonna take 2 ddays instead on one.
Small chane will fix it:
DECLARE @dtmEnd...
February 27, 2006 at 1:26 pm
What must stop from returning such set:
col1 | col2
abc 456
def 123
February 26, 2006 at 9:16 pm
What about Triggers on Views?
What about Constraints using Functions (same for Rules)?
What about computed columns in Tables using Functions?
What about Views using Functions?
What about data processing SP, not only interacting...
February 26, 2006 at 4:00 pm
Update TableA
SET...
FROM TableA
Those Tablea's are actually DIFFERENT tables!
And you don't have anything to join them in your query.
That's why your result will not be the same as you...
February 23, 2006 at 10:10 pm
He is just living there.
![]()
We are all linguists in this part of Europe. ![]()
Vladan you did not mention...
February 23, 2006 at 7:27 pm
Create TABLE UDF converting delimited string to set of values.
Supply you string to this UDF as a parameter.
Delete ...
WHERE IdColumn in (select ReturnValue from dbo.<UDFName>(@String))
February 23, 2006 at 3:09 pm
There is an error.
You are updating whole TableA, not only rows matched.
UPDATE A
Set ColumnA = 'Test'
from TableA A
inner join TableB on A.ColumnB = TableB.ColumnC
WHERE TableB.ColumnD = @Name
OR
UPDATE...
February 23, 2006 at 2:22 pm
And do roundings AFTER calculations, not before!
ISNULL(CAST(IsNull(MonthlyBookings,0) / NULLIF(CountEnqByUser,0) AS DECIMAL(18,2)) , 0)
Oterwise you lose precision.
February 23, 2006 at 1:53 pm
Why ISNULL???
You are creating problems for yourself!
Move in the opposite direction:
ISNULL(CAST(IsNull(MonthlyBookings,0) AS DECIMAL(18,2))
/
CAST(NULLIF(CountEnqByUser,0) AS DECIMAL(18,2)) , 0)
February 23, 2006 at 1:48 pm
Another mistake is to treat trigger on a table as a part of your page.
It's not.
It's a part of database functionality and nobody can guarantee that tomorrow somebody else will...
February 23, 2006 at 5:13 am
You need to define which row to keep and which one to delete.
Can you provide such definition?
February 21, 2006 at 8:27 pm
Viewing 15 posts - 5,566 through 5,580 (of 6,036 total)