Forum Replies Created

Viewing 15 posts - 4,501 through 4,515 (of 7,610 total)

  • RE: Calculate future dates which excludes weekends and holidays for few columns

    I can't use an inline tally table because a filter at work blocks it, so I'm using a physical tally table. The table is named "tally" and its column...

  • RE: Thoughts on a way to improve performance of the "Update Top 100" query.

    I just noticed the OR condition on only status. That will force a table scan regardless. But I'd still like to see the actual query plan.

    Btw, are you...

  • RE: Thoughts on a way to improve performance of the "Update Top 100" query.

    You should cluster this table on ( ProcessDate ) or ( ProcessDate, SOID ) if you want to insure the index is unique. You can create a separate nonclustered...

  • RE: Index rebuilding

    I guess I wasn't clear enough. The idea is shrinking other databases on the same drive set(s) to free disk space, not on the db that needs the index...

  • RE: Create temporary table from output of dynamic SQL

    You can create a non-temp table in tempdb.

    CREATE TABLE tempdb.dbo.table_name ( ... )

    That table will go away only when you explicitly drop it.

  • RE: Help with a query, plz

    SELECT DISTINCT females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, YEAR, FULL_ADDRESS

    WHERE Parent1_Gender = 'F' AND CATEGORY <> 'STF'

    UNION

    SELECT Parent2_id, Parent2_FullName, Parent2_Email, Parent2_STATUS, Parent2_Gender,YEAR, FULL_ADDRESS

    WHERE Parent2_Gender = 'F' AND...

  • RE: memory consumption by SQL server instance

    14GB is almost certainly too much. Keep in mind that the 'max memory' limit for SQL Server is for buffer space only. SQL will take additional RAM for...

  • RE: Help with a query, plz

    Change the UNION ALL to just UNION. But the only way you'd have dups is if parent1 and parent2 both contained the same data.

  • RE: Help with a query, plz

    Select females_only.*

    From dbo.vw_csys_NurserySchool

    Cross Apply (

    SELECT Parent1_id, Parent1_FullName, Parent1_Email, Parent1_STATUS, Parent1_Gender, FULL_ADDRESS

    WHERE Parent1_Gender = 'F'

    UNION ALL

    ...

  • RE: Getdate() error

    SQLPain (12/29/2015)


    I inherited a bad code, I am getting a deadlock when I am using your where clause

    Very odd. Any conversion of the column should be vastly more likely...

  • RE: Index rebuilding

    You can use tempdb database instead of the db containing the index to hold most of the data for the rebuild if you prefer. But you will need enough...

  • RE: Getdate() error

    If you mean all times for today's date, and not all times for the immediately preceding 24 hours, then you should do this:

    WHERE (a.DateAppReceived >= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)...

  • RE: Need help constructing this SQL Statement, against one table only (table with three columns)

    You need a WHERE condition on the SELECT from the CTE:

    ...

    SELECT log1.ID,

    log1.STime StartTime,

    log2.STime EndTime,

    DATEDIFF(second, log1.STime,...

  • RE: Need to negate a where clause

    For performance reasons, you should never use ISNULL in a WHERE (or JOIN) clause, because you'll prevent possible index seeks on the underlying column. While the code below is...

  • RE: Number VS Letter

    I'd at least compare the performance of the straightforward brute-force method:

    SELECT

    word AS original_string,

    CASE WHEN SUBSTRING(word, 01, 1) LIKE '[0-9]' THEN SUBSTRING(word, 01,...

Viewing 15 posts - 4,501 through 4,515 (of 7,610 total)