Viewing 15 posts - 11,581 through 11,595 (of 13,463 total)
dunno why i keep looking at this...
you can add a trigger on the VIEW to handle the status column....
rename the original table.
--add a view that has the old table name...
February 13, 2009 at 5:47 pm
Lynn he had stated previously that he actually has to check a couple other tables to get the true status...i think this was just a simplified example....since he's got to...
February 13, 2009 at 4:10 pm
the point trying to make, is that if the "status" is based on criteria, which you said was a combination of the end date and other factors in other tables,...
February 13, 2009 at 3:51 pm
Here's a complete example for you...
you simply change whatever application is looking at "my_table" to report the current status to point to "ViewOfMyTable"...all done...no process needing to run every thirty...
February 13, 2009 at 3:09 pm
well...you can have a calculated column as a primary key...so i'd make it built off of an identity like this:
[font="Courier New"]CREATE TABLE #example(myid INT IDENTITY(1,1),
myCalculatedPK AS 'martmp_' + RIGHT('00000000' +...
February 13, 2009 at 12:32 pm
select
ALIAS1.naam,
ALIAS1.Aantal_Incidenten,
ALIAS2.naam,
ALIAS2.Aantal_Inc_Portal
FROM
(
select vestiging.naam, count(*) as Aantal_Incidenten
from incident, vestiging
where incident.aanmeldervestigingid = vestiging.unid
group by vestiging.naam
) ALIAS1,
(
select vestiging.naam, count(*) as Aantal_Inc_Portal
from incident,...
February 12, 2009 at 10:57 am
another way to do it wiht a CASE statement, if you need to do lots of different race codes:
SELECT
SUM(CASE WHEN race_code = '01' THEN 1 ELSE 0...
February 12, 2009 at 10:39 am
it's suprisinglyy easy... you just need to use the two tables as aliased subselects:
SELECT ALIAS1.AM,ALIAS2.CM
FROM
(SELECT COUNT(*) AS AM
FROM dwh_test.dim_employees
WHERE
...
February 12, 2009 at 10:28 am
the trick for # of recurring substrings in a string is to use the replace function:
declare @MySchedule varchar(168)
SET @MySchedule = REPLICATE('123456789',40) --overkill
select @MySchedule
/*results:
123456789123456789123456789123456789123456789
123456789123456789123456789123456789123456789
123456789123456789123456789123456789123456789
123456789123456789123456789123456
*/
--how many times is there a 9 in...
February 12, 2009 at 9:47 am
again, I call BS.
what possible business process needs to scan the table every 30 seconds? how often is the table queried against per second? you've explained just fine what you...
February 12, 2009 at 9:41 am
When it comes to beating a dead horse with management, I've been there as well....sometimes they don't want to listen.
What is the real issue by the way? cursors? we might...
February 12, 2009 at 8:39 am
steveb's suggestion is the best, bar none. copy database wizard is not reliable compared to the built in ability of a SQL 2005 server to update an existing 2000 MDF...
February 12, 2009 at 7:36 am
for a trigger to be handled correctly, you cannot declare variables....
you have to keep everything SET based.
once you declare a variable, you are telling me you are thinking of one...
February 12, 2009 at 5:38 am
you can do it in 8000 char bites. the NULL parameter in your original statement below is WHERE to insert more text in the text field, and thenext parameter...
February 12, 2009 at 5:19 am
a table scan isn't necessarily evil....is the select very slow or anything?
how many rows are in the temp table?
what is the CREATE TABLE statement for the table?
is there...
February 12, 2009 at 4:43 am
Viewing 15 posts - 11,581 through 11,595 (of 13,463 total)