Andra & my Backbone

New numbering plan

Posted by: Andra on: September 27, 2008

Starting from 17th of October 2008, all mobile and line numbers in Kuwait will change to 8 digits.

This plan principle is straightforward for the public communication in Kuwait. But as an IT worker, I had been heavily occupied by this new arrangement. *sigh*

declare @tables table([name] varchar(50))
declare @table varchar(50)

– find tables contain dslnumber
insert into @tables
SELECT usr.[name]+‘.’+obj.[name]
FROM sysobjects obj inner join sysusers usr on obj.uid = usr.uid
WHERE obj.id IN ( SELECT id FROM syscolumns WHERE name = ‘dslnumber’ ) and obj.type=‘U’ order by obj.[name] asc

SELECT TOP 1 @table = [name] from @tables WHERE [name] > @table order by [name] asc

while @@rowcount>0
begin
  exec(‘exec dslnumber_update @table= ’+ @table)

  SELECT TOP 1 @table = [name] from @tables WHERE [name] > @table order by [name] asc
end

5 Responses to "New numbering plan"

Dra.. kenapa harus “SELECT TOP 1″?

Hiiss tu yang warna-warni Bahasa Kuwait yak? Ga ngertii

@havban ,

supaya row yang diambil cuma 1.

Leave a Reply

Archives