Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 1,838 total)

  • RE: Practicing Deployments

    I think there's a big caveat when using a model of deploying early and often. This approach can too easily lead to a culture where the early adopters of...

  • RE: In a STORE PROCEDURE how to Find which query is causing blocking and / or taking too much time in execution

    if you want to see the stats the database has collected over time for this stored proc, instead of just testing one time execution, you could use the DMVs:

    SELECT

    ...

  • RE: The Year 2013

    I think part of the problem with SAN pools is the inherent disconnect between how network guys setup disk arrays and luns on these devices and how database people want...

  • RE: 'At-Rest Data-Leakage': The Euphemism

    Somewhere in my basement is a box that has old hard disks, going back to when they were only 2 gig in size. Only ones that I've ever let...

  • RE: Script logins

    There's a script available from Microsoft to assist in generating a file that you can use to recreate the logins and same passwords on a different instance. I've used...

  • RE: Restore a database with structure but no data

    Bhuvnesh (12/14/2012)


    use this in every database

    select 'truncate table ' + name + '; ' from sys.objects where type = 'U'

    of course this will fail misserably on every table that...

  • RE: Data Type

    I suppose the best way to decribe it is that a foreign key relationship requires a primary key or unique constraint on the referenced column in the referenced table, so...

  • RE: Data Type

    tanvishriya (12/12/2012)


    -- Creating Unique constraint on [ESId] in table 'ES'

    ALTER TABLE [dbo].[ES]

    ADD CONSTRAINT [IX_ESID] UNIQUE ( [ESID] )

    GO

    -- Creating foreign key on [EStId] in table 'ES'

    ALTER TABLE [dbo].[ES] WITH...

  • RE: Loop through table to pass variables?

    DataAnalyst011 (12/12/2012)


    ...In my production project, the values don't exist and I use the variables to print them into a row for a business process need...

    OK, so if I'm understanding this...

  • RE: Loop through table to pass variables?

    Actually Sean's code will give you the counts you're looking for, and in a more efficient manner than trying to get each one separately using the variable. If the...

  • RE: How to notify through DB MAIL when sql server agent stopped automatically?

    The problem is that SQL Agent is the program you'd typically use to do monitoring and alerting. It sounds like what you really need is some kind of watchdog...

  • RE: can any one explain how this query execute

    narendra.kongara (12/11/2012)


    1> -- Correlated subquery using the department table in both inner and outer queries

    2>

    3> SELECT t1.*

    4> FROM department t1

    5> ...

  • RE: sum on fields between 2 dates

    seems simple enough, your dates should be in the WHERE clause, not GROUP BY clause, like this:

    SELECT sName, SUM(sinterventions) AS sinterventions, SUM(sareas) AS sareas

    FROM mytable

    WHERE DateValue...

  • RE: Group By with Case

    no problem, you made it easy for people to help you by posting the script with the CREATE, and INSERT

  • RE: Group By with Case

    if you don't want to group by dept, then the SUM needs to be outside the CASE structure, like this:

    DECLARE @FYStartDate AS DATE

    SET @FYStartDate = '2012-07-01'

    SELECT PPDate, --Dept,

    ...

Viewing 15 posts - 1,426 through 1,440 (of 1,838 total)