ASE如何取得最大可用设备号 ?



答:

参看如下建设备的脚本.

-----------------------------------------------------------------------------

-- DDL for DatabaseDevice 'temp01'

-----------------------------------------------------------------------------

print 'temp01'

Use master

go

declare @vdevno int

SELECT @vdevno = max(convert(tinyint, substring(convert(binary(4),d.low), v.low,1))) + 1 from master.dbo.sysdevices d, master.dbo.spt_values v where v.type = 'E' and v.number = 3

disk init name = 'temp01', physname = 'E:\ase1250\data\temp01', vdevno = @vdevno, size = 51200, vstart = 67108864, cntrltype = 0

go






你可能感兴趣的:(脚本,Go)