Viewing 15 posts - 211 through 225 (of 541 total)
In this case using "case" is the best way. However, for more complex resolutions this would just be another table that holds the integer value and a corresponding value, which...
December 7, 2004 at 7:40 pm
And to bum Chad's a little more:
reverse(cast(reverse(REPLICATE('0', 5) + @value) as varchar(5)))
December 7, 2004 at 7:36 pm
There is a set based way to do this, but first you need to set up a common SQL table called "Sequence":
CREATE TABLE [Sequence] (
[SequenceID] [int] IDENTITY (1, 1) NOT...
December 7, 2004 at 7:15 pm
I don't understand, why don't you just use the following?
select '<MDS>'
select 1 as TAG,
0 as parent,
Q1.MedicationID as [M!1!MID],
Q1.PatientID as [M!1!MName]
from Medication Q1
WHERE Q1.MedicationID = @MedicationID
FOR...
December 7, 2004 at 6:50 pm
Just doing the audit will suffice thou I do believe. Because you condition should be ON UPDATE for the table. Then you can compare changes over a period of time...
December 7, 2004 at 4:51 pm
The problem with IF UPDATE is that it cannot determine if the value actually changed only that the value was explicitly set.
True...an additional check is needed
If Update(Col1)
BEGIN
Insert Audit (ColID, Value)
Select...
December 7, 2004 at 4:30 pm
Whatever works for you. In triggers you also have the option of testing groups by using:
IF UPDATE (column1) OR IF UPDATE (column2)
Triggers can be really tricky, but they are useful if...
December 7, 2004 at 1:07 pm
6) You look really stupid when you use a "tbl-" prefix in a language that has only one data structure. Likewise "vw-" looks stupid since the user is not supposed...
December 6, 2004 at 1:37 pm
There are certain times I want to trigger something when the actual value changes, but not when the value is updated to itself. For example, we have a web application...
December 6, 2004 at 1:24 pm
May I add this to my site, so the users can decide for themselves which one to use?
Sure, feel free to post it, but I think the patindex method is...
December 3, 2004 at 12:41 pm
Yoda's advice is wise and illustrates the real problem, in that your column is an aggregate of two values.
Frank, love the pattern searching for this. My only gripe is that...
December 2, 2004 at 7:46 pm
Nobody makes fun of how we dress at my work, although they do complain about the smell sometimes (not about me, I take a sponge bath every month whether I...
December 2, 2004 at 7:21 pm
if you must use char and the spaces are giving you grief, you can use a "rtrim" function:
select rtrim(cast('1' as char(5)))
December 2, 2004 at 7:08 pm
I have seen problems when using implicit casting. casting the 1 as a bit can be done explicitely (as in example 2) or implicitely (as in example 1). Implicit casting...
December 2, 2004 at 7:06 pm
Quote: "Excellent article, however, I'm sure the value of indexed views can be communicated just as effectively without preaching to us about denormalization...which seems to be the author's real...
December 2, 2004 at 3:42 pm
Viewing 15 posts - 211 through 225 (of 541 total)