Viewing 15 posts - 4,501 through 4,515 (of 6,036 total)
Dinesh,
Jeff posted more clear and effective solution just 1 post above.
Actually he has to post this solution twice a week, because people don't bother to read previous postings.
CASE WHEN...
_____________
Code for TallyGenerator
March 12, 2007 at 4:57 am
Dinesh, replace "1dd" with "1d3" int your data set and rerun your query.
See what happens.
_____________
Code for TallyGenerator
March 11, 2007 at 8:27 pm
You may copy data from static table, not from DELETED.
INSERT INTO dbo.AuditTable (ID, Col1, TextCol)
SELECT d.ID, D.Col1, T.TextCol
FROM deleted D
INNER JOIN dbo.MyTable T ON D.ID = T.ID
But it must be...
_____________
Code for TallyGenerator
March 10, 2007 at 5:48 am
Read BOL about decimal data type.
DECLARE @Amount decimal
SET @Amount = 1000.49
SELECT @Amount
_____________
Code for TallyGenerator
March 10, 2007 at 5:39 am
I cannot put the code within a stored procedure and pass the table name through.
No, you can.
Just use dynamic SQL.
Put @TABLENAME@ in your script instead of actual table...
_____________
Code for TallyGenerator
March 8, 2007 at 2:38 pm
No, it won't help.
Not using dynamic SQL and avoiding ad-hoc queries will.
_____________
Code for TallyGenerator
March 6, 2007 at 4:55 pm
Same result may be achieved with a little bit simpler query:
select t1.id, COALESCE (t3.[Name], t2.[Name], t1.[Name]) as Name
from Table1 t1
left join Table2 t2 on t1.id = t2.id
left join Table3...
_____________
Code for TallyGenerator
March 6, 2007 at 3:45 am
Did you read the error message?
MSDTC on server 'SecondServer' is unavailable.
It's not a clue. It's a big fat point.
_____________
Code for TallyGenerator
March 5, 2007 at 9:36 pm
Zoran, are you a part of the system?
When they will install the system will they install you next to the server?
If yes then it's OK to use you knowledge as...
_____________
Code for TallyGenerator
March 3, 2007 at 5:12 pm
What tell there that 10 is input but 3 is output?
_____________
Code for TallyGenerator
March 2, 2007 at 4:27 pm
NULLIF(ColName, )
_____________
Code for TallyGenerator
March 2, 2007 at 1:40 pm
Replace default values with NULL. As it should always be.
COUNT does not take NULLs.
_____________
Code for TallyGenerator
March 2, 2007 at 1:19 pm
Where and when "select dbo.getDate()" works fine?
It does not work in my SQL2000.
_____________
Code for TallyGenerator
March 2, 2007 at 4:32 am
Searching for '%company%' you'll get all records having 'accompany', 'accompanying', etc.
Is it what are you ready to accept?
Spaces before and after would not help because you probably need options '"Company"',...
_____________
Code for TallyGenerator
March 2, 2007 at 4:12 am
What happens if you do it proper way?
DECLARE @EndDay datetime
SET @EndDay = dbo.fn_EQL_MakeDate(@EndDate, @InActPeriod)
SELECT field1, field2, CASE WHEN SalesOrder.SOM_SalesOrderDate BETWEEN @StartDate AND @EndDay THEN SalesOrder.SOM_OrderValAmt ELSE 0 END AS ActiveVal
_____________
Code for TallyGenerator
February 14, 2007 at 1:48 pm
Viewing 15 posts - 4,501 through 4,515 (of 6,036 total)