Forum Replies Created

Viewing 15 posts - 2,281 through 2,295 (of 6,036 total)

  • RE: Error converting data type DBTYPE_DBDATE to datetime.

    Ray Waldron (6/29/2005)


    I know this is because the Table jobs contains datatypes of CHAR,DATE,INTEGER,TIME and to start with I know the date datatype must be casing problems....

    If those are only...

  • RE: converting special charectors to positive or negative numbers

    Write a scalar function implementing the conversion rules.

    Something like this:

    SET @Result = convert(numeric, 18,2), -- change to the data type you actually need in your target table

    CASE

    WHEN RIGHT(@InputStr,...

  • RE: Finding the next date after a start date that is a certain day of the week

    DECLARE @NeededDW tinyint, @AfterDate datetime

    SET @NeededDW = 5

    SET @AfterDate = GETDATE()

    select MIN(Date)

    from Tally

    WHERE Date > @AfterDate

    AND DayOfWeek = @NeededDW

  • RE: Run same SQL or Stored Proc for multiple databases

    Create "sp_" procedure in master database.

    Put your code in there.

    Then use handkot's approach to execute that procedure for each database.

  • RE: Display first record from duplicate records in a column in sql query

    There are some questions about your original example.

    1. SELECT goes like this:

    select r.Request, r.city, ...

    from request r ...

    which means these 2 values come from the same record.

    But in your data...

  • RE: Name concatenations

    You use RTRIM + ' ' only if 2 or more last characters in the 1st column are spaces.

    If LEN >=19 then just concatenate as it is, do not change...

  • RE: An alternative to GUIDs

    iposner (9/19/2011)


    Sergiy - What I'm trying to say is that the original idea of coming up with a more efficient globally unique identifier is good. However its usage in order...

  • RE: An alternative to GUIDs

    ispooner,

    Does anything from your post make the approach less wrong?

    If not, then what was that about?

    I'm aware of the common practices.

    Cursors, loops, denormalized tables, etc. - used as common practices...

  • RE: An alternative to GUIDs

    What about this scenario:

    Site A is functioning well and persists orders 1 to 10

    Site B is passive but kept up-to-date so effectively it has copies of orders 1 to 10.

    Lightning...

  • RE: grouping/rollup help

    JBANKO (9/5/2011)


    Two things kinda negate that. The tables are inviolate. They are what they are and can't be changed, been there since the 5th day of creation.

    I doubt it....

  • RE: grouping/rollup help

    Normalize your data and all your problems will go away.

    🙂

    Put the data into:

    (

    TermID,

    StudentID,

    CourseID

    )

    Then you're not gonna have a problem running queries for:

    - list of courses for any student on any...

  • RE: grouping/rollup help

    Yeah, that's what you get whet you try to sort out French...

    🙂

    If seriously,

    in your data sample:

    10, 11 are "students",

    Col1, Col2, Col3 contain list of courses taken.

    Where are terms?

  • RE: grouping/rollup help

    Hi JBANKO,

    I'm afraid your description is quite messy and inconclusive.

    It does not explain the logic whaich must be used to get the desired set.

    You say:

    What I NEED to show is...

  • RE: Removing redundant information

    Let's clear with this first:

    doug 40899 (8/19/2011)


    Jeff,

    ... there were a few missing lines of data, when I ran it with the union, all of it is there.

    Apparently, it's not quite...

  • RE: Removing redundant information

    doug 40899 (8/19/2011)


    Jeff,

    I've tried that and didn't get back all of the correct results. I did a line by line comparison for running my query with everything after the union...

Viewing 15 posts - 2,281 through 2,295 (of 6,036 total)