Forum Replies Created

Viewing 15 posts - 481 through 495 (of 1,183 total)

  • RE: Combined query - simple question?

    SELECT

    @AvgRating = AVG(Rating)

    ,@NumRatings = COUNT(*)

    FROM Comments

    WHERE Comments.VidID = 1

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Using Tally table help

    KMM (5/30/2008)


    I'm not quite sure if I understand how you are combining things for the INSERTing of Process Type 1. that table doesnt have a MSalesNbr as a column

    OOPS, it...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: find missing entries in series of datetimes

    stk (5/30/2008)


    wow, thanks Michael, that works perfectly! 😀

    I should really learn more about those Common Table Expressions, they are quite handy at times...

    CTE's aren't nearly as handy as a tally...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: SELECT * INTO temp table

    INSERT INTO #temp

    SELECT * FROM dbo.A WHERE @var = 'A'

    UNION

    SELECT * FROM dbo.B WHERE @var = 'B'

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Runaway query

    post the code for the function?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Using Tally table help

    OK, here's everything EXCEPT the handling of TYPE 3.

    I've got to get back to work here, so hopefully someone can help with the rest.

    This uses no Cursors, I haven't tested...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Using Tally table help

    Your script isn't complete. Where/How does @iMto1Flag get set? What are the other INSERT/UPDATE statements and the logic that determines which is used?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: What is wrong with this SELECT query??

    select * from

    Appointments

    where StartTime >= '2008-5-29' and StartTime < '2008-7-1'

    and (LastName is not null) or (FirstNames is not null)

    order by StartTime desc

    It's because your essentially saying ...

    StartTime >= '2008-5-29'...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Convert month to date and add value in datewise from Month column

    Of course I hit post, and see that Kenneth beat me to it ... LOL

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Convert month to date and add value in datewise from Month column

    I believe this is the easiest way to get the job done.

    -- create some tables to hold sample data and results

    DECLARE @att TABLE

    (SchoolID INT

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Multiple INSERT statements into the same table

    I'm not going to address the WHY you are doing this or suggest any better ways, this is simply a suggestion as i'm not sure why your trigger doesn't work...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: loading data from one table to another

    Please post the DDL (CREATE TABLE) scripts for your two tables, including primary key definitions.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: SQL 2000 instance on SQL 2005

    Can you not just set the compatibility level on the database to 80?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Cursors and Indexes

    I wouldn't say that a cursor is the best way, just that it would be a huge amount of work to re-write through a site like this. Not to mention...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Cursors and Indexes

    Not to sound abrasive, but why not write it without using a cursor?

    Post your code and sample data and maybe we can give you a set-based NON CURSOR solution. 😀

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 481 through 495 (of 1,183 total)