Forum Replies Created

Viewing 15 posts - 10,261 through 10,275 (of 15,381 total)

  • RE: Stored procedure to split and insert values into tables

    Do yourself a favor... never store date related data as char data.

    +100000000000000

    There are VERY few absolutes when it comes to sql server but "NEVER store related data as char data"...

  • RE: Date in where clause

    raghuveer126 (10/24/2012)


    Hi I have something like this and the tables have no foreign keys. I am using date in where clause and i am not able to use id because...

  • RE: Query Help

    ????

    SELECT

    ROW_NUMBER() OVER(PARTITION BY x.cStudentId ORDER BY dtEnrollmentDate desc ) AS DaySeq,

    x.*

    from #x1 x

    where cAbsenceCode <> 'u'

    order by dtEnrollmentDate

  • RE: Scaler Variable Error !! :(

    nitinuniyal (10/23/2012)


    Hi Sean,

    We are using nolock only in select statement as recommended by our Application vendor, Our OLTP is too high and any lock even for milisecond can cause major...

  • RE: Scaler Variable Error !! :(

    nitinuniyal (10/22/2012)


    Thanks Sean,

    I got my answer now mt query is running and export is also working fine.

    I was just missing the double quotes in inner query.

    Regards

    NU

    Since you didn't answer...

  • RE: Split without delimiter based on position

    yuvipoy (10/23/2012)


    Any suggestions how can we optimize the query.

    Can you do the pivot in the front end? That would release the pressure from sql and put it in a system...

  • RE: running sum cursor

    sdhanpaul (10/23/2012)


    what the quirky query is doing is that it is update a column in the table called running total...suppose two users hit previewing the a running total report out...

  • RE: running sum cursor

    managed to get both methods working...10006 rows later, update was faster..by 11 seconds!

    means I can do away with the cursor for now...I will still keep it though as it might...

  • RE: select top 1 in subquery returns multiple records

    what's a cte? confusing technical extra?

    NOW THAT IS FUNNY!!!!

    A cte is a common table expression. They were introduced in sql 2005. They are basically an inline view.

    http://msdn.microsoft.com/en-us/library/ms190766%28v=sql.105%29.aspx

  • RE: select top 1 in subquery returns multiple records

    ksharpe (10/22/2012)


    Hi Sean

    I do apologize, I did think that I had copied the whole thing, not just the inserts, I certainly intended to post it all. and also thought that...

  • RE: Stored Procedures - Less parameters = More or less cost?

    it sounds like the exact oposite is true (again it depends) but take the examples below

    True that it depends. If the parameters can be declared inside or something then it...

  • RE: running sum cursor

    I modified what you did with the cursor...and it works:

    I posted that to show you what you had missed. I would HIGHLY recommend you NOT use the cursor approach for...

  • RE: running sum cursor

    sdhanpaul (10/22/2012)


    Thanks for the reply...I went, took a shower n couldnt sleep till i got this thing figured...so i worked with the quirky update thing...got this:

    /*************************************************************************************

    Pseduo-cursor Running Total update...

  • RE: select top 1 in subquery returns multiple records

    You still never posted the last table, only the inserts for it. So I had to make some more assumptions about your tables.

    Then what you posted as sample data did...

  • RE: running sum cursor

    sdhanpaul (10/22/2012)


    no inserts.

    no ddls

    sample data:

    rawtrxid forcount emppin RunningTotal

    ----------- ----------- ----------- ------------

    7 ...

Viewing 15 posts - 10,261 through 10,275 (of 15,381 total)