Forum Replies Created

Viewing 15 posts - 481 through 495 (of 1,838 total)

  • RE: The SQL Joke Thread

    Luis Cazares - Tuesday, June 12, 2018 12:11 PM

    You got that one from TrumpDBA twitter account

    June 12, 2018 at 12:22 pm

    #1993753

  • RE: The SQL Joke Thread

    Why doesn't President Trump like relational databases?

    He thinks we should use less foreign keys and instead produce more domestic keys.

  • RE: A few quick questions about sysjobhistory table

    I tend to use this formula to convert run_duration into seconds and work with it from there:
    FLOOR(run_duration/10000) * 3600 + FLOOR(run_duration/100%100) * 60 + run_duration%100

    I've...

  • RE: Query Help

    I think the problem here is that in your original source tables you have SOMETABLE, Items, Markets, TerritoryCodes, ProdCoEff
    but I don't see anything from the Market table making it...

  • RE: This really grinds my gears

    How about Excel files that have tons of embedded VBA scripts in them that do all sorts of magic data retrieval and manipulation written by a "power user" of the...

  • RE: User Permissions lost after database backup-restore

    Using sp_change_users_login or alter user will re-associate the database user to an instance login.  Maybe we need clarification on what "permission" seems to be missing after the re-association?

  • RE: Statistics Outdated

    for older versions, you'd probably have to look at sys.sysindexes and the STATS_DATE function to see out of date stats, maybe something like this:
    SELECT OBJECT_SCHEMA_NAME(i.OBJECT_ID) AS TableSchema,...

  • RE: How do you do select and update together that actually works?

    xboxown - Thursday, June 7, 2018 12:23 PM

    Luis Cazares - Thursday, June 7, 2018 11:32 AM

    June 7, 2018 at 2:09 pm

    #1993306

  • RE: Encryption on PII data

    I suppose it depends on the datatype of column.  EncryptByKey will return VARBINARY so if the original column is already that type you might be able to get away with...

  • RE: Primary key incrementation

    Wow, I didn't even realize that's what the OP was saying they were doing.  I often forget that ability is in SSMS because I wish it wasn't there. 😉

  • RE: Primary key incrementation

    If you're using a column with the IDENTITY property, then yes it gets a value when the row is inserted.  If you need to know the value before you do...

  • RE: Date Conversion

    Probably the best approach will be to find the difference in seconds, then convert that to the format you need.  If you know the difference will ALWAYS be less than...

  • RE: SELECT with encrypted data always return NULL fields

    Since you want to decrypt a column value, you don't want to put single quotes around the column name.  It thought you were decrypting a string literal.
    SELECT...

  • RE: SQLOLEDB vs SQLNCLI11

    Try looking at sys.servers instead of sys.sysservers.  sys.servers is the newer system view and is more likely to represent the actual provider used in the link.  For example, on one...

  • RE: Filegroups on different physical drives

    Is the disk provisioned from a SAN?  If so, it's likely all from the same "physical drives" anyway regardless of what the Windows OS sees.

    If you have multiple...

Viewing 15 posts - 481 through 495 (of 1,838 total)