Forum Replies Created

Viewing 15 posts - 3,616 through 3,630 (of 15,381 total)

  • RE: Logical Query Processing order

    chgn01 (11/11/2014)


    The results is right. But for logical query processing, I think efficient way for SQL Compiler is do Top first then Order by. For a large table,...

  • RE: Logical Query Processing order

    chgn01 (11/11/2014)


    Order BY is last, Top should before it.

    No that wouldn't work. How would you know what rows to retrieve when using TOP if you had not already determined the...

  • RE: Logical Query Processing order

    Nadrek (11/11/2014)


    I copy and pasted into a text editor, verified that 1 and 4 were the same, guessed 1 was more likely to get the point, and lost with a...

  • RE: Fragmentation

    arrjay (11/11/2014)


    Or use the undocumented EXEC sp_MSforeachdb command...

    http://www.mssqltips.com/sqlservertip/1414/run-same-command-on-all-sql-server-databases-without-cursors/

    There are some issues with that procedure. Check out this article. http://sqlblog.com/blogs/aaron_bertrand/archive/2010/12/29/a-more-reliable-and-more-flexible-sp-msforeachdb.aspx

  • RE: Fragmentation

    Nita Reddy (11/11/2014)


    How should I run this query against all the DB?

    SELECT db_name(), dbschemas.[name] as 'Schema',

    dbtables.[name] as 'Table',

    dbindexes.[name] as 'Index',

    indexstats.avg_fragmentation_in_percent,

    indexstats.page_count

    FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS indexstats

    INNER...

  • RE: Logical Query Processing order

    The topic is certainly relevant but in a QOTD format it is absurd due to the formatting. Add to that the answers are duplicated and you end up with a...

  • RE: View "design sql statement" and "script view as" - sql miss match - SQL 2008 R2 sp2

    patrickmcginnis59 10839 (11/10/2014)


    I created a view with an * once, and then when the table that the view referenced got its definition changed, the column names in the view did...

  • RE: Date Error

    SQL_Kills (11/10/2014)


    Thanks Sean, but getting the following error

    Conversion failed when converting date and/or time from character string.

    You probably have to set the dateformat first or this will fail. It works...

  • RE: Date Error

    Here is how you could use the existing data to do what you are trying to do.

    SELECT

    left(log_string,10) --This is what you are trying to convert to a date

    ,...

  • RE: Date Error

    SQL_Kills (11/10/2014)


    Hi,

    I get the following error when trying to run the below SQL any ideas on how to get round this?

    The conversion of a varchar data type to a datetime...

  • RE: How to catch even and odd weeks?

    As I said you need to use modulo here.

    Something like this.

    where datepart(week, dato) % 2 = 0

    Please note the above is nonsargable and will force a scan on the entire...

  • RE: How to catch even and odd weeks?

    Edvard Korsbæk (11/10/2014)


    Hi all!

    '

    I have a date stored in a field dato [DATETIME]

    How do i catch about this date is in an even or in an odd week ...

  • RE: Triggers with Linked Server

    manie (11/10/2014)


    Hi all,

    I have a system where people can apply for registration and also a registration fee is involved. The screen where the application is captured has a couple of...

  • RE: variable char

    peter478 (11/10/2014)


    2. concerning global temp table ##amp you are right , but when I change it to #amp I can get output, no feedback (select * from #amp)

    with global...

  • RE: variable char

    peter478 (11/7/2014)


    okay I will try to be realy concrete about what I need, you can forget for code before,It would be long way of explanation.

    just this:

    @group = A

    @SQLString = @SQLString...

Viewing 15 posts - 3,616 through 3,630 (of 15,381 total)