Re: Passing table and column names as parameters

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Peter (zlxmqyt_at_sina.com)
Date: 11/11/04


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
> >
> >
> >
> >
> >
> >
> >
> >



Relevant Pages

  • Re: Word 2003/Access2000/SQLSVR
    ... SQL server being where the data is held and this is accessed through a MS ... entire database and that may be say a record for Berkshire. ... "Peter Jamieson" wrote: ... replaced with the first record on the table in use. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Merge in Word
    ... Peter - that was the problem! ... (here's was missing at certain numbered entries - mine is variable). ... characters" - that sort of thing. ... This has happened when the database is a simple address database in table ...
    (microsoft.public.word.mailmerge.fields)
  • Re: ODBC Ops Nav to MS Access...
    ... the Microsoft jet database engine could not find the object 'APCREC'. ... I clicked on the debug and it highlighted this portion of the VBA: ... Peter Kinsman wrote: ... Public varReturn As Variant ...
    (comp.sys.ibm.as400.misc)
  • Re: Erroneous Errors!
    ... Hi Peter, Thanks for this. ... > column of an Excel spreadsheet which has been linked as a numeric ... >>proprietary database whose properties I cannot change. ... >>these are the tables I download and save onto my machine. ...
    (microsoft.public.access.queries)
  • Re: Error Message: "Undefined function "Date" in expression"
    ... "Peter Hibbs" wrote: ... On several of the members of my team a Reference was missing. ... I made a copy of my OCX file to a network location, ... As soon as the OCX file was replaced, the database worked. ...
    (microsoft.public.access.formscoding)