Viewing 15 posts - 211 through 225 (of 508 total)
I've worked with both styles - a POS system that stored the images for cash register buttons and pictures of products, and a traffic management system that stored both the...
April 26, 2011 at 11:46 am
I would use a calendar table for the cutoff dates. Have each row contain the start (last cutoff) and current cutoff to you have a BETWEEN type range for...
April 21, 2011 at 2:26 pm
simorgh,
A set based update works on the SELECT statement, which is processed and returns a record set before any updates are actually done. If you expect a cumulative sequential...
April 21, 2011 at 1:01 pm
Great article Craig! I've been put off by job postings that have the SQL God requirement in the past. I'll never look at job postings in the same...
April 21, 2011 at 11:06 am
I would use some variables in the query to make it easier to read and do the whole thing in one pass rather than use 3 subqueries.
Something like:
DECLARE
@TheDate...
April 6, 2011 at 11:53 am
Sturev (4/6/2011)
Thanks for everyone's input... I got it:Service INNER JOIN Fiscal ON SDATE BETWEEN DATEADD(d, -6, WEEKEND) AND WEEKEND
Surev,
Your fiscal table should have enough columns defined to determine this...
April 6, 2011 at 11:21 am
faisalkhanbk (4/4/2011)
April 5, 2011 at 11:58 am
Brandie,
My rule of thumb on CTE vs derived table (when they are functionally equivalent) is use whichever is easiest to read in the code. I use both liberally and...
April 1, 2011 at 12:26 pm
Giles,
As Kevin pointed out you're probably not going to get anything better than a table scan from the way your data is distributed in the table. You want to...
April 1, 2011 at 12:12 pm
Dave Ballantyne (3/27/2011)
As you want...
March 29, 2011 at 11:14 am
Tim,
Was the view Schema Bound?
Todd
March 25, 2011 at 1:27 pm
I actually had a strange problem about 5 years ago that is somewhat similar. The database was 2005 before SP2. There was a table that had various VARCHAR...
March 25, 2011 at 12:45 pm
A simple way to delete dups that works on versions earlier than 2005 is:
DELETE EMP
FROM Employees EMP
INNER JOIN
(SELECT MIN(EmpID) AS EmpID, EmpName
FROM Employees
...
March 25, 2011 at 12:14 pm
Aparna,
Yours is a classic example of reporting on something that is usually there, but for some reason isn't there now. I've seen what you call pseudo records (I call...
March 23, 2011 at 10:56 am
There's another way to do this without joining Inserted to Deleted and it reads a little easier on the eye. This one gets the old values before the update....
March 18, 2011 at 2:14 pm
Viewing 15 posts - 211 through 225 (of 508 total)