Forum Replies Created

Viewing 13 posts - 271 through 283 (of 283 total)

  • RE: Search

    This will do what you want:

    Declare @Letter char;
    Set @Letter = 'B';
    
    Select  Description
    From    TheTable
    Where   Left(Description, 1) >= @Letter
    Order By Description;
    

    However, it's going to be a...

  • RE: trouble with aggegate functions

    I took the table def supplied by Lynn and created a primary key on (client, typecode, grp). That at least turned a table scan into a clustered index scan. Then...

  • RE: Importing/Updating data to an existing table

    So, if I read this correctly, you are inserting all the records into the table, then going through and deleting the older duplicates. This seems straightforward but I have a...

  • RE: Function help please

    This is bare bones but it will do what you want. I didn't write it in the form of a function, I trust you can do that. The following creates...

  • RE: Importing/Updating data to an existing table

    The best answer was the three-stage DTS procedure. The proc would actually be simple -- an update and an insert statement.

    Let's say your SQL Server table has an identity column...

  • RE: Question of the Day for 29 May 2007

    That doesn't hold water. There will be business rules concerning withdrawals and a Withdraw function/procedure will incorporate those rules. There will also be business rules concerning deposits and a Deposit...

  • RE: Searching Query problem..

    As has already been pointed out, your main problem is your having the IPs stored as strings, so comparison are lexical, i.e. '10' comes before '2'. However, if you really...

  • RE: queries on dates

    I generally prefer to use between to compare dates as functions on the column will prevent index usage.

    This is true but I rarely see only the date field in the...

  • RE: Foreign Key/Primary Key GRRR!

    It may be frustrating and taking seemingly forever, but usually when the system balks at what you are trying to do, it is trying to tell you something important.

    The first...

  • RE: Cross Database Joins with Different SQL Servers

    You're facing two problems:

    1. joining across two servers is inefficient (this has already been pointed out)
    2. replicating the entire table just before performing the join is also inefficient and may significantly impact...
  • RE: query formating without using procs

    Sorry, guys. I just noticed that in the function and the select statement at the end, the table is called days_area instead of DaysArea. I had started to edit my...

  • RE: query formating without using procs

    Here's a solution. It involves the use of a user function so it's not useful to the original poster. But is does illustrate how absurdly complicated a restriction on the...

  • RE: query formating without using procs

    Here's a partial answer:

    select ID, CurrentArea, RunDate, InvoiceID, count(*) as Days
    from
        (select ID, CurrentArea, RunDate, InvoiceID
            from dbo.DaysArea Today
     ...

Viewing 13 posts - 271 through 283 (of 283 total)