Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 1,246 total)

  • RE: Percentage Calculation in Metrics Report.

    You can also include the percent/ratio in your sql query and pass it as a column to the report via the result set.

    Example ::

    USE ADVENTUREWORKS2008R2;

    Go

    SELECT

    personType, count(*) as Total,...

    ----------------------------------------------------

  • RE: SQL SERVER AGENT JOB probelem it doesnot ROLLBACK the changes made

    I would say that a SQL Server job does not roll back the preceding steps when you encounter a step that fails. You can add all your SP calls to...

    ----------------------------------------------------

  • RE: Ideas on how to flag existing user tables for future deprecation

    To find tables to remove .. I am assuming you want those less/most used to be flagged somehow?

    This tells you the tables most accessed

    SELECT

    t.name AS 'Table',

    SUM(i.user_seeks...

    ----------------------------------------------------

  • RE: Generate script to rebuild indexes in a database

    Nice script. Could be modified to show which are the ones with elevated fragmentation.

    ----------------------------------------------------

  • RE: help with deletion of multiple records

    MMartin1 (5/28/2014)

    You could try

    WITH Ordered AS

    (

    SELECT*, ROW_NUMBER() OVER ( PARTITION BY name ORDER BY Id) AS RN

    FROM #mytable where ID

    in ('TIX123','TIX999')

    )

    select * from ordered

    where RN=1

    to move the...

    ----------------------------------------------------

  • RE: help with deletion of multiple records

    With batches, it is meant you can try something like

    WITH Ordered AS

    (

    SELECT*,

    ROW_NUMBER() OVER ( PARTITION BY name ORDER BY Id) AS RN,

    ROW_NUMBER() OVER ( ORDER BY...

    ----------------------------------------------------

  • RE: help with deletion of multiple records

    You could try

    WITH Ordered AS

    (

    SELECT*, ROW_NUMBER() OVER ( PARTITION BY name ORDER BY Id) AS RN

    FROM #mytable where ID

    in ('TIX123','TIX999')

    )

    select * from ordered

    where RN=1

    to move the data...

    ----------------------------------------------------

  • RE: Options for continuously moving data from 2005 to 2008R2 for a single table

    Keep a watch on the distributor's transaction log, make sure it doesn't fill to capacity or that will halt things.

    ----------------------------------------------------

  • RE: SSRS Report slow

    It could just be the report server that renders the report may be low on Ram or disk space, running a heavy process (maybe a anti-virus scan). Have you looked...

    ----------------------------------------------------

  • RE: Are cursors hard on servers?

    I would take a cursor over a triangular join if I was reporting on a running total in a columns. That's once instance.

    ----------------------------------------------------

  • RE: SQL/SSIS Help

    I'm going to take a wild guess here. You have a exec SP in your ole db datasource ... that itself inserts data to a table... and is also passing...

    ----------------------------------------------------

  • RE: Generating schema and population from XML

    You could use SSIS to guess/generate an XSD for you. Create a data flow task with an xml source. If you have the XSD file then even better. Dump the...

    ----------------------------------------------------

  • RE: Violation of PRIMARY KEY constraint

    hi Lowell,

    I'm curious why you need the +1 in the query

    use msdb;

    GO

    DBCC CHECKIDENT ('dbo.backupset')

    SELECT MAX(backup_set_id) + 1 FROM dbo.backupset

    if the current identity is less than the max row in...

    ----------------------------------------------------

  • RE: Replication Issues

    Not sure. Has the agent account password changed recently? Has disk space on the distributor filled up? Is the transaction log full on the distributor database?

    ----------------------------------------------------

  • RE: Second Last work day of month

    For the current month ...

    WITH MYCTE AS (

    SELECT row_number() over (order by [dates] DESC ) as dayNum, [dates], datename(weekday, dates) as [Day Name]

    FROM

    ( /* the last seven days in...

    ----------------------------------------------------

Viewing 15 posts - 1,006 through 1,020 (of 1,246 total)