Forum Replies Created

Viewing 15 posts - 421 through 435 (of 3,957 total)

  • RE: Comparing Tables (Match, Exists, and Not Exists)

    CELKO (2/2/2015)


    This is a garbage pile; it has not key and no way to have a key.

    I thought they called that a heap?

  • RE: A delicious dilemma

    One other thing. If you do have lots of rows (more than in the sample data), you might want to experiment with breaking Nevyn's solution into a divide-and-conquer approach,...

  • RE: A delicious dilemma

    sqldriver (2/2/2015)


    dwain.c (2/2/2015)


    sqldriver (2/1/2015)


    Hello,

    Given the below table, how would you go about finding bars that carry the same brands of scotch?

    So I've got to ask, why do you need...

  • RE: Should I create an SP

    And here I was thinking the standard way to do an Upsert in SQL 2005 was like this:

    IF EXISTS

    (

    SELECT 1

    FROM tblCustomer

    ...

  • RE: Swap Firstname lastname

    Post deleted because I realized Jeff suggested the same thing (a COMPUTED PERSISTED column).

  • RE: How to select decimal type field

    Lowell (2/2/2015)


    ...maybe switch to using a sql_variant.

    What a brilliant idea!

    WITH SampleData (ID, Pay) AS

    (

    SELECT 1, CAST(1.000 AS NUMERIC(19,3))

    UNION ALL SELECT 2,2.250

    ...

  • RE: A delicious dilemma

    sqldriver (2/1/2015)


    Hello,

    Given the below table, how would you go about finding bars that carry the same brands of scotch?

    So I've got to ask, why do you need it in...

  • RE: Logical Help

    I see at least 2 issues here:

    KGJ-Dev (1/30/2015)


    Hi,

    Below is the sample data to play with.

    declare @users table (IDUser int primary key identity(100,1),name varchar(20),CompanyId int, ClientID int);

    declare @Cards table (IdCard int...

  • RE: Retrives the subject wise highest marks list in a table

    An effective method is a CROSS APPLY VALUES UNPIVOT (described in my signature links):

    WITH Students (id, studname) AS

    (

    SELECT 1, 'x'

    UNION ALL SELECT...

  • RE: Putting Rows together

    There are various ways to do this depending on what version of SQL you're in.

    Creating a Date Range from Multiple Rows Based on a Single Date[/url]

    The article shows them and...

  • RE: FEFO query if condition

    So what results do you want to get out of that sample data?

  • RE: Is it possible to embed a parameter in the name of stored procedure that's called from within another sproc?

    dwain.c (1/29/2015)


    First of all, in the batch above you need to have a GO directive between END and EXEC.

    You can ignore this part of what I said. I realize...

  • RE: Need Help !! Its urgent

    Try changing this:

    si.TrackingNumber like '%' + @SearchText +'%'

    to this:

    si.TrackingNumber IS NOT NULL AND si.TrackingNumber like '%' + @SearchText +'%'

    And if that helps, read this article to see why:

    Improving Performance for...

  • RE: Dividing a number with remainders

    Or maybe it would be best to just skip all of that insufferable reading and do it like this.

    WITH SampleData (ID, Amount, Months) AS

    (

    SELECT 1, 143.23,...

  • RE: Dividing a number with remainders

    You might want to read this article:

    Financial Rounding of Allocations [/url]

    The problem solved there differs slightly in that you're trying to allocate an amount across rows with different values, but...

Viewing 15 posts - 421 through 435 (of 3,957 total)