Forum Replies Created

Viewing 15 posts - 6,151 through 6,165 (of 7,185 total)

  • RE: how to do-table 1 that check table 2 and adding missing dates

    I think it would help if you posted some DDL for all relevant tables, because I'm confused about what tables you have and what they're for. Please include foreign...

  • RE: how to do-table 1 that check table 2 and adding missing dates

    Create a table of dates (as I suggested in answer to another of your questions) and left join it to table1.

    John

  • RE: Palindrome-SQL

    Karthik

    We're checking that the first character is equal to the last, the second is equal to the second to last, and so on. You only need to do that...

  • RE: Palindrome-SQL

    C'mon, Karthik - do some of the work yourself! What don't you understand?

    John

  • RE: Palindrome-SQL

    Karthik

    Try this.

    John

    DECLARE @word varchar(20)

    DECLARE @length smallint

    SET @word = 'AbleWasIEreISawElba'

    SET @length = LEN(@word)

    IF EXISTS (

    SELECT *

    FROM master.dbo.spt_values

    WHERE type = 'P'

    AND number between 1 and @length/2.0 + 1

    AND SUBSTRING(@word,number,1) <> SUBSTRING(@word,@length-number+1,1)

    )

    PRINT...

  • RE: Palindrome-SQL

    Why don't you want to use REVERSE? Is this a homework question?

    John

  • RE: Query for specific records each new day

    Please will you post your table structure and some sample data and expected results. It's difficult to visualise your problem without this.

    John

  • RE: Problem In Cursor

    If you want to use dynamic SQL then you to use it for the whole statement. Something like this:

    EXEC 'DECLARE C CURSOR FOR ' + @QueryString + ' '

    I...

  • RE: Compare two tables using t-sql.

    Do Antares's solutions not work? If no, tell us why not and we'll see if we can help.

    John

  • RE: how to combine 2 tables worker and holiday

    Please answer my question about the shift column and I'll see what I can do.

    John

  • RE: how to combine 2 tables worker and holiday

    No loop is necessary, especially a loop within a loop, which would kill performance if you have a lot of data. It should be possible to solve this with...

  • RE: how to combine 2 tables worker and holiday

    To solve this, I think you'll need a table of dates. Search this site for Jeff Moden's tally table - this is just a table of sequential numbers, to...

  • RE: view and Trigger

    Not from my reading of it, no. But study the @@IDENTITY topic in Books Online carefully, and maybe carry out a few tests as well.

    John

  • RE: view and Trigger

    dr_csharp (12/18/2007)


    declare @Id int

    INSERT INTO A (CompanyName)VALUES('Iran');

    SELECT @Id=@@IDENTITY

    INSERT INTO B (CompanyID,Tel)VALUES(@Id,'0912')

    Make sure you understand the difference between @@IDENTITY and SCOPE_IDENTITY before rolling this code out into a live environment.

    John

  • RE: order of rows during bulk insert

    So is there no natural key in your Access table, something like create_date or order_number? If not, how about adding an extra column and populating that with an ascending...

Viewing 15 posts - 6,151 through 6,165 (of 7,185 total)