Forum Replies Created

Viewing 15 posts - 136 through 150 (of 1,347 total)

  • RE: Concatenation of a column with a ''''C'''' at the end, NEWBIE

    >>I continually get 'String or Binary Data would be Truncated' error

    1 or more rows that you are trying to update already have a ProductCode that fills the column. If you...

  • RE: parsing help

    The only given requirement is this:

    How can I join these two tables so that we recoginze that table1.Doe, John = table2.Doe | John?

    I don't see any requirement for fuzzy...

  • RE: Minimum of detail table

    The requirement is to return 1 record per orderid. What you've posted does not accomplish this and fails to meet the requirement.

  • RE: parsing help

    No. It's not working:

    Select Soundex('Smith, John')

    Select Soundex('Smyth, Jon')

  • RE: parsing help

    Derived table to contruct FullName from the 3 name parts, then join on the concatenated column of the derived table

    Select *

    From Table1

    Inner Join

    (

      Select *,

        Rtrim(LastName + ', ' +...

  • RE: Update Query With Join Question

    It helps to break the problem down into chunks. First, you need total amount summed at the facility_code level. This query accomplishes that:

    Select m.facility_code, Sum(d.quantity_issued * d.Price) As TotalAmount

    From ...

  • RE: how to calc % using datediff() sqlserver 2005

    >>sqlserver 2005 would not accept it

    Did you get a syntax error ? Or the wrong result ?

    Declare @Startdate Smalldatetime

    Declare @EndDate Smalldatetime

    Declare @Currentdate Smalldatetime

    Select @StartDate = '01 Mar...

  • RE: Minimum of detail table

    I would use 2 derived tables, 1st gets the earliest date per order, and 2nd finds the lowest line number to use as a tie-breaker if there are 2 or...

  • RE: Execution plan question

    Are the data volumes the same in Dev and Prod ?

    Is it the same set of data, or different data, with different distribution of indexed column values ?

    Are statistics up...

  • RE: Query without using ''''UNION''''

    Use UNION ALL so that the 2 resultsets aren't subjected to sort/distinct operations.

     

  • RE: Trigger causing Update error

    Why not simply create a foreign key constraint and let the database engine handle it ?

    If you absolutely must code it in a trigger, make it set-based to handle multiple...

  • RE: Help with Non Exists

    Select e.RespondentID

    From EventLog e

    Inner Join tblLookup l

      On e.RespondentID = l.RespondentID

    Where Not Exists (

      Select *

      From EventLog As e2

      Where e2.RespondentID = e.RespondentID

      And   e2.eventID In (2,3)

    )

  • RE: Decimal Identity Column

    The advantage is a larger range of possible values before you reach the max possible value for the data type.

    The disadvantage is increased storage space in table and index pages,...

  • RE: Row number

    Which version of SQL server ?  SQL2000 or SQL2005 ?

     

  • RE: T-SQL aggregate quetion

    Since this is posted in the SQL2K5 forums, here's an example using SQL2K5's new features.

    Use a recursive CTE to generate your 60 months:

     

    With

    SixtyMonths (

Viewing 15 posts - 136 through 150 (of 1,347 total)