Forum Replies Created

Viewing 15 posts - 61 through 75 (of 1,081 total)

  • RE: Multi-part identifier could not be bound

    If my script doesn't work then one of the columns you are referencing is not in the table that it should be.

    As requested above could you post the DDL please

    EDIT:

    Could...

  • RE: Multi-part identifier could not be bound

    i is the alias for your table it makes the code neater than rewriting the whole name of the table.

    Sorry it's bad alias but you can change it if you...

  • RE: Multi-part identifier could not be bound

    try this:

    UPDATE isd

    SET [rstatus*] = i.[rstatus*]

    FROM dbo_ISD_Lease isd

    LEFT JOIN [dbo_Remedy Import] i ON isd.spconcat = i.rconcat

    WHERE isd.[rstatus*] != i.[rstatus*]

    edit:

    YOU MIGHT WANT TO PUT AN INNER JOIN THERE

  • RE: Retreive records without cursor

    Funny you say that.

    Very often, using an IN or an EXISTS will out perform a JOIN (NOT ALWAYS).

    It's just something that needs to be tested and retried I guess.

    The CTE...

  • RE: Retreive records without cursor

    That will happen only if there is a manual insert in the Identity column. For example, if i'm working in mumbai today and in Pune tmr, the identity value will...

  • RE: Retreive records without cursor

    HEre is an example of what I mean:

    create table employee

    (empno int,

    name varchar(100),

    Office varchar(100))

    create table Posting

    (

    ser int,

    empno int,

    office varchar(100),

    startdate datetime

    )

    Insert into employee

    select 1,'pradeep','mumbai'

    union

    select 2,'kumar','pune'

    union

    select 3, 'singh','bangalore'

    insert into posting

    select 1,1,'delhi',...

  • RE: Retreive records without cursor

    My other concern is that using the MAX on the "Identity" of the postings table is prob not a good idea as this does not mean 100% that you gonna...

  • RE: Retreive records without cursor

    Not sure that it is redundant because if he wants to know the office where the actually employee comes from rather than the office where the post was made, then...

  • RE: Retreive records without cursor

    Why is there an Office field in both tables?

    Did you want the office from the employee or from the posting returned?

  • RE: Retreive records without cursor

    Have you looked in BOL yet?

  • RE: Retreive records without cursor

    Have a look at the following on BOL.

    GROUP BY AND MAX

    and then the left join or inner depending on if you want to show empno with no postiings

  • RE: Bug in CHARINDEX ?

    works for me

    CREATE TABLE Table_Text

    (Col1 TEXT)

    INSERT INTO Table_Text

    SELECT 'http://www.blabla.com/tx/chrts/nln_lstngs/cnrg_ntrm-eng.html'

    select

    patindex('http://www.blabla.com/tx/chrts/nln_lstngs/cnrg_ntrm-eng.html', col1), col1

    from Table_Text

    where col1 LIKE '%http://www.blabla.com/tx/chrts/nln_lstngs/cnrg_ntrm-eng.html%'

    EDIT:

    However if your text is something like this

    'http://www.blabla.com/tx/chrts/nln_lstngs/cnrg_ntrm-eng.html And there is the URL'

    Then...

  • RE: Bug in CHARINDEX ?

    can't you use the ".Write" method of a text column in an update statement to update/replace text?

    EDIT: sorry that method is for nVARCHAR(MAX)

  • RE: CONVERT & CAST

    sqluser (6/12/2009)


    Hi,

    test the date

    DECLARE @test-2 int

    SET @test-2 = 1000.00000

    SELECT STR(@Test,5,2)

    what happened?

    ARUN SAS

    you need to change the length 7 instead of 5.[/quote]

    I don't think that...

  • RE: CONVERT & CAST

    The reason the test code is always coming out as 10 is cause the variable is declared as an INT.

    The reason your origianl query didn't work was because of syntax,...

Viewing 15 posts - 61 through 75 (of 1,081 total)