Forum Replies Created

Viewing 15 posts - 31 through 45 (of 53 total)

  • RE: SQL Server-Table having 40 Billion Records

    Have you got a covering index for this query ? Is this index also partitionned ?

    However, it's a lot of data, it will take some time.

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Query to Stored Procedure

    And don't forget to give execution permissions if needed.

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Two fields from two tables of same value not equal

    Float and real are approximate data types. Therefore you should use decimal.

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: SQL Server Jobs scripting

    Select all your jobs, right click, All tasks, generate sql scripts. It's pretty straightforward. 🙂

    http://msdn.microsoft.com/en-us/library/aa177024(SQL.80).aspx

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Urgent help - CASE statement not working for Group By ---

    dhananjay.nagarkar (10/17/2013)


    Thanks for the help on this jonysuise .

    You are a genius 🙂

    it is working as desired now.

    Far far far away from being a genius, thanks 😛

    Anytime. 😛

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Urgent help - CASE statement not working for Group By ---

    Sean Lange (10/17/2013)


    Yes you need the case expression in your group by. You also should really consider using aliases in your queries. It would make this a lot more legible....

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Get last day of the month - 1

    arnipetursson (10/17/2013)


    Surely you meant:

    SELECT DATEADD(d, -2, DATEADD(m, DATEDIFF(m, 0, GETDATE())+1, 0))

    SELECT DATEADD(s, -1, DATEADD(m, DATEDIFF(m, 0, GETDATE())+1, 0))

    returns: 2013-10-31 23:59:59.000

    Indeed. Thanks 🙂

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Urgent help - CASE statement not working for Group By ---

    I think you need to repeat the case statement in your group by clause.

    SELECT [WorkForce_WorkOrder].[Work Order ID_WO]

    --,[WorkForce_WorkOrder].[GHRMS Contingent Worker ID_WO]

    ,[contractor ID] = CASE

    WHEN [WorkForce_WorkOrder].[GHRMS Contingent Worker ID_WO] is null

    THEN...

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Get last day of the month - 1

    DaveDB (10/17/2013)


    I know this is a basic question, but I cannot seem to focus today. Thanks for your time.

    Anytime 🙂

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Get last day of the month - 1

    SELECT DATEADD(s, -1, DATEADD(m, DATEDIFF(m, 0, GETDATE())+1, 0))

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Caching directory info

    Check this post. Might help.

    http://carlosbercero.com/post/?post=Writing_a_CLR_Stored_Procedure_on_SQL_Server

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Caching directory info

    Use master..xp_cmdshell or CLR stored procedures instead.

    master.dbo.xp_dirtree is an undocumented and unsupported procedure.

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Mirroring Reversal

    Steve-0 (10/17/2013)


    Ok just a bit of digging and it looks like the failover is the way to go:

    http://technet.microsoft.com/en-us/library/ms186348(v=sql.105).aspx

    My question at this point is, how does this affect any...

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Mirroring Reversal

    Have you got a witness configured ?

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

  • RE: Mirroring Reversal

    You would need to fail over to the mirrored database in order to make this one as principal i think.

    Jonathan Bernardez Bernardez
    ___________________________________________________________
    DBD. MCSA SQL Server 2012

Viewing 15 posts - 31 through 45 (of 53 total)