Forum Replies Created

Viewing 15 posts - 1,261 through 1,275 (of 7,187 total)

  • RE: Why Grant User View Definitions to Database Objects?

    Well, yes - if the users don't need the permission, don't grant it.  Follow the principle of least privilege.

    John

  • RE: difference between early start date and recent end

    Like Luis said, what have you tried?  I'm not here to do your job for you.  Hint: use the DATEPART function.

    John

  • RE: Why Grant User View Definitions to Database Objects?

    Andrew

    If, for example, the users will be troubleshooting performance problems, then they'll need to know the definitions of stored procedures, data types of columns and so on.  That's...

  • RE: SQL Server Cluster Licence Question

    As I understand it (and things may have changed since I last looked at it), you can license only one of your cluster nodes if you intend to run all...

  • RE: difference between early start date and recent end

    WITH StartandEnd AS (
        SELECT
             Rid
        ,    MIN(Start) AS Early
        ,    MAX(End) AS Late
        FROM MyTable
        GROUP BY Rid
        )
    SELECT
         Rid
    ,    DATEDIFF(second,Early,Late) AS...

  • RE: Real Maths

    Good question. Let's investigate.

    USE tempdb;

    SELECT
        -1 AS Col1
    ,    0 AS Col2
    ,    1 AS Col3
    ,    65 AS Col4
    ,    32768 AS Col5

  • RE: Real Maths

    Well, it's the same answer, just rendered differently.  Actually, it's different data types.  Run this, and all will become clear.

    SELECT
         4.0 AS Col1
    ,    CAST(4.0...

  • RE: SQL server Max Memory setting is not working

    What you told SQL Server is that 24GB is the most memory it may use.  If you don't have enough data to fill the buffers, or if you don't use enough...

  • RE: Real Maths

    TomThomson - Tuesday, September 19, 2017 6:46 AM

    I think there's a name for this property, but I can't remember what that...

  • RE: Column Arrangement

    No, you only need it in the Sales Order table, otherwise you introduce redundancy and hence risk the integrity of your data.  Don't denormalise to simplify your queries unless this...

  • RE: Column Arrangement

    Absolutely. Indeed, if the relationship between those two tables is one-to-one, why have separate tables at all?  You could put everything in one table.

    John

  • RE: Concatenate sp_MSForeachdb results

    DROP TABLE #Results
    CREATE TABLE #Results (
         SchemaName sysname NOT NULL
    ,    DBName sysname NOT NULL
    ,    TableName sysname NOT NULL
    ,    IndexName sysname NULL
    ,    Frag decimal NOT NULL

  • RE: Time increments

    Yes, you probably do need something a bit more sophisticated than just a calendar table.  The snippet below will convert your Dates table into a table that just shows the...

  • RE: Time increments

    Create a calendar table in your database, with weekends and other non-working days marked off.  You then only need to add another predicate to your WHERE clause:
    WHERE...

  • RE: DBCC CHECKDB - Offload to another server.

    I would just restore the databases from where the backups are.  You may need to tweak some NTFS permissions, and maybe change some drive letters to UNCs, but it'll cut...

Viewing 15 posts - 1,261 through 1,275 (of 7,187 total)