Forum Replies Created

Viewing 15 posts - 3,286 through 3,300 (of 4,085 total)

  • RE: Converting varchar to datetime

    ColdCoffee (3/14/2012)


    How about this?

    SELECT DatetimeasVC , CrsApp1.String , CONVERT( DATETIME , CrsApp1.String) [Converted To DateTime]

    FROM @Table

    CROSS APPLY (SELECT CHARINDEX('.',DatetimeasVC ) ) CrsApp (Idx)

    CROSS APPLY (SELECT LEFT ( DatetimeasVC...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Update a Table after comparing data from 2 differnt tables

    Part of the reason that you are having problems is that your first table is not normalized properly. Instead of having a separate column for each month, you should...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: HELP with a query

    Based on this comment, it looks like you need to add parens to your query.

    ken def


    I'm beginning to think that the OR clauses are allowing the query to go outside...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Changing the auto-number/incremented value (not setting it back to 1)

    Don't let your developer play around in the live database!

    Note that RESEEDing the table can cause problems because of duplicate values if not done carefully. In the vast majority...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Function to find whether last days of the month is weekend

    The calendar table allows you to more easily handle holidays. The fact that the OP said he wanted to return the "next working day (Monday)," indicates that he needs...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Function to find whether last days of the month is weekend

    Check out the following article. Fun with business days, calendar tables, and test-driven development[/url]

    There was a recent thread about calendar tables, but I can't find it right now.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Shredding XML using T-SQL

    ismailmallum (3/8/2012)


    Is there also a way of dynamically changing the Output column in the XML Source component of SSIS. If this is possible the is would be simpler to let...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: update multiple rows with subquery that use EXCEPT

    Try using a CROSS APPLY instead of the EXISTS.

    UPDATE t1

    SET t1.col1 = t2.col1, t1.col2 = t2.col2, t1.col3 = t2.col3, t1.col4 = t2.col4, ........

    FROM t1

    INNER JOIN t2

    ON t2.ID = t1.ID

    CROSS APPLY...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Package Configuration Issue

    Samit Shah (3/7/2012)


    Now when I change the Server Name and Database Name in XML file, it doesn't picks the SQL SERVER Package Configurations which is specified in XML, instead it...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Where clause troubles with variables

    A CASE statement should be faster, because it doesn't have to do the aggregrate calculation (even though there are only two values in the aggregate for each row). My...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Extract XML From SQL

    The standard term is "shredding XML".

    You first need to be familiar with XPath and XQuery. You can find tutorials on the web. Once you feel comfortable with those,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: TRIM, REPLACE, STR, or Use a Shotgun to the SSN field???

    Another option is STUFF()

    STUFF(p.SSN, 1, 7, 'XXX-XX-'

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Join not grouping as desired

    Please refer to the following article on how best to post sample data.

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

    Second, your sample...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to select values

    Jonathan AC Roberts (3/5/2012)


    drew.allen (3/5/2012)


    Jonathan AC Roberts (3/5/2012)


    Create a function to split a string into a table:

    The original question was about taking multiple values and storing them in a single...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to select values

    Jonathan AC Roberts (3/5/2012)


    Create a function to split a string into a table:

    The original question was about taking multiple values and storing them in a single variable, not doing the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,286 through 3,300 (of 4,085 total)