Another use of Instead Of triggers is when you want to modify the data stream. That is, if you need to insert, modify, or remove any of the data...
However, ROLLBACK applies to all transactions. There is no way, afaik, to roll back only to a nested transaction level, named or not. For that...
The first thing you have to do is establish the time zero (T0) of yourquery. For this you cannot use the DatePart function as this will notproperly...
There's nothing you can do about the table scan because, well, you actually are scanning the entire table. If there are any indexes on the target...
So? I work with many queries that, on a good day, run 45minutes or more. Do you have any reason to expect the query toexecute in less than "several...
You are performing the join only to test membership, not retrieve data. So either one of the following should perform better. SELECT h.Name,...
Think conceptually for a moment. A number represents a count of things. If you add two numbers together, the result is the total number of things...
The subqueries are killing you. Here is an update statement thatmight help but you didn;t include script to create some test tables andpopulate them...
To generate a positive integer value from a UID value, use something like this: update MyTable set NewID = Abs( CheckSum( UID )) It's not absolutely...
I used to be a data modeler and now I'm a data architect. The former sounds kind of artsy and the latter more technical. So, I guess I would go with...
Not in the least. Why are there 12 rows but only 4 have id values? Why do you have useless information? Except for the Code attribute, all the data...
Is this what you are trying to do? select station_number, meas_valuefromv_extractwhere((LEN(@station_no) = 0) OR (station_number IN (SELECT * FROM...
True, there are some uses for three-valued logic. However, the values in the example do not seem to be responses to a test or questionaire. Until...
The spt_values table is largely undocumented and is not guaranteed to be around in the "next version" of Sql Server. It did make it to SS2005 but I...
One reason DISTINCT should be used only when absolutely necessary is that the result set must be sorted in order to find and remove duplicates. While...
There are many options available to you. You just have to choose the one you're most comfortable with.Option 1, nested Case: ..., CASE...
If BUYS_OFTEN and GOOD_FEEDBACK are Boolean values of True/False (1/0) then a default is almost invariably a good idea. A new entity will naturally...
When modeling an attribute, one of the questions to ask is, "Is there a value of this datatype that would be meaningful as a default?"Take two date...
What you have looks good. But, of course, I can't actually execute the queries to test them. What I would do is just execute both forms of the query...
That's how we've been able to enjoy "free" radio and television programs for several generations so it's not like this isn't something we are not...
Separate names with a comma.