Forum Replies Created

Viewing 15 posts - 1 through 15 (of 20 total)

  • RE: WHERE col NOT IN (SELECT...) not working

    Lynn Pettis (1/21/2009)


    Not that what I gave you is a workaround. I actually think that it is more efficient than using NOT IN. The execution plan showed a...

  • RE: WHERE col NOT IN (SELECT...) not working

    Jeffrey Williams (1/21/2009)


    Hi Dennis, the reason is really simple. When you run the query:

    SELECT ParentID FROM Child;

    You are returning at least one row where the ParentID is NULL. ...

  • RE: WHERE col NOT IN (SELECT...) not working

    Greetings Lynn,

    Yes that does work and is a fine workaround.

    I want to understand why this does not work as it should work correctly and the fact that it...

  • RE: Increment a string

    Nice, pulling out the table is a big improvement. In looking at that, I was thinking about doing more than just adding one. So I created an addition...

  • RE: Increment a string

    Here is a stab at this issue as a function. If you pad the input with your zero symbol, you will get padded output, but it will grow the...

  • RE: Generating Missing Dates and Numbers

    What do folks think about adding directly to a datetime and allowing implicit conversions to take place?

    CREATE FUNCTION dbo.DateRange( @start DATETIME, @length INT )

    RETURNS @range TABLE...

  • RE: Tame Those Strings - Finding Carriage Returns

    In looking at the problem, I thought to extend it to extracting all of the numbers in a string, not just the first. Then you could choose to deal...

  • RE: Converting Hexadecimal String Values to Alpha (ASCII) Strings

    I have found using STUFF to create the output to be a little bit faster. I am assuming that it is due to traditional string concantination issues...

     
  • RE: Tricky Query - Help Please?

    This is expensive, and depending on how much data you have there are better solutions...

    SELECT
        CaseID,
        MAX(Borrower_1) AS Borrower_1,
        MAX(Borrower_2) AS...
  • RE: The Truth Table

    we are asked to make a report that show all the students with

    these conditions:

    if the student has a score='a' then sex must be 'f' .

    if the student has a score='b'...

  • RE: Running a Query Using a Text File for Input

    Howdy All,

    I agree that authoring a single select per CustomerID in the key file is wasteful and there is no need for the vbs script in this case. This...

  • RE: Generating Permutations in T-SQL

    Just to toss my hat in the ring...

    create procedure dbo.usp_permutate

    @charset nvarchar(256) = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

    as

    set nocount on

    -- a set of all values in the charset

    create table #set ( k int, v nchar(1)...

  • RE: The Pitfall of "Not Equal To" Operator in Queries!

    The question is one of membership, and the IN clause seems to be a very clear way to pose that question. After proper indexing, it yields the same query...

  • RE: Generating a Sequential Pattern

    I love functions... below is the function declaration but first the insert statment

    INSERT INTO dbo.Invoice ( Invoice_id, Customer_name, Invoice_amount )

    VALUES ( dbo.fn_NextKey(05), 'ACME Corp.', 12345.67 )

    This technique also works...

  • RE: You Want To Do What, with MY Database?

    Perhaps you need more naming information for the procedure. The call will make assumptions based on the current server/database that you are connected to, so if the procedure is...

Viewing 15 posts - 1 through 15 (of 20 total)