Reorder question

  • Hello all,

    First i want to thank the people on here for all of the help that i have received.

    For instace, this querry allows me to copy all of  the Attributes from on product and give it to another product and the insert the new attribute information into the table with the new productID. Talk about a major blessing!

    This is the test Sproc that  i used on the Northwind database..

    ALTER procedure

    Copy_Info_and_ReInsert

    (@newCustomerId

    nchar (5), @prevCustomerId nvarchar (40))

    as

    SET NOCOUNT ON

    Insert into

    dbo.Customers (CustomerId , CompanyName)

    select

    @newCustomerId , CompanyName

    from

    dbo.Customers

    where

    CustomerId = @prevCustomerId

    and not exists

    (Select * from dbo.Customers PA2 where PA2.CustomerId = @newCustomerId and PA2.CustomerId = Customers.CustomerId)

     

    SET NOCOUNT OFF

     

    For my question today is. Is it possiable to insert a new row into a table where a row already exist?

    For example: I have wood blinds on row 10 and glass tables on row 11,,, now i want to add faux wood blind; however, i do not want to put faux wood blinds on row 300 because it would be so much neater on row 11, (Next to the other blinds). but that row is already filled up. is it posiable to pull the data out and reinsert?

     

    Erik...

     

     

    Dam again!

  • Eric - "it would be so much neater on row 11...."

    is ONLY FOR DISPLAY PURPOSES...

    you don't really care how SQL stores these values internally so long as you're able to retrieve them in the order you want right ?!

    You should have a furniture categories column or something similar for tables, blinds etc.. and within that have a list of products - you would have an index on the product description (or whatever you want to call it) so that when you do a select * from table order by categories, product_description...you will get the rows back in the order you specify!!!







    **ASCII stupid question, get a stupid ANSI !!!**

  • I guess i am foucusing to much on the little things.

    Dam again!

  • I couldn't have put it better myself...







    **ASCII stupid question, get a stupid ANSI !!!**

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

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