Forum Replies Created

Viewing 15 posts - 4,441 through 4,455 (of 7,597 total)

  • RE: Multiple queries in the same stored procedure

    Jeff Moden (1/26/2016)


    Manic Star (1/26/2016)


    So we had a development. An SQL MVP at days of .Net told our devs that their beloved UberQueries were ok since the QA cached the...

  • RE: Multiple queries in the same stored procedure

    Luis Cazares (1/26/2016)


    Manic Star (1/26/2016)


    So we had a development. An SQL MVP at days of .Net told our devs that their beloved UberQueries were ok since the QA cached the...

  • RE: Need Create View Script for all tables

    I'd strongly urge you to avoid the INFORMATION_SCHEMA views. Instead, stick to the sys. views.

    Not only are I_S views deficient in newer columns vs. the system tables, they are...

  • RE: TSQL SYNTAX HELP PLEASE!!!!

    Here's the clear version of the code:

    IF (@phrase_type IS NULL OR @phrase_type = ' ')

    Instead, the original code uses:

    IF (ISNULL(@phrase_type, ' ') = ' ')

    The ISNULL(<value1>, <value2>) will replace a...

  • RE: Database in full recovery?

    The consultant indicated they usually advice to take a full backup at night and an incremental backup during lunch time (kicking everybody out of the system).

    I guess this...

  • RE: Having my query use less resources.

    If all you need is a count, don't insert rows into a table variable, just get the count directly:

    SELECT@QCount = COUNT(*)

    FROMtbl_Q_Tags_Map M

    JOINtbl_Q Q ON M.QID=Q.QID

    WHERETagID IN (SELECT Token FROM @TokenTable)...

  • RE: Date Function

    Sergiy (1/25/2016)


    ScottPletcher (1/25/2016)


    Sergiy (1/25/2016)


    MMartin1 (1/25/2016)


    No, since this particular statement is vague the best we can do is start him off with some basics to try and get more information. This...

  • RE: Date Function

    Sergiy (1/25/2016)


    MMartin1 (1/25/2016)


    No, since this particular statement is vague the best we can do is start him off with some basics to try and get more information. This is not...

  • RE: How to figure out whether data is selected from dirty pages?

    GilaMonster (1/22/2016)


    SQL Guy 1 (1/22/2016)


    They agreed with second option, but with condition that the "dirty" records will be marked somehow in the report. So they conditionally accept it.

    Nice idea,...

  • RE: referencing same column in same table but coulum has different values

    My best guess at the code, known as a "cross tab" query, is below. You're not using anything from table B in the code. Are these really the...

  • RE: How to figure out whether data is selected from dirty pages?

    Is the ETL process working in such a way that it gets a table lock? If so, you may be able to remove the table lock and accept that...

  • RE: Date Function

    SumonB (1/20/2016)


    What if today's date is 5th January' 2016.

    Will it show the start date as 21st December'2015 and End date as 5th January'2016

    Yes ... and here's the proof:

    Declare @StartDate Datetime,

    ...

  • RE: Date Function

    If you always need exactly 15 days, just do this:

    Declare @StartDate Datetime,

    @EndDate Datetime

    set @EndDate=DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0) --strip time from date

    set @StartDate = DATEADD(DAY, -15,...

  • RE: Need to calculate nth day of nth month

    Orlando Colamatteo (1/20/2016)


    ScottPletcher (1/20/2016)


    Orlando Colamatteo (1/19/2016)


    ScottPletcher (1/19/2016)


    Of course that code doesn't specify the date key, so it will do a full table scan. Again, vastly too much overhead when two...

  • RE: Date Function

    Sergiy (1/19/2016)


    SumonB (1/19/2016)


    Hi Scott,

    I executed the code today..

    Declare @StartDate Datetime,

    @EndDate Datetime

    if DAY(@StartDate) >= 7

    set @StartDate = DATEADD(day, -15, DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0))

    else

    set @StartDate = DATEADD(DAY, -1, DATEADD(MONTH, DATEDIFF(MONTH,...

Viewing 15 posts - 4,441 through 4,455 (of 7,597 total)