Forum Replies Created

Viewing 15 posts - 256 through 270 (of 522 total)

  • RE: Query Hints

    Hi!

    I think that Join Hints and Table Hints are not Query Hints.

    So instead

    Which of the folowing are valid types of query hints in SQL...

    Best Regards,

    Chris Büttner

  • RE: System Performance - High CPU utilization--> SQLSRV.exe

    Just some additional thought: If you have an index on an identity column and you have a massive amount of inserts, you might face contention during the index maintenance, since...

    Best Regards,

    Chris Büttner

  • RE: SQLCMD or BCP

    RichardB (11/21/2008)


    so why can't you then append the file bcp outputs to the existing file...?

    RichardB, you cannot pipe your data out with BCP like with SQLCMD.

    Best Regards,

    Chris Büttner

  • RE: T-SQL

    Thanks for the question, the batch separator can cause some headaches for newbies.

    But I have some suggestions on how to improve your code:

    1. Do not use "sp_" as stored procedure...

    Best Regards,

    Chris Büttner

  • RE: SQL Query - join table

    Thanks for testing this.

    The union all approach is not really thought through.

    1. It makes more sense to SUM the payments before joining to the invoices.

    This reduces the...

    Best Regards,

    Chris Büttner

  • RE: SQL Query - join table

    Another approach would be the following:

    SELECT InvoiceNo, Sum(Outstanding)

    FROM (

    SELECT InvoiceNo, InvoiceAmount AS Outstanding FROM Invoices

    UNION ALL

    SELECT InvoiceNo, (-1) * CollectedAmount AS Outstanding FROM Payments

    )

    GROUP BY InvoiceNo

    HAVING SUM(Outstanding) <> 0

    Theoretically,...

    Best Regards,

    Chris Büttner

  • RE: Trailing nulls in BULK INSERT / enclosed within Quotes

    Thanks for the feedback, glad I could help.

    Best Regards,

    Chris Büttner

  • RE: Optimizing Physical Temp Tables

    Some more considerations in addition to the others:

    1. Try to load the data in the same order as the clustered index / clustered PK to improve load speed with existing...

    Best Regards,

    Chris Büttner

  • RE: Trigger question

    Good Evening,

    I still have some concerns with the queries.

    The first IF statement checks if any of the rows is already available in your log table.

    So if two Wholesalers have submitted...

    Best Regards,

    Chris Büttner

  • RE: Trailing nulls in BULK INSERT / enclosed within Quotes

    Try removing the last comma

    Best Regards,

    Chris Büttner

  • RE: Using Multiple Select Statements in an Insert Statement

    The row number does not help if there is no valid column for ordering the rows in each table.

    So the question is still open by which column the rows in...

    Best Regards,

    Chris Büttner

  • RE: Using Multiple Select Statements in an Insert Statement

    You need columns for ordering the rows in each of your tables.

    Are such columns available?

    (Remember that per default the rows are unordered, so any select

    against the 3 tables could return...

    Best Regards,

    Chris Büttner

  • RE: Count the number of spaces in a field

    But consider that for unicode strings DATALENGTH = 2*LEN;)

    Best Regards,

    Chris Büttner

  • RE: Log File Page Size

    Hi Carla,

    Thanks for sharing this, but this information was already quoted by the author of the QOTD.

    (Your link is just the BOL version instead of the MSDN version I assume).

    Best Regards,

    Chris Büttner

  • RE: Log File Page Size

    The format of log records and pages is not constrained to follow the format of data pages.

    http://msdn.microsoft.com/en-us/library/ms190925(SQL.90).aspx

    One of the system pages stored in both the primary data file and the...

    Best Regards,

    Chris Büttner

Viewing 15 posts - 256 through 270 (of 522 total)