Forum Replies Created

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

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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,...

  • 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...

  • 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...

  • RE: Parent child task using stuff

    PSB (1/20/2016)


    Thanks. That worked.

    Great! Do you understand it?

  • 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...

  • 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...

  • 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...

  • 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

    ...

  • RE: Extracting tables from SPs

    You have your logic inverted

    SELECT OBJECT_NAME(referenced_major_id) AS referenced_object_name

    ,COALESCE(COL_NAME(referenced_major_id, referenced_minor_id), '(n/a)') AS referenced_column_name

    ,*

    FROM sys.sql_dependencies

    WHERE object_id = OBJECT_ID('YourStoredProcedureNameAndSchema')

    ORDER BY referenced_object_name, referenced_column_name;

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