Forum Replies Created

Viewing 15 posts - 4,951 through 4,965 (of 7,610 total)

  • RE: IT Project Management - Fact Finding Questions

    Often a good start is to look at current input and display screens, as well as reports, but just to identity needed data elements, not to copy the format/layout.

  • RE: Conver Number to string ( exp. 9 - 0009 or 9 - 09)

    Agree with using REPLICATE instead, and get rid of any extraneous local variables, so fully coded would look like this:

    CREATE FUNCTION [dbo].[NumberToString] (

    @value int,

    ...

  • RE: IT Project Management - Fact Finding Questions

    The most important thing is to treat it first as a data project. The database part comes later!

    That is, start with logical data modeling. And stick with that...

  • RE: Table(s) design for messaging functionality

    Do not cluster this table by identity. Cluster it instead on EmailDate, for example.

    I'd strongly consider using nvarchar(max) rather than nvarchar(3000) to allow longer messages if needed.

    Status should not...

  • RE: Distinct performance

    Hmm, no reason to insert a large number of rows and then do a distinct. Do either of the following, depending on if you need a count for each...

  • RE: Query Performance

    Without further info, the truly best clustering index is a complete guess, but based on what is known so far, I'd say try:

    Cluster the table on ( StartDate, EndDate )

  • RE: Optimising join with a CASE statement

    Is the key column really that long?

    Why not just use a separate row for each interval, 5, 15 and 60 minutes?:

    settlement_key, interval, value

  • RE: Cash Payments By Denomination

    I'd prefer a single UPDATE statement:

    UPDATE raa

    SET tt_TotalPay = aan.TotalPay,

    tt_CountOf100s = aan.TotalPay / 100,

    tt_CountOf50s = aan.TotalPay % 100 / 50,

    ...

  • RE: Numeric/Negative Check

    SELECT Capacity

    FROM (

    SELECT '1234' AS Capacity UNION ALL

    SELECT '-987' UNION ALL

    SELECT NULL UNION ALL

    SELECT...

  • RE: Can anyone help get this to run?

    Put double quotes around the column in the SELECT list:

    SELECT ..., '"' + column_with_leading_zeros + '"' AS column_name, ...

  • RE: Nested query retrieving min and max values

    You're welcome!

    Btw, note that for "SELECT TOP (1) *", the * is not a problem, because SQL can determine that it needs to get only the columns that are actually...

  • RE: Nested query retrieving min and max values

    You need to use CROSS APPLYs (CA) rather than an INNER JOIN (IJ). CA only, without the IJ, assumes you need to see only the low and high hematocrit...

  • RE: Can anyone help get this to run?

    Luis is correct.

    But also quit using sysobjects and syscolumn views, as they are very obsolete and slow (and possibly even buggy).

    Try this code instead:

    SELECT @COLUMNS = @COLUMNS + c.name +...

  • RE: Function that replaces multiple values.

    This will be more complex than just what you've shown, if this is trying to strip prefixes/suffixes off a name, as it appears to be.

    For example, the letters "JR" and...

  • RE: Identify sets of rows

    Yeah, I can't think of a really clean way to do it now either, other than brute force:

    SELECT table_name.*, derived2.row_num

    FROM table_name

    INNER JOIN (

    SELECT colb,ROW_NUMBER() OVER(ORDER BY...

Viewing 15 posts - 4,951 through 4,965 (of 7,610 total)