Forum Replies Created

Viewing 15 posts - 106 through 120 (of 254 total)

  • RE: Count day pr mont, year

    stop changing the stored procedure. Do nothing with the stored procedure. If you wish the SP to be functional at all for now, change the SP back to:

                FROM marsh_HKL.tblhertzkorttidsleiebiler,

                           ...

  • RE: Count day pr mont, year

    Somehow you are not running the last SQL I gave you. I know that because ANAvn isn't in it anywhere. Do not put this SQL into the stored procedure at all....

  • RE: Count day pr mont, year

    I was talking about running that SELECT by itself from Query Analyzer strictly for the purpose of problem identification. Should that reveal the missing dates then your tblhertzkorttidsleieAvdeling table is probably out of...

  • RE: Count day pr mont, year

                SELECT DISTINCT GjelderFra

                            FROM marsh_HKL.tblhertzkorttidsleiebiler

                            LEFT JOIN marsh_HKL.tblhertzkorttidsleieAvdeling 

                                   ON FKBRAvdeling=AID

    It is exactly what you had minus the comma you noticed. When you look at the results (DISTINCT will implicitely sort...

  • RE: Count day pr mont, year

    That is somehow related to the following FROM/WHERE you provided.

                FROM marsh_HKL.tblhertzkorttidsleiebiler,

                            marsh_HKL.tblhertzkorttidsleieAvdeling

                WHERE FKBRAvdeling=AID

    Add a "SELECT DISTINCT GjelderFra" in front of it. You should notice the same symptoms (stopping...

  • RE: Count day pr mont, year

    I THINK what you are after is to change the SUM and COUNT subselects to check that the current MonthGroup is the same or else the beginning of the current...

  • RE: Run sql when a stored procedure is created

    I'm not sure how convenient your "post creation script" is to use, but it sounds like you just have really whiny developers. I'm saying that as a developer. If the...

  • RE: Slow performance on large inserts

    SQL Profiler comes to mind. I'm not terribly adept at using Profiler so I won't presume to tell you what to record or what filter to use, but it seems...

  • RE: Count day pr mont, year

    You need to add it to the @Months table. And you're doing fine. If I were better I might come up with a simpler approach.

    -- Get a listing of every month to...

  • RE: Count day pr mont, year

    I hadn't noticed the department line in your example results. That will involve a fourth logical resultset. Man this is getting to be some ugly SQL. Add ANAvn to the...

  • RE: sp_changeobjectowner: help required

    FYI, you can get questions like that answered more conveniently and timely for yourself in the future using SQL Server Books Online (BOL). From Enterprise Manager or Query Analyzer just...

  • RE: Transaction Deadlock Error

    I almost posted about this earlier, but held back. I just can't see how your date range check works. You are performing date comparisons in 101 format which is MM/DD/YYYY....

  • RE: Count day pr mont, year

    Sorry. Copy/paste error. This is the downside to not being able to test your own code. 

    --Get the 1st logical row (the month header)

    SELECT...

  • RE: Using fully qualified names

    Thanks bkelley. Read, learned (hopefully), and virtual briefcased. I guess we have a bit of work ahead of us. Our application (third party initiated) now has about 1700 stored procedures...

  • RE: Using fully qualified names

    To address the direct question of whether you need to provide full names to improve performance, no. Not unless you're neurotic about it. The SQL Server lookups to resolve the...

Viewing 15 posts - 106 through 120 (of 254 total)