Forum Replies Created

Viewing 15 posts - 6,736 through 6,750 (of 8,731 total)

  • RE: Is there an easy way to get the scripts of a table with only t-sql, not with the wizard?

    I believe that it's easier to use INFORMATION_SCHEMA views.

    SELECT TABLE_SCHEMA,

    TABLE_NAME,

    COLUMN_NAME,

    DATA_TYPE,

    CASE WHEN DATA_TYPE IN( 'char', 'varchar', 'nchar', 'nvarchar') THEN '(' + CAST( CHARACTER_MAXIMUM_LENGTH AS varchar(10)) + ')'

    WHEN DATA_TYPE IN('decimal', 'numeric') THEN...

  • RE: Help with importing Text file

    If that works for you, then great. I tried this: (DT_DBTIMESTAMP)([Transaction Date] +" " + [Transaction Time])

    And worked fine, but it depends on your local settings for dates. Your way...

  • RE: Are the posted questions getting worse?

    Thank you Tom.

    I knew you would come to correct me or explain further what I was trying to say. I totally agree with your post and it shows that...

  • RE: find occurance and remove string

    Would something like this help?

    WITH SampleData(String) AS(

    SELECT 'plan type A change from plan type B from Plan type C' UNION ALL

    SELECT 'Insurance plan M changed from Insurance plan b From...

  • RE: Compare tables with more than 4.9 million records

    ms-techie (3/18/2014)


    Is EXCEPT Clause faster

    or

    is NOT EXISTS Clause faster ?

    Have you tested them? That's the best indicator.

    Someone has made some tests for you. You could thank Gail, but...

  • RE: Are the posted questions getting worse?

    Greg Edwards-268690 (3/18/2014)


    Luis Cazares (3/18/2014)


    Steve Jones - SSC Editor (3/18/2014)


    jcrawf02 (3/18/2014)


    Steve, I think you've just done this too much. Once you understand what you're trying to do, Conceptual and Logical...

  • RE: Exclusion Syntax Help

    I added some sample data to test the solution, but you should provide it for us on future occasions to get faster and better help.

    WITH svkincd (slord, slline) AS(

    SELECT 249486,...

  • RE: Compare tables with more than 4.9 million records

    Have you tried the EXCEPT clause? Do you have indexes in your tables?

  • RE: Date type convervision

    Use DATEADD

    declare @d1, @d2, @d3 datetime

    ...where @d1 between DATEADD(DD,-15,@d2) and DATEADD(DD,15,@d3)

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (3/18/2014)


    jcrawf02 (3/18/2014)


    Steve, I think you've just done this too much. Once you understand what you're trying to do, Conceptual and Logical blend quite a bit,...

  • RE: Help with importing Text file

    I can't test this because my BIDS is not working, but you should end up with something like this:

    (DT_DBTIMESTAMP)[Transaction Date] +" " + [Transaction Time]

    You could check for other possible...

  • RE: Help with importing Text file

    Try setting them as a String, because you can't add a dbtime to a date (don't ask me why, it's just the way they designed them). If you concatenate both...

  • RE: Help with importing Text file

    What type are your [Transaction Date] & [Transaction Time] defined as? If they're not some kind of string, you might need to cast them before concatenating them.

  • RE: Are the posted questions getting worse?

    andrew gothard (3/16/2014)


    GilaMonster (3/16/2014)


    I have two clients where I'm writing up a performance report which includes an entire section on their use of NoLock. Going to be an interesting week

    PHB...

  • RE: How do I get stats on this special "binary" field?

    If I understand correctly, you might be looking for something like this:

    SELECT Division

    ,c2.Cat

    ,SUM( CAST( c.Value AS int)) Total

    FROM #Document

    CROSS APPLY( VALUES(1, SUBSTRING(Cat, 1, 1)),

    (2, SUBSTRING(Cat, 2, 1)),

    (3, SUBSTRING(Cat, 3,...

Viewing 15 posts - 6,736 through 6,750 (of 8,731 total)