Supplied Value(Number) to be added next to previous values

  • HI,

    Is there any one who can answer my this question

    Senario

    --------

    I have a table (HI) with columns (Code,Numbers,)

    The requirement is such that i have to create a SP(Stored Procedure)that will ask me value for (Numbers column)at run time and for code too.

    Suppose i have alrealy inserted the the values from 1 to 20 under number column and with next insertation i want the 15 more numbers to be added under the same column starting from 20 and extent upto 35.

    How i can do this.

  • Not very clear on the requirements. What is the Code field for? Why would they want to add X numbers to the table? What is returned - Numbers that were added? Are the numbers sequential? What happens if 1-20 and then 23-30 are in the table? Do you include 21,22 and then start at 31?

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • I have to agree with Mike here. A little more information is needed...Like what is the code column for as that information might be critical to the manner in which the question is answered.

    Simple Musings From a Simple Developer

  • I am guessing that what you're trying to do would be much more easily accomplished with an IDENTITY value. But, as the others have noted, without more specific information it's hard to tell what you're trying to do.

    └> bt



    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply