Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dmenne
Starting Member
5 Posts |
Posted - 2008-07-04 : 13:33:54
|
| Dear Sql-Server-Friends,(I am new here)We are using SQL Server 2005 to manage questionnaire items. A typical table looks likeSubID(primary) Item1 Item 2 .... Item100 ItemHash11 1 3 2 471113 1 4 2 314114 1 3 2 4711(This should be fixed font)Items are always in the range 1..5 or null.There are a few thousand rows per table, and we need a quick way to find those rows (=SubID) with the same item response.We thought of adding a trigger that updates an ItemHash (excluding SubID) computed from the columns. Since there are many tables and many items, it would be nice when the hash procedure where automatic, e.g.OnUpdate/InsertFor each column in @tablename Append entry to a string (nulls could be coded as _) Create hash and update has column.I found the example in http://www.nigelrivett.net/SQLTriggers/AuditTrailTrigger.htmlquite helpful.Is this a good idea? Or are there easier ways to get this? Is it alternatively possible to use an index on the Items Column for quick hashing?Dieter[url][/url][url][/url]Dieter MenneMenne Biomed ConsultingTübingen |
|
|
|
|
|