Forum Replies Created

Viewing 15 posts - 6,106 through 6,120 (of 8,731 total)

  • RE: How To Group By Values Over None Contiguous Data

    There are several options for these problems called gaps and islands. You could look for more information, but here's a good article: https://www.simple-talk.com/sql/t-sql-programming/the-sql-of-gaps-and-islands-in-sequences/

    Here's an option:

    WITH CTE AS(

    ...

    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: Insert multiple values based on parameter

    Hardy21 (7/22/2014)


    You can pass selected values as comma separated string. With below method, you can insert only selected values to table.

    DECLARE @weekdaySelected NVARCHAR(50)

    DECLARE @tableT TABLE

    ( ClassName NVARCHAR(10),

    WeekdaySelected NVARCHAR(50))

    SET @weekdaySelected...

    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: Insert multiple values based on parameter

    Following Anthony's 8 parameters idea, but replacing the 7 IFs with a single WHERE. 🙂

    DECLARE

    @class char(1) = 'A',

    @sun bit =...

    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: Insert sequence number

    Hey Bob,

    I suggest that you stop using rCTEs to count as they're a form of hidden RBAR and will cause problems. And low row counts don't justify the use 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: I'm totally new. Need some guide on SQL 2012

    So you went and read the page for the exam on Microsoft Learning https://www.microsoft.com/learning/en-us/exam-70-461.aspx. You can find a section called Preparation Options whoch include a variety of ways to prepare.

    Additional...

    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: Insert sequence number

    Why? How do you know you should get to 20, 40, etc? What are your expected results? Could you post sample data in a consumable format?

    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 Rows into Columns

    sleon (7/21/2014)


    Hello Guys

    Really seem like a very long way to do what pivot and unpivot do, or am I missing the point here?

    You still need the groups and column identifiers....

    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: Why is this code deleting only 1 row at a time instead of using the condition and deleting many rows?

    Because the cursor is set to delete one ServiceLogID at a time.

    Even after reading the comments, I'm not sure that it's a good solution, but I don't know the entire...

    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: DBA vs Developer

    jarupan (7/18/2014)


    Hi Grant,

    This is the first time I see about infinity switch. Does it mean unlimited growth in TempDB? If not, would you pleasee explain and how can 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: Total Novice needs help with script

    The problem is that you're using old outer join syntax. You just need to change it as it's no longer supported.

    SELECT a.assignee,

    ...

    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: What Is the Hardest Feature to Learn About SQL Server?

    I'd say that the hardest feature to learn, is the one that you don't care about. I can learn many things as a developer, but don't ask me for HA...

    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: Suggestions on how to improve this View that is using correlated subqueries

    T-SQL beginnger (7/18/2014)


    Any help for the 2nd part guys ?

    Sorry, not from me. I'm not sure I can work something out without some sample data to 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
  • RE: Convert Rows into Columns

    Even if Jeff posted his great article, I wanted to post this thread where I compared the performance in 2 different scenarios.

    http://www.sqlservercentral.com/Forums/Topic1537999-392-1.aspx

    You could try it yourself and compare results. 😉

    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: Cumulative SUM

    John Roy Ellis (7/17/2014)


    That article offers very little, in terms of anything along the lines of examples or knowledge transfer.

    I await another response.

    Thank you.

    John

    You seem like a fast reader. It...

    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 Rows into Columns

    vjonnal1 (7/17/2014)


    I am bit confused here, what's preventing you to use PIVOT function here?

    Maybe a simple preference to use cross tabs instead of pivot. That's my case at least.

    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

Viewing 15 posts - 6,106 through 6,120 (of 8,731 total)