Forum Replies Created

Viewing 15 posts - 376 through 390 (of 13,469 total)

  • RE: Getting rid of duplicate records

    ;WITH MySampleData([ScheduleID],[Location],[StartDate],[EndDate],[Site])
    AS
    (
    SELECT '1','LocationA',CONVERT(date,'8/3/2017'),CONVERT(date,'8/4/2017'),'Site1' UNION ALL
    SELECT '2','LocationA','8/3/2017','8/4/2017','Site2' UNION ALL
    SELECT '3','LocationA','8/5/2017','8/6/2017','Site1' UNION ALL
    SELECT '4','LocationA','8/5/2017','8/6/2017','Site2'
    )

    select Location, StartDate, EndDate, MIN(Site) AS Site

  • RE: Best way to encrypt credit card information?

    AES encryption results in an encrypted string that is still text, so that might require only an enlargement of the field size, and not a data type change.

    I demoed...

  • RE: Read Access to Database Tables - How do you do it in MS-SQL ?

    a public site means you do not know or care who is connecting. you are presenting a limited set of data to the end users.

    so the web page,...

  • RE: SQL 2012 sys databases collation different to instance collation

    there is more script more than just the logins!
    Have you created any server roles(i have a server role to allow read any db for auditors and junior dbas)
    How about any...

  • RE: No Columns Listed in OLE DB Source Editor Window

    is your source a stored procedure call, or a query?
    a stored procedure call would need SET NOCOUNT ON as, multi statements, like workign with temp tables, affects the way...

  • RE: CDC capture job waiting for worker thread

    how are you determining that CDC is not capturing changes?
    CDC reads the log asynchronously, but it reads the log, so it cannot really miss any changes, right?
    are you...

  • RE: SQL Logins from 2005 to 2012, but also to new domain.

    sp_help_revlogin works all the way through SQL2016 and beyond, so stick with that, or it's enhanced user-contributed cousin sp_help_revlogin_roles[/url]

    as far as changing domains, if you can guarantee that mydomain\lowell...

  • RE: Postgres SQL

    I don't have a psotgres linked server any more, but the key was how adding or subtracting to a date is different.
    CURRENT_TIMESTAMP and CURRENT_DATE give you GETDATE() or getdate() with no...

  • RE: sys.dm_db_partition_stats.row_count no longer accurate?

    Something additional I'm noticing: for the seven tables that have inaccurate row counts when compared to actual counts,
    Those are tables that are populated with a TSQL MERGE statement from a staging...

  • RE: When does Powershell become indispensible?

    I've had a couple of aha moments, and like Kevin3F noted, it for things that are outside of SQL servers control, but inside the DBA's sphere of responsibility.

    the first big...

  • RE: Help with SQL Query

    this does what you are asking, I guess:
    this assumes your a ticket is always opened and always closed, and forces an order via the Row_number so i can join...

  • RE: Presentation Software Recommendations

    no, your post is relevant, no worries.
    Every year, I help with the same style of project I mentioned above, and I ask around before I program something.
    I've already...

  • RE: Why doesn't this simple concatenation work?

    you are missing the SET statement, it looks like to me.

    Could you try this format instead?
    DECLARE @s_FilePath nvarchar(255) = '' ;
    SET @s_FilePath = 'what '...

  • RE: Help with SQL Query

    Phils logic looks like it will still work.
    I converted your paste to consumable data

    ;WITH MyCTE([TicketHistoryID],[TicketID],[DateTime],[Name],[TicketActionID],[ID1],[ID2],[TicketStateID],[TicketBoxID],[OwnerID],[PriorityID],[TicketCategoryID],[Myrow])
    AS
    (
    SELECT CONVERT(int,'57440055'),CONVERT(int,'6702938'),CONVERT(datetime,'7/14/17 1:34 PM'),CONVERT(VARCHAR(30),NULL),CONVERT(int,'1'),CONVERT(int,'284'),CONVERT(int,'0'),CONVERT(int,'2'),CONVERT(int,'327'),CONVERT(int,'0'),CONVERT(int,'1'),CONVERT(int,'1'),CONVERT(int,'1') UNION ALL
    SELECT '57440833','6702938','7/14/17...

  • RE: sys.dm_db_partition_stats.row_count no longer accurate?

    OK answering my own question, my assumption was wrong. the count is an approximation. it is not 100% accurate.
    https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-partition-stats-transact-sql

    July 31, 2017 at 10:05 am

    #1953419

    Viewing 15 posts - 376 through 390 (of 13,469 total)