Forum Replies Created

Viewing 15 posts - 646 through 660 (of 1,048 total)

  • RE: Column reference

    Kingston Dhasian (3/22/2013)


    kapil_kk (3/22/2013)


    Kingston Dhasian (3/22/2013)


    Yes. A FOREIGN KEY constraint has to be linked to either a PRIMARY KEY constraint or a UNIQUE constraint in another table.

    If the column(s) are...

  • RE: Column reference

    Kingston Dhasian (3/22/2013)


    Yes. A FOREIGN KEY constraint has to be linked to either a PRIMARY KEY constraint or a UNIQUE constraint in another table.

    If the column(s) are not part of...

  • RE: Creating reference

    Kingston Dhasian (3/22/2013)


    You will have to make VoucherNo a UNIQUE KEY in GV_Voucher table.

    Only then you will be able to create the desired FOREIGN KEY constraint.

    Thanks,

    I have implemented it

  • RE: Deterministic

    Raghavendra Mudugal (3/22/2013)


    Thank you for posting, good one.

    Never digged so deep on this area, was interesting to learn.

    +1 🙂

  • RE: Creating reference

    table structure of gv_voucher if anyone required:

    CREATE TABLE [dbo].[GV_Voucher](

    [VoucherId] [int] IDENTITY(1,1) NOT NULL,

    [VoucherTypeId] [int] NOT NULL,

    [VoucherNo] [varchar](20) NOT NULL,

    [Denomination] [int] NOT NULL,

    [ExpiryDate] [datetime] NULL,

    [CreatedDate] [datetime] NULL,

    [ModifyDate] [datetime] NULL,

    [UserId] [varchar](10) NULL,

    [VoucherStatusId]...

  • RE: Deterministic

    For me this question is NON deterministic 😉

  • RE: Delete v Truncate

    well said Hugo 😛

  • RE: Delete v Truncate

    Good basic question...

    Thanks Naseer 🙂

  • RE: Create table structure

    Lowell (3/20/2013)


    kapil_kk (3/20/2013)


    Hi,

    I have a scenario according I have to create a table struture. As I have never designed any table structure based on a scenario of SRS. Plz guide...

  • RE: Data not inserting

    Jeff Moden (3/19/2013)


    Sean Lange (3/19/2013)


    Why not just look at the excellent code that Chris M posted earlier in one of the dozen or so threads on the same topic.

    http://www.sqlservercentral.com/Forums/Topic1432131-391-1.aspx#bm1432134

    Why not,...

  • RE: Data not inserting

    Jeff Moden (3/17/2013)


    kapil_kk (3/16/2013)


    I have solved it..... forget to initialize the IsBookelet variable value ;-):w00t:

    I tried your code and even with the correction you posted, it does nothing because many...

  • RE: Case statement

    Jason-299789 (3/19/2013)


    The simplest way is to do this as you now have the @VoucherType1 set is to dot his

    CASE @vouchertype1

    WHEN 'Discount' THEN @amountvalue

    ...

  • RE: Insertion in table

    ChrisM@Work (3/19/2013)


    kapil_kk (3/19/2013)


    ChrisM@Work (3/19/2013)


    kapil_kk (3/18/2013)


    ...How to achieve this?

    plz help

    Do you need help with the stub code I posted?

    Thanks Chris, I have implemented that thing....

    But I am not clear why you...

  • RE: Case statement

    Jason-299789 (3/19/2013)


    I probably got hold of the wrong end of the stick.

    But I think you will find the problem is the SET @Vouchertype, if you add a Print @VoucherType...

  • RE: Case statement

    Jason-299789 (3/19/2013)


    I think you will find that this is the problem

    SET @vouchertype = LTRIM(RIGHT(@vouchertype,LEN(@vouchertype)-CHARINDEX(' ',@vouchertype,1)));

    As you seem to be taking Right N characters, in @vouchertype, and over Writing it so...

Viewing 15 posts - 646 through 660 (of 1,048 total)