Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-06-28 : 09:05:46
|
| Edika writes "I need to pass the name of a table to a stored procedure that must execute an update/Insert on that table. (SQL 7 sp3). I've try to declare a variable in the SP like @tablename as char and as sysname but on the syntax check return an error.the sp is something like this:CREATE procedure agg_dfondi @tablename char, @nvalue int, @ndate smalldatetime,asif (select count(nvalue) from @tablename where ndate=@ndate)=0begin insert into @tablename (nvalue, ndate) values (@nvalue, @ndate)endelsebegin update @tablename set nvalue=@nvalue, ndate=@ndateendif a declare the @tablename as sysname it rreturn the same error, so there is a way to pass the table name to thi SP?" |
|
|
|
|
|