Forum Replies Created

Viewing 15 posts - 3,511 through 3,525 (of 8,731 total)

  • RE: Help constructing a complex query

    You just need to use 2 joins in your query.

    There's an example at the bottom of this page: http://www.sql-join.com/

    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: Parent child task using stuff

    Keeping the nulls resulting from the MAX will help you to get the correct format using ISNULL()

    SELECT t1.ParentID,

    t1.TaskID,

    ISNULL( MAX( CASE WHEN ParentID...

    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: Parent child task using stuff

    PSB (1/21/2016)


    Is there any way we can get rid of MAX from MAX( CASE WHEN TaskParentUID = TaskUID THEN TaskName END) OVER(PARTITION BY TaskParentUID) + ' | '

    I am...

    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: Parent and child table structure

    I forgot to come back to mention that problem that might occur. It's easy to fix it. Remember that this is only for displaying purposes as there's no real order...

    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: Parent and child table structure

    Siten0308 (1/20/2016)


    Hello,

    not sure if anyone encountered this before, but I have a custom table made for me (sadly they didnt ask for my input), the structure is like this

    everything is...

    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 to Tsql

    I usually avoid using those kind of styles. When possible, keep dates as dates. Otherwise, use ISO 8601 formats which are not language dependent.

    For date only use YYYYMMDD

    For date 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: Are the posted questions getting worse?

    Phil Parkin (1/20/2016)


    Eirikur Eiriksson (1/20/2016)


    Grant Fritchey (1/20/2016)


    Sitting in a meeting at Redgate talking about plans for SQL Server Central. THE THREAD has come up as a topic. We are currently...

    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?

    Steve Jones - SSC Editor (1/20/2016)


    This is, potentially, the longest thread on the Internet. I'm not sure I've seen anything continue this long, for this length. We were, by far,...

    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: Pivot from daterange?

    Just an advice, this should perform better than the UNION ALL approach and give the same results.

    set @query = 'SELECT EmployeeID

    ,AttType

    ,' + @cols + '

    from

    (

    selectEmployeeID

    ,AttType

    ,AttTime

    ,AttendanceDate...

    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 I do a case sensitive search ( SYNTAX help please )

    They don't work equally.

    The first one uses a binary collation which is the fastest as it will just compare equal bytes.

    The second one is Case Sensitive (CS) and Accent Insensitive...

    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: Parent child task using stuff

    PSB (1/20/2016)


    Thanks. That worked.

    Great! Do you understand 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: How do I do a case sensitive search ( SYNTAX help please )

    You just define the collation the same way.

    These are examples and shouldn't be used as real filters.

    CREATE TABLE tableA(description varchar(100));

    INSERT INTO tableA

    VALUES( 'Unknown'),( 'UNKNOWN'),( 'unknown'),( 'Unknówn');

    Select *

    FROM tableA

    where...

    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: Parent child task using stuff

    You really need to understand how the code works before implementing it. STUFF won't concatenate anything, it'll just exchange strings. There are plenty of articles that explain how this concatenation...

    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 will happen?

    Rodan (1/19/2016)


    So if Trump is elected in the US – do you think we have to worry about him putting up fences around our foreign keys? :w00t:

    I'll worry when he...

    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 tables from SPs

    If you're trying to get cross-database references, maybe you can change these options (I'm not sure if they're available in 2005)

    SELECT referenced_server_name

    ,referenced_database_name

    ,referenced_schema_name

    ...

    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 - 3,511 through 3,525 (of 8,731 total)