Forum Replies Created

Viewing 15 posts - 3,691 through 3,705 (of 3,956 total)

  • RE: need help to customise my T-SQL

    In truth, I didn't try to go through all of your requirements in detail to see which were being fulfilled. You only stated at the end that the extra...

  • RE: Counting Records in months inbetween date ranges.

    If by removed you mean deleted, I don't see how that could happen.

    Perhaps you could post some SQL to illustrate your case. I work much better when I'm seeing...

  • RE: need help to customise my T-SQL

    You just need to number the programs accepted and pick the first one, like this:

    WITH CTE AS (

    selectapplicantIdx, iptIdx, kursusIdx, tQuotaIdx

    ,ROW_NUMBER() OVER (PARTITION BY applicantIdx ORDER BY applicantIdx) As PgmNo

    from

    (

    selectap.applicantIdx,...

  • RE: Replacement for Cursors

    Cadavre,

    I didn't realize that if you DECLAREd the local variables within the scope of the dynamic SQL, they would still be in scope upon return to the calling session.

    That is...

  • RE: Replacement for Cursors

    Vinu,

    I'm going to jump in on your question to Lynn because I think you've got it all wrong.

    I never approach a problem looking for an alternative to a CURSOR. ...

  • RE: Are the posted questions getting worse?

    Yup BKK=Bangkok! More taxis than tuk-tuks now.

    You mentioned you were following my posts. What are you, a stalker or something?

    Merely jesting my friend. I'll take that as...

  • RE: Are the posted questions getting worse?

    I'm no Jedi either, merely an intrepid Padawan!

    I live in Thailand. That fish is a 45kg Mekong Catfish I caught last Sept. We have a fishing pond here...

  • RE: Replacement for Cursors

    You called my bluff and I realize I have to fold.

    The issue I didn't think about when I said that, is that you need to DECLARE each of the local...

  • RE: Are the posted questions getting worse?

    I love this thread! Just found it and have a way to go in reading it all though. All these people grousing about other posters not giving them...

  • RE: Replacement for Cursors

    Here's a pretty contrived reply! 🙂

    You still gotta know in advance how many names you've got otherwise dynamic SQL is the only approach.

    DECLARE @Table TABLE(Name varchar(30) )

    DECLARE @name1 VARCHAR(30), @name2...

  • RE: Replacement for Cursors

    Vinus - Glad you like my signature!

    No you don't need a loop or even dynamic SQL to do this one.

    DECLARE @Table TABLE(Name varchar(30) )

    DECLARE @var VARCHAR(MAX)

    --Sample Data

    Insert Into @Table

    Select 'Jack'...

  • RE: replace function

    Ooops! Wrong thread!

  • RE: How to transfer data (from one column) from one table to another table? Please help.

    Here is yet another alternative:

    DECLARE @PERSON TABLE (

    person_id int identity(1,1)

    ,last_name nvarchar(50)

    ,first_name nvarchar(50)

    ,middle_name nvarchar(50))

    DECLARE @STUDENT TABLE (

    id int identity(1,1)

    ,person_id int

    ,student_number nvarchar(20) )

    INSERT INTO @PERSON VALUES ('Hanks', 'Tom', NULL)

    INSERT INTO @PERSON VALUES...

  • RE: Generating Test Data: Part 2 - Generating Sequential and Random Dates

    Jeff - What is it about you that attracts spam so well? Your cologne perhaps?

  • RE: Help with report

    I'll focus on converting a weekly forecast to a monthly forecast. The normal method for doing this is 4-4-5 (first 2 months of a quarter absorb 4 weeks each...

Viewing 15 posts - 3,691 through 3,705 (of 3,956 total)