Help urgent please, I've a piece of code that needs to alter or create a table dinamic, at the end I need to "run" the @stfield.
Thanks in advance
RM
Create procedure P1
as
declare
@cont int,
@stfield varchar(255)
begin
create table t1
(c1 int null)
select @cont = 0
while @cont <5
begin
select @stfield = "alter table t1 add C"+convert(varchar, @contador) + " int null"
select @stfield
select @cont = @cont +1
end
select * from t1
drop table t1
end
go