Forum Replies Created

Viewing 15 posts - 4,846 through 4,860 (of 6,037 total)

  • RE: Best Way For Primary Key

    1. Don't use cursors. DO everyting in a single set based statement

    2. Set up indexes.

    3. If you do corelated INSERT/UPDATE on more than 1 table use transactions

    But actually the wole...

    _____________
    Code for TallyGenerator

  • RE: Parse data for recurring value?

    Sriram, I'm afraid, value '7104' is not given, you must to retrive duplicated values from the string inside your script.

    And it may be not a single duplication in the string....

    _____________
    Code for TallyGenerator

  • RE: Table Column as Variable

    SELECT *

    INTO #deleted

    FROM deleted

    -- you may wish to work out data some way here, e.g. delete duplications, apply trims for char values, etc.

    SELECT @tcolname = ('SELECT '+@colname+' FROM #deleted')

    EXEC (@tcolname)

    _____________
    Code for TallyGenerator

  • RE: Parse data for recurring value?

    There is no data model. Neither yours nor anybody's else. Noone just biult one.

    I answered your question, you just did not bother to read.

    Lets try again:

    convert string into single column table...

    _____________
    Code for TallyGenerator

  • RE: Parse data for recurring value?

    You should not.

    What you have is not data and storage of it is not a database.

    To make it data convert all those strings into a column in some table (you...

    _____________
    Code for TallyGenerator

  • RE: Problem with XP_CMDSHELL ''''DIR .....''''

    When you execute command EXEC master..XP_CMDSHELL 'DIR ....\*.*' in query analyzer you run DIR from CMD shell opened from Server, when you execute DIR command in CMD window you must have opened it...

    _____________
    Code for TallyGenerator

  • RE: Strip off year from date field

    Guys, there is a rule - if it becomes too complex then you've chosen wrong direction.

    SELECT BirthDate,

    CASE

    WHEN DATEADD(YY, DATEDIFF(YY, BirthDate, GETDATE()),...

    _____________
    Code for TallyGenerator

  • RE: searching for whole words in text fields

    Jeff, make @Word2Find = 'what' and run it.

    It cannot find "what" because there is no space after it.

    Same problem with dots, commas, etc.

    _____________
    Code for TallyGenerator

  • RE: splitting a string

    Don't tell me about what they send.

    I deal with it every day.

    But it does not mean I let this mess into my database....

    _____________
    Code for TallyGenerator

  • RE: BCP command

    And this "Header" row will eventually end up at the end of the file or somwhere betwen the lines.

    _____________
    Code for TallyGenerator

  • RE: splitting a string

    Does not matter.

    Whatever whoever sends to you turn it into actual data when INSERT, not when SELECT.

    If you (with your code) cannot understand how to convert this s..t they sent...

    _____________
    Code for TallyGenerator

  • RE: Strip off year from date field

    Hope it will help:

    declare @d TABLE (BirthDate datetime)

    INSERT INTO @d (BirthDate)

    SELECT '1955-10-25'

    UNION

    SELECT '1960-11-25'

    UNION

    SELECT '1965-11-05'

    UNION

    SELECT '1970-11-15'

    UNION

    SELECT '1970-12-20'

    UNION

    SELECT '1970-11-01'

    UNION

    SELECT '1970-10-31'

    UNION

    SELECT '1970-11-30'

    SELECT BirthDate, DATEADD(YY, DATEDIFF(YY, BirthDate, GETDATE()), BirthDate) NextBirthday

    FROM @d

    _____________
    Code for TallyGenerator

  • RE: Import errors

    Which wizard?

    _____________
    Code for TallyGenerator

  • RE: splitting a string

    Jeff,

    I did not ask about born name of Pele.

    Bill,

    All he needs to do is:

    1) store all parts of names in database separately;

    2)...

    _____________
    Code for TallyGenerator

  • RE: How do the cursors work?

    What do you mean by "var tables have more chache enables than a temporal table"?

    _____________
    Code for TallyGenerator

Viewing 15 posts - 4,846 through 4,860 (of 6,037 total)