Forum Replies Created

Viewing 15 posts - 2,596 through 2,610 (of 7,191 total)

  • RE: Need help on query performance

    Sergiy (5/25/2016)


    And from looking at the overall design I can conclude the clustered index on ReportItem must be

    (report_id, flow_name, report_item) INCLUDE (source)

    Do you mean (report_id, flow_name, report_item, source)? ...

  • RE: How to include sp_change_users_login in my program ?

    onlo (5/26/2016)


    I have to run sp_change_users_login, otherwise, I can't add the db_owner right to the user: "user already existed ...."

    But the user is dbo already, so you don't need to...

  • RE: SQL Server Edition downgrade - Question

    Yes, you need to reinstall as Standard (or build a new server and install on there) and then restore the databases on it, including the system databases. First, though,...

  • RE: How to include sp_change_users_login in my program ?

    If userabc has just restored the database, then it's going to be the database owner (dbo), so you shouldn't need to run sp_change_users_login. Unless I've missed something, that is....

  • RE: Speed up Index (non clustered) creation

    You didn't answer the question about the clustered index. But assuming that 's not possible (or not desirable), don't just blindly accept index recommendations from the execution plan. ...

  • RE: Speed up Index (non clustered) creation

    All of the columns? Are you sure you need them all in the index? If you do, have you considered making this index the clustered index?

    John

  • RE: Speed up Index (non clustered) creation

    Try experimenting in dev with the SORT_IN_TEMPDB option, but be aware of the consequences for the size of tempdb. If you have Enterprise Edition, consider using the ONLINE option....

  • RE: The Politics of SQL Security

    RonKyle (5/23/2016)


    I'm with you on all things but the 1433 port. I could easily be convinced, but could someone explain that more or point me to a source that...

  • RE: Split Delimited String Across Fixed Number Of Columns

    Partial solution. Will only work if all elements are four characters long (which they are in your sample data).

    SELECT

    SUBSTRING(Diagnoses_For_Spell,1,4)

    ,SUBSTRING(Diagnoses_For_Spell,6,4)

    ,SUBSTRING(Diagnoses_For_Spell,11,4)

    ,SUBSTRING(Diagnoses_For_Spell,16,4)

    ,SUBSTRING(Diagnoses_For_Spell,21,4)

    ,SUBSTRING(Diagnoses_For_Spell,26,4)

    ,SUBSTRING(Diagnoses_For_Spell,31,4)

    ,SUBSTRING(Diagnoses_For_Spell,36,4)

    ,SUBSTRING(Diagnoses_For_Spell,41,4)

    ,SUBSTRING(Diagnoses_For_Spell,46,4)

    FROM #temptable

    John

  • RE: Simple query question

    So you want to choose the first BL Number in your list for each combination of Port and Vessel? But how do you decide which is the first? ...

  • RE: Keeping the server lists in SSMS

    No, I don't think so - only if you're connected in Object Explorer or a query window. But try it if you're not sure.

    John

  • RE: Keeping the server lists in SSMS

    Yes. Use the Registered Servers window.

    John

  • RE: Can't restore a DB

    Use [font="Courier New"]RESTORE HEADERONLY FROM DISK = '...'[/font] to get size information for the backup(s) in your file (a file can contain more than one backup). Use [font="Courier New"]RESTORE...

  • RE: Locking during Transactions

    That'll depend on a number of things, such as the transaction isolation level. But you can find the answer for yourself by putting a few strategically-placed [font="Courier New"]EXEC sp_lock[/font]...

  • RE: OPENQUERY DELETE

    I'm sorry - I'm out of my depth here. I don't know why you're seeing this behaviour.

    John

Viewing 15 posts - 2,596 through 2,610 (of 7,191 total)