You are here: Re: Many data entry tables - which ones hold records? « MsSQL Server « IT news, forums, messages
Re: Many data entry tables - which ones hold records?

Posted by Hugo Kornelis on 10/26/05 22:19

On 26 Oct 2005 07:55:17 -0700, heromull wrote:

>Thank you so much for the support! I think this will work for us. My
>only other question would be about managing the surrogate column
>(RowNo). During Inserts, is there a way to manage it within SQL Server
>or would my client apps need to select max(RowNo) and increase it by 1?

Hi heromull,

A typical INSERT statement would roughly look like this:

INSERT INTO Answers (CustomerId, TableNo, RowNo, [Value])
SELECT @CustomerId, @TableNo, COALESCE(MAX(RowNo),0) + 1, @Value
FROM Answers
WHERE CustomerId = @CustomerId
AND TableNo = @TableNo

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация