Forum Replies Created

Viewing 15 posts - 4,006 through 4,020 (of 8,731 total)

  • RE: Move row values to the left

    j.sjoelund (10/20/2015)


    Hi,

    I have imported a txtfile to access and have some problem making the data appear in my wanted way. I want to shift the cells in the first row...

    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: Query on a large database

    A fact table with 100 million rows is not that large comparing it to the tables I had in my previous company. However, good indexing is important. We can't give...

    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 to find the first, last and the Highest (Peak Value) in a list

    Another good reference to understand the code is the article on Table Value Constructors

    And here's an example on using APPLY and Table Value Constructors for unpivoting: http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    EDIT: I believe that...

    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 to find the first, last and the Highest (Peak Value) in a list

    Luis Cazares (10/19/2015)


    I'm not making any more shots in the dark if you're not willing to show some effort.

    How to post a T-SQL question on a public forum[/url]

    Forum Etiquette: 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: How to find the first, last and the Highest (Peak Value) in a list

    ITU_dk2012 (10/19/2015)


    The values are for just one person or customer. For example if you select all the values for a given customer, it should list all value for the customer...

    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 to find the first, last and the Highest (Peak Value) in a list

    ITU_dk2012 (10/19/2015)


    Sorry my mistake that I have not posted a clear scenario. Actually I am looking for way to get the first, highest and last value in the list of...

    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: WAITFOR being ignored in stored proc only when called from EF

    Could it be that EF is using 2 different connections? One for the WAITFOR and one for the other code.

    Or is it inside a stored procedure that's being called from...

    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: Hyphen delimited string manipulation

    I'm not sure DISTINCT is the option for this. Since you're using SQL 2012, the LAG function will be of great use.

    Here's an example:

    DECLARE @Route varchar(8000) = 'ABC-BCD-BCD-DEF'

    SELECT STUFF((SELECT ISNULL(...

    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: Query to Split the String as rows and columns in SQL

    This can be done without temp tables as there's a single row returned.

    Unless I'm missing something, here's my suggestion.

    --Dynamic Pivot

    DECLARE @sql NVARCHAR(MAX);

    /*

    STUFF is used to change...

    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: Incorrect rounding with Decimal

    djj (10/19/2015)


    ericvanburen (10/17/2015)


    My code is rounding my values incorrectly and I'm not sure why. In this example, the numerator is 48 and the denominator is 49 which is .9795...

    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 to find the first, last and the Highest (Peak Value) in a list

    You're not exactly following the example by Alan, although, I'm not sure if it's entirely correct.

    Here's an option to do it.

    CREATE TABLE test_2(

    CustomerID int,

    ...

    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: converting inline query into Join

    SQLPain (10/16/2015)


    Wow Luis, that's a masterpiece. !!!!

    Thank you, but it's not really a masterpiece. It's a common technique called crosstabs. You can read more about it in here:

    Cross Tabs...

    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: converting inline query into Join

    You might need something like this:

    WITH Set1 AS(

    SELECT COUNT (DISTINCT CASE WHEN Collector = '3' THEN LoanID END) DT,

    ...

    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: converting inline query into Join

    SQLPain (10/16/2015)


    Thanks Luis, that works. the reason I wanted to do joins is because there are 8 collectors, and I wanted to get rid of inline queries, If I follow...

    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: Which is more efficient? WHERE SUBSTRING = ...or... WHERE fldField LIKE 'x%'

    I altered the test from Chris and run it on my laptop with the following results.

    DECLARE @StringToFind CHAR(8), @Dummy CHAR(36)

    SELECT TOP 1

    @StringToFind = LEFT(CharValue,8)

    FROM #TestData ORDER BY NEWID()

    CHECKPOINT

    DBCC...

    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 - 4,006 through 4,020 (of 8,731 total)