i want to add column in a table through following SP

create procedure sp_addCol
@tablename varchar (50)
as 
DECLARE @tsql_TZ varchar (200)
SET @tsql_TZ = 'ALTER TABLE [ '+@tablename+'] ADD timezone varchar (5)'
EXEC(@tsql_TZ)

whenever i try to execute this
through


EXEC sp_addcol 'MGV10SEP_MNPC_MNLD' '
it shows me the error
Cannot alter table ' MGV10SEP_MNPC_MNLD' because this table does not exist in database 'SIL_TESTDB'.

but table is already there in a DB

please help
regards

might want take a look at security and see for the sql user you are executing as is able to 'see' the table and modify it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.