DECLARE @I intDeclare @id intset @id=1while @id<2365beginSELECT @I =(SELECT [Ac] FROM StdItems where idx=@id )/10update StdItems set ac=@i where idx=@idset @id=@id+1end
2.create procedure dbo.dt_getpropertiesbyid @id int, @property varchar(64)as set nocount on
if (@property is null) or (@property = '') select property, version, value, lvalue from dbo.dtproperties where @id=objectid else select property, version, value, lvalue from dbo.dtproperties where @id=objectid and @property=property
GO