易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

You are the administrator of a SQL Server 2000 computer. The server contains a database named Inventory. Users report that several storage locations in the UnitsStored field contain negative numbers. You examine the database's table structure. The table properties are configured as shown in the exhibit.

You correct all the negative numbers in the table. You must prevent the database from storing negative numbers. You also want to minimize use of server resources and physical I/O.
Which transact-SQL statement should you execute?
A.ALTER TABLE dbo.storagelocations ADD CONSTRAINTS CK_storagelocations_UnitsStored CHECK (UnitsStored>= 0)
B.CREATE TRIGGER CK_UnitsStored On StorageLocations FOR INSERT, UPDATE AS IF INSERTED, UnitsStored < 0 ROLLBACK TRAN
C.CREATE TABLE ck_unitsstored As @Units >= 0 GO Sp_bindrule ‘OK_UnitsStored’, ‘StorageLocations, UnitsStored’ GO
D.CREATE PROC UpdateUnitsStored (StorageLocationID int, @UnitsStored bigint)AS IF @UnitsStored < 0 DATSERROR (50099, 17) ELSE UPDATE storaheLocations SET UnitsStored = @UnitsStored WHERE StorageLocationID = @storageLocationID

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

联系客服 会员中心
TOP