Forum Replies Created

Viewing 15 posts - 7,756 through 7,770 (of 8,731 total)

  • RE: query is taking long time to run

    If it's a simple "SELECT * FROM Table", I would look for blocking issues.

    It's hard to give a correct advise with so little information. What's the size of the 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: Grouping data...

    There's a method that it's described in the following article

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    Read it and return to ask anything that you don't understand.

    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 help with unpivot qry

    I'm glad it worked. I missed the Subcat12, but if you found out how to modify it, it means that you at least understand how the query is created. Be...

    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: Datatype conversion

    What do you want to do with non-numeric values?

    What are you going to do with this data?

    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: Summarizing multiple colummns from a table

    So the output from your query is correct?

    The only difference I see is that you repeat the FID

    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: Summarizing multiple colummns from a table

    Why do you have this

    FaultlinID, CVE, OPEN, CLOSED, TOTAL

    3623, CVE-2013-1212, 3623, 1, 0, 1

    3624, CVE-2013-1213, 3624,1,2,3

    Instead of this?

    FaultlinID, CVE, OPEN, CLOSED, TOTAL

    3623, CVE-2013-1212, 3623, 1, 0, 1

    3624, CVE-2013-1213, 3624,1,3,4

    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 help with unpivot qry

    There's an alternate method to UNPIVOT using CROSS APPLY, you could read about it on the following link to understand the code I'm posting.

    http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    SELECT itemNoAS Item,

    CatAS CatID,

    SubCatAS SubCatID

    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: Count and Sum over the some table

    I'm glad it helped you to learn more 🙂 Although all credit should go to Jeff.

    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: Year to Date Query ... By month?

    No need for a loop, you can change your condition to your columns instead of the whole query. Here's one example, but to get it working you need to provide...

    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: Joining Tables

    You'll find out that posting DDL, sample data and expected results all in a consumable format that we can copy and execute without anyother effort will give you better and...

    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: Extracting a Date from a string

    jsteinbeck-618119 (8/19/2013)


    I will for sure be trying this...

    I have to fix code that extract's the date from the text; so I can try my example data I posted and see...

    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: Extracting a Date from a string

    Ed Wagner (8/19/2013)


    Luis Cazares (8/19/2013)


    As you're using SQL Server 2012, why won't you use TRY_CONVERT with a string Splitter[/url]?

    WITH CTE AS(

    SELECT TRY_CONVERT( DATETIME, Item) AS MyDate

    FROM #temp t

    CROSS APPLY dbo.DelimitedSplit8K(...

    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?

    Ed Wagner (8/19/2013)


    Ville-Pekka Vahteala (8/19/2013)


    wolfkillj (8/19/2013)


    Stefan Krzywicki (8/19/2013)


    Sean Lange (8/19/2013)


    Stefan Krzywicki (8/19/2013)


    The Dixie Flatline (8/19/2013)


    Just looking in a minute, while stopping to grab a donut. I...

    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: Count and Sum over the some table

    Applying cross tabs with different aggregations it's quite easy.

    Read the following articles to find more information on cross tabs

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    and read the article linked on my signature to follow best...

    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: Convert character data to decimal

    No need to reinvent the wheel, you just need the CONVERT

    SELECT CONVERT(decimal (18,2),TestData)

    FROM #Test

    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 - 7,756 through 7,770 (of 8,731 total)