Thank this author by sharing:
By Lobo Mau,
For Testing script
declare @x table (cod varchar(100))
insert into @x (cod) select 'AAAAAAAA'
declare @i int
set @i = 0
insert into @x (cod) select top 1 dbo.fn_Calc_AlfaSeq(cod) from @x order by cod desc
select * from @x
Select particular table
As a member of SQLServerCentral, you get free access to loads of fresh content: thousands
of articles and SQL scripts, a library of free eBooks, a weekly database news roundup,
a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals
that makes it such a success.