Forum Replies Created

Viewing 15 posts - 5,881 through 5,895 (of 7,597 total)

  • RE: SQL procedure Query Performance issue

    OPENQUERY does not allow variables, only literal/static queries.

    Try code below instead.

    --temporarily add "TOP (100)" to the query for testing purposes

    SET @tsql = STUFF(@tsql, CHARINDEX('SELECT', @tsql) + 6, 0, ' TOP...

  • RE: SQL - case statement

    Eirikur Eiriksson (8/1/2014)


    ScottPletcher (8/1/2014)


    If the table may or may not exist, you'll have to make references to that table only in dynamic SQL. Otherwise, if the code runs and...

  • RE: SQL - case statement

    If the table may or may not exist, you'll have to make references to that table only in dynamic SQL. Otherwise, if the code runs and the table does...

  • RE: Missing Century in Date

    Agreed, nice code.

    But if it's a birthday, wouldn't it be reasonable to use the current date + 1 as the cutoff, since there won't be future birthdates but someone could...

  • RE: DB Autogrowth

    SQL Server provides a stored proc, "'sp_spaceused", to return space info. But annoyingly and frustratingly, it returns two separate result sets.

    For my use, I cloned their proc, adjusting it...

  • RE: Performance tuning classes?

    Books should be more valuable than classes. Look for titles by Kalen Delaney particularly. For general SQL skills, look for Itzik Ben-Gan.

  • RE: DB transaction log file on a shared hosting service

    Shrinking the log file has absolutely no affect on the data indexes and their fragmentation. You would only need to check on index rebuilds if you shrink the data...

  • RE: Tuning a query that takes 60 minutes to run,

    I suspect it's because SQL's internal processing does "ON" clauses before WHERE clauses.

    Therefore, I think they figure the ON clause might eliminate rows sooner than a WHERE clause, and avoid...

  • RE: Instance: table column with default value

    Sean Lange (7/30/2014)


    ScottPletcher (7/30/2014)


    Keith Tate (7/30/2014)

    What can happen if null is not defined?

    If you don't set the NULL option then it will be nullable.

    create table Test1 (

    ExpirationDate datetime);

    go

    That's not true....

  • RE: Instance: table column with default value

    Keith Tate (7/30/2014)

    What can happen if null is not defined?

    If you don't set the NULL option then it will be nullable.

    create table Test1 (

    ExpirationDate datetime);

    go

    That's not true. The default...

  • RE: DB transaction log file on a shared hosting service

    matt6749 (7/28/2014)


    One followup. (Hope I'm not annoying everybody):

    With the Simple recovery model I'm using, would BEGIN TRANS and COMMIT statements help free up space in the log when used as...

  • RE: Indexes - Clustered indexed column included in a nonclustered index

    All clustered keys must appear in all nonclustered indexes. If you don't explicitly specify them, SQL will add them automatically.

    I explicitly specify them when the index function requires them,...

  • RE: Multiple joins to the same table

    Yeah, would have to see the main SELECT to know how to adjust the code properly.

  • RE: disc read latency for mdf/ndf data files

    Generally, you prefer 10ms or less, although up to 20ms is ok. Anything over that is poor and progressively getting worse, of course.

    Again, in general, 100ms is not acceptable,...

  • RE: Policy Based Management - Enabling Transaction Logs

    Yeah, I'm completely lost as to what the code is trying to code. And if the db is offline, you won't be able to access the view "sys.database_files" within...

Viewing 15 posts - 5,881 through 5,895 (of 7,597 total)