Groups | Blog | Home
all groups > sql server clients > january 2007 >

sql server clients : Alter command in SP


Rogers
1/12/2007 10:06:54 AM
Can I Alter any of the table through stored procedure. I tried but it didn't
work, if any one guide then I would really appreciated.

Thanks

Hari Prasad
1/12/2007 3:15:01 PM
It works good for me in SQL 2000 and SQL 2005. See the sample below.

create table xx( i int)
go
create proc xproc
as
Begin
alter table xx add j int
End
go
exec xproc
go
select * from xx

Thanks
Hari

[quoted text, click to view]
Rogers
1/15/2007 1:28:38 PM
Thanks Hari, can you try this one. It wont work from my side.

create table xx( i int)
go
create proc xproc
as
Begin
alter table xx add j int
End
select * from xx where j is null
go

exec xproc
go
select * from xx


[quoted text, click to view]

AddThis Social Bookmark Button