Re: Passing table and column names as parameters
From: Peter (zlxmqyt_at_sina.com)
Date: 11/11/04
- Next message: smk23: "Re: CASE statement"
- Previous message: larzeb: "Re: Many to Many design help"
- In reply to: Steve Kass: "Re: Passing table and column names as parameters"
- Next in thread: Anith Sen: "Re: Passing table and column names as parameters"
- Reply: Anith Sen: "Re: Passing table and column names as parameters"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Nov 2004 10:47:02 +0800
Steve,
Like you said, I think it is a good idea to put the information (I just
wanted to put into a table name) into a column of a table .
But still I want to know the answer of my first question: " Is it possible
to pass table names as parameters ?"
Thank you very much
"Steve Kass" <skass@drew.edu> wrote:OLUKKJ5xEHA.2156@TK2MSFTNGP10.phx.gbl...
> Peter,
>
> I think a good question to ask is why you think you need to pass table
> names as parameters. A possible reason is that you are using table
> names to mean something that should be represented as column data in a
> table, not in an object name. Is it possible that the information you
> are putting into a table name (and wanting to pass as a parameter) can
> be represented in a column of a table somehow?
>
> Steve Kass
> Drew University
>
> Peter wrote:
>
> >Hi
> >
> >I have just read the article "The Curse and Blessings of Dynamic SQL"
> >written by Mr.Erland Sommarskog.
> >
> >Below is a piece of his article:
> >
> >"Parameterizing the table name to achieve generic code and to increase
> >maintainability is simply a programmer virtue.But it is just that when
it
> >comes to database objects, the old truth does not hold. You should view
each
> >table and column as a unique and constant object. Why? Because when it
comes
> >to building a query plan, each table has its statistics and presumptions
and
> >for SQL Server they are in no way interchangeable. And in a complex data
> >model, it is important to get a grip of what's being used. When you start
to
> >pass table and column names as parameters, you definitely lose control."
> >I 'm designing my database. My program is used in a kind of instrument.
It
> >will gather data from the instrument and create different tables every
day.
> >So I can't give each table a constant name. I have to pass table name as
> >parameters to my database.
> >
> >After reading the article I begin to wonder if I am on the wrong path. (I
am
> >a newbie to database.)
> >
> >My question is :
> >
> >1. Is it possible to pass table names as parameters ?
> >
> >2. If not, if it is my only chioce to create files other than database
> >tables ?
> >
> >Thanks in advance
> >
> >
> >
> >
> >
> >
> >
> >
- Next message: smk23: "Re: CASE statement"
- Previous message: larzeb: "Re: Many to Many design help"
- In reply to: Steve Kass: "Re: Passing table and column names as parameters"
- Next in thread: Anith Sen: "Re: Passing table and column names as parameters"
- Reply: Anith Sen: "Re: Passing table and column names as parameters"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|