Viewing 15 posts - 3,796 through 3,810 (of 4,087 total)
As I said, the code was untested, because your data was not in an easily consumable format. (It still isn't.) I suggest reading Jeff's article about how to...
January 17, 2011 at 2:44 pm
IsNull() is more succinct than the CASE statement.
IsNull(a.PUser, b.PrimaryUser) AS PUser
Drew
January 17, 2011 at 11:20 am
shank-130731 (1/15/2011)
If @ID is provided, I want the WHERE clause to only reflect ID=@CaseID. If not provided then just RMARequestedDate > (GetDate()- @d).
WHERE CASE @ID
WHEN...
January 17, 2011 at 9:40 am
Doesn't the following give you want you want?
ORDER BY Sort, Type
If not, something similar should give you the desired results.
Drew
January 15, 2011 at 11:45 am
David's approach will work if you're only reporting on a single day, but immediately runs into problems when reporting on multiple days. A much better approach when you're reporting...
January 14, 2011 at 8:35 am
The problem is that your SET expression is returning text, not a column name. If you want to return a column you should rewrite your query as follows:
SELECT top...
January 13, 2011 at 2:37 pm
An update trigger will always fire when the table is updated. That is the nature of triggers.
If you want to control the behavior of the trigger based on userid,...
January 13, 2011 at 8:11 am
There is a much simpler way using COALESCE.
SELECT *
FROM #M_Vendor
WHERE Coalesce(@imported, DailySettlementYN, -1) = Coalesce(DailySettlementYN, -1)
The -1 forces an implicit conversion of the bit data.
Drew
December 27, 2010 at 1:41 pm
nikshepmehra (12/7/2010)
But the query gave an error as
"The xml data type cannot be...
December 9, 2010 at 2:20 pm
Craig Farrell (12/7/2010)
Run this sample, it'll show you what I mean. GO cannot be part of the proc.
I know what YOU mean. What I mean is
CREATE PROC TEST_THIS
AS
DECLARE...
December 8, 2010 at 3:04 pm
Craig Farrell (12/7/2010)
drew.allen (12/7/2010)
December 7, 2010 at 2:09 pm
I was trying to do the same thing and ran into the same problem. The cause was a GO statement that I included in my dynamic SQL. The...
December 7, 2010 at 11:32 am
scott.pletcher (11/30/2010)
I've never had any issue...
November 30, 2010 at 9:10 am
Information_Schema.Routines will only return the first 4000 characters of your stored procedure. If there is any chance at all that your stored proc is longer than that, you'll probably...
November 29, 2010 at 6:51 am
Is this what you are looking for?
select vendaddr.name
from vendaddr
inner join vendor
on IsNull(vendor.vend_num, vendor.vend_remit) = vendaddr.vend_num
It will use the vendor_num if it is not null and will use the vend_remit otherwise.
Drew
November 23, 2010 at 11:48 am
Viewing 15 posts - 3,796 through 3,810 (of 4,087 total)