我正在尝试构建一个基于在此类表中插入 ip 值的查询。它是基于 mmorpg 游戏数据库的。
所以这里是查询
declare @ip1 varchar (max)
declare @ip2 varchar (max)
declare @ip3 varchar (max)
declare @ip4 varchar (max)
set @ip1 = 'xx'--1.IP
set @ip2 = 'xxx' -- 2.IP
set @ip3 = 'xx' -- 3.IP
set @ip4 = 'xx' --4.IP
if exists (select IP3 from _PrivilegedIP where IP3 = @ip3)
begin
print 'Shit, this IP already exist'
end
else if exists (select IP4 from _PrivilegedIP where IP4 = @ip4)
begin
print 'Shit, this IP already exist'
end
else
begin
insert into _PrivilegedIP values(@ip1, @ip2, @ip3, @ip4, @ip1, @ip2, @ip3, @ip4)
print @ip1+'.'+@ip2+'.'+@ip3+'.'+@ip4+'has been added successfully---Omg123'
end
现在,我正在尝试这样做
设置@id='xxx.xxx.xxx.xxx'
然后,它将在点之间拆分值并在表中更新为查询。
有什么帮助吗?