Forum Replies Created

Viewing 15 posts - 571 through 585 (of 1,109 total)

  • RE: Foreign Key relationship Error

    Rama (12/3/2007)


    Hi Andras,

    Pls Execuse me for giving late reply. I was away from my office.

    Even i am setting for single column as you said for foreign key references i am...

  • RE: Getting records created in a particular week

    Ramesh (12/3/2007)


    Well, you need to interchange * with /

    You are right, (I probably need to sleep more)

    You'll surely need...:D

    Actually, I did indeed mean *.

    multiplying the year (or part...

  • RE: Getting records created in a particular week

    You are right, (I probably need to sleep more) 🙂

    A corrected version is:

    DATEPART( wk, '3/12/2007' ) + (DATEPART( yyyy, '3/12/2007' )-1950) * 53

    (the *53 should be on the year...

  • RE: How to right-align a text column - SQL Srv 2000

    You could try to add spaces as a prefix, and then take the rightmost n characters, e.g.:

    selectright(space(10) + rtrim('hi'), 10)

    union all

    selectright(space(10) + rtrim('hello'), 10)

    The result is:

    ----------

    ...

  • RE: Getting records created in a particular week

    Prakash (12/3/2007)


    Dear All,

    I want to get the records created in a particular week.

    if i pass 3/12/2007 i want to get the records created in that week

    You could use :

    datepart(wk, '3/12/2007')*53...

  • RE: Convert 2000 (32 bit) to 2005 (64 bit)

    skarsbo (12/3/2007)


    Hi.

    I wonder if it is possible to use the step-by-step method backup/recovery to upgrade the database from 2000 to 2005 and at the same time convert between 32 and...

  • RE: Bypass transaction log with DELETE

    Another thought, do not forget about the indexes 🙂 If you are deleting a large number of rows, you may want to disable unused indexes, and then rebuild them.

    Regards,

    ...

  • RE: Bypass transaction log with DELETE

    Chris Gierlack (11/30/2007)


    I have a staging area where I have to delete massive amounts of. Currently I am deleting it the traditional way with a delete statement executing the...

  • RE: How can I modify/add to this join statement

    bjohnson (11/30/2007)


    Andras - that worked, thanks

    Rameesh - I tried the query but it failed with this error:

    Msg 156, Level 15, State 1, Line 6

    Incorrect syntax near the keyword 'OVER'.

    Msg 102,...

  • RE: How can I modify/add to this join statement

    Try having the following select part:

    SELECT MAX(COALESCE(ih.max_P21_no, iha.max_acclaim_no)) AS last_invoice_no

    , cs.customer_id

    , max(cs.CUSTOMER_NAME)

    Regards,

    Andras

  • RE: Constraint Failure Increments ID

    AVB (11/30/2007)


    I created a table with two columns ID and Type. The ID is an Identity Seed and I created a Check Constraint on the Type column.

    After testing the constraint...

  • RE: Must declare the table variable "@tableName".

    You could use dynamic SQL like:

    declare @q varchar(1000)

    set @q = 'SELECT * FROM ' + @tableName

    exec (@q)

    Regards,

    Andras

  • RE: Foreign Key relationship Error

    Rama (11/29/2007)


    Hi Andras,

    Thank you for your response.

    Primary key is already defined on the table.

    My requirement is FK with empno and empname with emp.

    You can add a unique index...

  • RE: Foreign Key relationship Error

    You need to create a unique index or a primary key on the referenced table. In your case you can do this with:

    ALTER TABLE [test].[emp]

    ADD CONSTRAINT [PK_Emp]

    PRIMARY KEY...

  • RE: Doing deletes in small batches

    Imke Cronje (11/29/2007)


    Hi

    ...

    set rowcount 1000

    while (select * from [Table] with (nolock) where createdt between '2007-04-16' and '2007-04-30')

    BEGIN

    delete from [Table] where createdt between '2007-04-16 00:01:00.000' and '2007-04-16 03:16:02.000'

    if @@rowcount =...

Viewing 15 posts - 571 through 585 (of 1,109 total)