Forum Replies Created

Viewing 15 posts - 736 through 750 (of 1,409 total)

  • RE: Sum

    select convert(varchar(5), grade), losal, hisal from {table}

    union all

    select 'Total', sum(losal), sum(hisal) from {table}

    I've converted the [grade] column to a varchar datatype in the first SELECT to make it possible to...

  • RE: How to use SELECT query within the WHERE clause

    You have changed some datetime values compared to your initial post/sample. If you alter the filters to include the (startdate and) enddate, both solutions will give the correct results

    --Answer 1

    SELECT...

  • RE: [CLUSTER] Multiple Instances Design

    When you install a SQL instance on a cluster and as a clustered instance, you first need to create a cluster group for each instance. Because this cluster group acts...

  • RE: How to use SELECT query within the WHERE clause

    A more efficient way to get the opposite result is an OUTER JOIN and selecting the non-matching rows (WHERE ... IS NULL).

    SELECT SUM(Boiler1)

    from @Energy_Centre_Availability ECA

    LEFT OUTER join @Energy_Centre_Boiler_Maintenance_Schedule ECBMS

    on ECA.t_stamp...

  • RE: How to use SELECT query within the WHERE clause

    Would this do?

    select *

    from @Energy_Centre_Availability ECA

    inner join @Energy_Centre_Boiler_Maintenance_Schedule ECBMS

    on ECA.t_stamp >= ECBMS.StartDate

    and ECA.t_stamp < ECBMS.EndDate

  • RE: Select first row

    Using the code Koen Verbeek provided and applying this to your table definitions, will result in this code:

    ;WITH CTE_PhoneStartsWith6 AS

    (

    SELECT contact_link.cs_seqno, system.cs_no, contact.last_name, contact.first_name, phone_number

    FROM contact_link

    INNER JOIN site

    ON contact_link.site_no =...

  • RE: Error in creating function

    I can't reproduce your error on my system. I'm able to created the function with your code (changing the ALTER to CREATE). I'm also able to alter this function with...

  • RE: Join of Function or Join of View, which one is cost effective?

    This is hard to tell because your description is too vague.

    You could build both solutions, set the statistics on (set statistics time on; set statistics io on;

    ) and execute both...

  • RE: DBCC CHECKDB & Single User Mode

    Benki Chendu (8/26/2013)


    repair_rebuild didn't fix any errors.

    what must be the next step?

    This thread is from a few years ago.

    Please start a new thread and post your error messages encountered by...

  • RE: smallint to hh:mm

    Here you have the code where each column is a part of the calculation used to get the desired display in the final column. In your own code you only...

  • RE: Error message "BACKUP failed to complete the command BACKUP LOG" in Event Viewer

    evdb68 (8/23/2013)


    Can somebody give me a clue how I can get rid of the error messages?

    Where can I find the command or setup which will backup all databases and log...

  • RE: AD Query failed to work last night.

    Did you setup the linked server using the main administrator credentials? Can you test is the linked server is working at this moment?

  • RE: Full and transaction log backup chain breakup

    Hi Gail,

    I think "anoop.mig29" means (correct me if I'm wrong):

    Restore f1 as a logshipping target and then restore t1 and t2 with the logshipping process. Then manually restore f2 on...

  • RE: Full and transaction log backup chain breakup

    anoop.mig29 (8/23/2013)


    Now in loshiping it allows to restore t3 even if i had restored f2 first(with standby,replace)

    why the difference

    I don't know about the built-in logshipping feature because we use...

  • RE: Distinct Select

    ChrisM@Work (8/23/2013)


    I wouldn't want to bet on that "cannot", HanShi. Perhaps "cannot easily" 😀

    You are absolutely right, but I wanted to prevent a possible "Aah, so it can be done!...

Viewing 15 posts - 736 through 750 (of 1,409 total)