Forum Replies Created

Viewing 15 posts - 1,756 through 1,770 (of 1,988 total)

  • RE: tlog backups failing every Sunday

    Log into your server sometime on sunday while the error is occuring and verify that the backup location is actually available 🙂

  • RE: Time difference with dates in same column

    WITH TEMP_CTE AS(SELECT [TimeStamp], ROW_NUMBER() OVER(PARTITION BY (SELECT 1) ORDER BY [TimeStamp] ASC) AS ROW_NUM FROM #Time

    )

    SELECT T_ONE.[TimeStamp], T_TWO.[TimeStamp], DATEDIFF(minute, T_ONE.[TimeStamp], T_TWO.[TimeStamp]) FROM TEMP_CTE T_ONE, TEMP_CTE T_TWO

    WHERE T_ONE.ROW_NUM = T_TWO.ROW_NUM...

  • RE: Nested Break

    So was this a question on why single character variable names @i and @j-2 are terrible choices?

  • RE: Can some one explain this behavior i'm seeing with windows function and update

    Based on your data that update won't work as expected because the rows aren't unique.

    Try this.

    WITH NumCte AS (

    SELECT t.CatName, t.RowNumber,

    RN = ROW_NUMBER() OVER(PARTITION BY t.CatName ORDER BY t.SubCat)

    FROM #TEST...

  • RE: T-SQL to get dates

    SELECT DATEADD(year, -1, DATEADD(MONTH, DATEDIFF(MONTH, '19000201', GETDATE()), '19000101')) AS StartDate1,

    DATEADD(year, -1, DATEADD(MONTH, DATEDIFF(MONTH, '19000101', GETDATE()), '18991231')) AS EndDate1

  • RE: Never Shrink a Database?

    dan-572483 (3/16/2015)


    I never suggested that a weekly shrink job on a production database was a sound practice. I just thought that the commandment "NEVER shrink a database!" was a bit...

  • RE: SQL Server log file space is 5 times the data file

    Transaction log backup.

  • RE: SQL Server log file space is 5 times the data file

    Backing up the log does not reduce the file size, so at some point you used 500GB of log space between transaction log backups. If you need to reclaim...

  • RE: Text Qualifier inside a Text qualified field

    If you're actually expecting data with " in it can you change the file format from say comma delimited with " qualifiers to something else like just | delimited?

  • RE: ORDER BY using UNION

    Well no you haven't aliased your columns the same(you aliased your table) so SQL Server is using the column name of the first select which is why the order by...

  • RE: Convert date format from DB for app

    p.bradley (3/12/2015)


    Correction, my apologies, I am using CONVERT(VARCHAR(10),GETDATE(),103). The application is software text messaging which requires the date in dd/mm/yyyy, as far as I know it does not format.

    That should...

  • RE: Alternate way of using Union ALL

    Sean Lange (3/12/2015)


    This thing screams of denormalized data when I see columns like IRSORRES6, IRSORRES7, IRSORRES8. If you can normalize the data you could eliminate the need to have 3...

  • RE: Convert date format from DB for app

    If it's stored as a varchar you'll need to convert it to a datetime first then convert it to the formatted date you want.

  • RE: Never Shrink a Database?

    The reason why shrink database should typically be avoided is that if the database grew to that size it indicates it needed that much space for some reason so shrinking...

  • RE: Removing / Deleting Data from 2 tables

    The relatively simple way is to put your check for duplicate data into a CTE then just delete from that CTE where ROW_NUMBER != 1.

Viewing 15 posts - 1,756 through 1,770 (of 1,988 total)