Forum Replies Created

Viewing 15 posts - 151 through 165 (of 434 total)

  • RE: Pivot Table Help Needed

    I think that is how it is supposed to work. You do all the hard stuff 😀 and then the rest of us come along and QA it. ...

  • RE: Pivot Table Help Needed

    Just for S&G I removed your index completely and it didn't change performance time. Still 20 seconds. Here is the table I am using to test with if...

  • RE: Pivot Table Help Needed

    I copy your code straight from word without any replacing and it works great. I don't lose any leading spaces.

  • RE: Pivot Table Help Needed

    Peter Larsson (10/23/2007)


    I also lack the oppurtunity to call the SP twice in a row.

    I get an error "index already exists".

    I thnk it would make sense to move the create...

  • RE: Pivot Table Help Needed

    Sandy (10/23/2007)


    Hey Jeff :),

    Great Standard of Code,

    I really feel its the way need to be done.

    but i have a small issue here,

    when i am trying to copy your code...

  • RE: Pivot Table Help Needed

    I will start with "VERY COOL". 😎

    One small fix I had to make to the set up is to switch the from and group by. I'd paste it here but...

  • RE: Return a Table from a Stored Procedure

    I don't know about CR but I would suggest starting a new thread for the question so people who do can answer it. You may also want to post...

  • RE: Help in WHERE clause

    SELECT * FROM #TestTable

    WHERE (isnull(Title,'Sales Representative') = @dummy)

    will return the Sales Reps and nulls together but not with the VPs

  • RE: Return a Table from a Stored Procedure

    CREATE PROCEDURE [dbo].[sp_DAILYMOVEMENTS] @MyDate DateTime AS

    SELECT @MyDate, Description,

    MAX(CASE WHEN checkindate @MyDate THEN GuestName ELSE CAST(NULL AS VARCHAR(20)) END) AS Rollover,

    MAX(CASE WHEN checkindate = @MyDate THEN GuestName ELSE...

  • RE: Pivot Table Help Needed

    That is easier.

    select orderdate,

    sum(case when productno = 1000345 then orderqty else 0 end) as [1000345],

    sum(case when productno = 1000355 then orderqty else 0 end) as [1000355],

    sum(case when productno = 1000666...

  • RE: Pivot Table Help Needed

    Here is a Jeff MOden example I keep in my toolbox

    Set NOCount On

    ---===== If the temp table to hold the results in exists, drop it

    IF...

  • RE: Need help

    you will still need to use STUFF to pad the school code with 0's in front.

  • RE: Need help

    Look up STUFF in BOL. Are the years all prior to 2000?

  • RE: Return a Table from a Stored Procedure

    We could help more if we saw your proc but let say right now your proc creates a table by doing

    select a,b,c into temptable from permtable

    and then your...

  • RE: simplifying code

    declare @id int

    select @id =( select top 1 n from tally where n > 5)

    if @id is not null

    begin

    print 'yes'

    print @id

    end

    else

    begin

    print 'no'

    print @id

    end

Viewing 15 posts - 151 through 165 (of 434 total)