Forum Replies Created

Viewing 15 posts - 4,696 through 4,710 (of 7,597 total)

  • RE: CASE Statement with Date

    First, create a "standard" tally table (a table of sequential numbers). I can't provide code because the filter thinks it's "sql injection". After creating the tally table, then...

  • RE: need help on design of database for student registration system

    hlsc1983 (10/19/2015)


    hi am back after a long time . so sorry for that. Now i need to enter 'Marks ' . Each student will have two types of marks for...

  • RE: converting inline query into Join

    I think I understand. You can get all the collectors from a single query, but you have to include the collector in a GROUP BY:

    SELECT Collector, COUNT(DISTINCT LoanID) AS...

  • RE: Database page Could not be processed?

    Script out that index first so you can easily re-create it later if you need to. The index definition itself could still be OK.

    That's actually a "good error", in...

  • RE: Allow null on data type money?

    Absolutely. If a NULL means 0, then actually put 0, not NULL. NULL is ambiguous, zero is not. If you compress the row, either value won't take...

  • RE: Allow null on data type money?

    I would allow NULLs if it's possible a value won't be known. Sometimes unknown is not the same as zero. For example, I might not know the sales...

  • RE: Creating an automated process

    You don't need MERGE, use UPDATE instead:

    UPDATE tt1

    SET DealershipName = TT2.[DealershipName],

    DealershipAddress = TT2.[DealershipAddress]

    FROM TEST_TABLE1 tt1

    INNER JOIN TEST_TABLE2 tt2 ON TT2.DealershipCode = TT1.DealershipCode;

  • RE: Getting an object name from within it's own code

    Rather than a dynamic trigger, you need dynamic code that generates a static trigger.

    That is, after the table is created, run code that dynamically analyzes that table definition and generates...

  • RE: Profiler slows down the system

    For one thing, "save to table" is a lot of overhead. Save it to file(s) instead, then load the file(s) into tables later to analyze.

  • RE: Ways to improve record deletion speed

    For absolute max speed, you should also cluster the temp table on ID:

    SELECT TOP (0) IDENTITY(int, 1, 1) AS ID, ClustKey1, ClustKey2 --, ...

    INTO #TEMP

    FROM F_POLICY_TRANSACTION

    CREATE CLUSTERED INDEX TEMP__CL ON...

  • RE: performance improvement

    When you create the temp table, i.e before it's loaded, cluster it on ( COUNT, MESS ). A nonclustered index will not be efficient. That will speed up...

  • RE: sp_executesql with Parameters and CREATE INDEX

    So is the clustered index on the table permanent, and you just add nonclustered indexes? The clustered index is the most critical index. The best clustered index keys...

  • RE: T-Sql procedure taking hours to execute

    I don't have time to line up all the columns, but here's the general format of what you need. I don't see where the computed @FT* values are being...

  • RE: Best practice of storing many queries to export data?

    Eric M Russell (10/12/2015)


    Kristen-173977 (10/9/2015)


    Eric M Russell (10/9/2015)


    Stuff like aliasing column names and stripping quotes from column values can be easily handled within the view or stored procedure, from which...

  • RE: Need help with a simple query from a one to many table relation.

    Even more important would be properly (uniquely) clustering the tblRecipeAllergen table on ( Recipe_number, Allergen ) (and removing AllergenId from the table, as it's not needed).

Viewing 15 posts - 4,696 through 4,710 (of 7,597 total)