Subject | Table name as variable in SQL |
---|---|
Author | wojciech_materna |
Post date | 2004-12-18T09:53:15Z |
Hello,
Do You know a method to put table name as parameter to stored
procedure and retrive columns from it? F.ex I have 5 tables with
different names TABL1,TABL2.... TABL5, same structure - and I want
to create one stored procedure which returns rows (after little
calculation) from one if them - with name passed in anyway to
procedure. The way not to create 5 stored procedures but only one.
Thanks for any answer. (Sorry for my English)
Wojtek
Do You know a method to put table name as parameter to stored
procedure and retrive columns from it? F.ex I have 5 tables with
different names TABL1,TABL2.... TABL5, same structure - and I want
to create one stored procedure which returns rows (after little
calculation) from one if them - with name passed in anyway to
procedure. The way not to create 5 stored procedures but only one.
Thanks for any answer. (Sorry for my English)
Wojtek