Forum Replies Created

Viewing 15 posts - 5,161 through 5,175 (of 8,731 total)

  • RE: WITH (NOLOCK) Question

    You have 2 main issues in here which cause performance problems.

    1. Multi-statement table-valued function

    2. (Nested) while loops

    Those two can (and will) kill performance severely.

    Your friends here are called inline table...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How do we create a CSV File ? What is the syntax

    You actually posted the way to export a query and the link specifies all the options available.

    Maybe you found this version more readable.

    To copy the previous version is really easy....

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How do we create a CSV File ? What is the syntax

    It would be something like

    EXEC xp_cmdshell 'BCP.exe "Test.dbo.Table" Out "C:\Table.csv" -c -t"****%*****" -SMyTestServer -T -m10 -e"C:\Table.err" -o"C:\Table.out"'

    I linked the article on bcp utility in my previous post. It will...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How do we create a CSV File ? What is the syntax

    That code is from Sybase.

    To export to csv, you need to use the bcp utility. If you want to call it from SSMS, you have to use xp_cmdshell.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Lynn Pettis (2/26/2015)


    ... Mark one off, 1 day on the calendar to go. 1 day on the calendar to go, 1 day to go, ...

    Enjoy the trip as you might...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Share your best possible answers--

    Jeff Moden (2/26/2015)


    Moin Ul Haque (2/26/2015)


    Jeff Moden (2/25/2015)


    Moin Ul Haque (2/25/2015)


    I can quote my own experience here - Out of need, I was asked to develop a database maintenance solution...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Sql Help- Urgent

    Something like this?

    WITH SampleData AS(

    SELECT 'DANIEL SHAFFERS, INCORPORATED.' AS CompanyName UNION ALL

    SELECT 'BUFFETS, INCORPOR. ' UNION ALL

    SELECT 'WAYNE,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Performance tuning

    ANn -425914 (2/26/2015)


    For SQL performance tuning for a query, does the order of columns in where filter clause matters?

    No, column order is irrelevant.

    Also does order of columns matter in join...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: T SQL

    When you included the column from table2 in the WHERE clause, you converted your OUTER JOIN into an INNER JOIN.

    This articles explains what happened: http://www.sqlservercentral.com/articles/T-SQL/93039/

    And here's an example of how...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Lynn Pettis (2/26/2015)


    Sean Lange (2/26/2015)


    Speaking of funny shirts. Here is one that I just got in the mail. I know that Lynn will appreciate this one.

    Yes, I should get one...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Is there a way

    I'm not sure what you're talking about. Can you be more explicit? Where do you want to display the column alias?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: The answer to life, the universe and prime numbers

    Sean Lange (2/26/2015)


    Stewart "Arturius" Campbell (2/26/2015)


    Sean Lange (2/26/2015)


    BWFC (2/26/2015)


    Sean Lange (2/26/2015)


    There was no alternative other than 42 given the context of the question. I didn't even read the question before...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: bcp leaves field terminator at end of line

    I'm not sure what you're doing or how you're getting that. Maybe you have an empty column at the end which simulates a trailing comma.

    Using this code, I didn't got...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: bcp leaves field terminator at end of line

    Are you using a format file?

    Could you post the bcp command that you're using (obfuscating paths and filenames)?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: T-SQL Puzzler - identify sets that have the same items (where set ID and items in same table)

    This is a possible option.

    CREATE TABLE SetsItems(

    SetId int,

    ItemCode varchar(10))

    INSERT INTO SetsItems

    SELECT 1,'A' UNION ALL

    ...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 5,161 through 5,175 (of 8,731 total)