Re: sql query which has got 3 dynamic parameters
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Tue, 26 Feb 2008 22:14:59 +0000 (UTC)
Vic (vikrantp@xxxxxxxxx) writes:
As mentioned by Ed, yes there are multiple tables which have many
identical columns and they have a few extra columns specific to the
type (say accounting with have its few unique columns same with
fundstructures and other tables in TestData6061). I don't think they
can be merged into a single table, I might be wrong, not sure
What may be the best idea is to construct a view over the common columns:
CREATE VIEW testcases AS
SELECT testcase = 'accounting', [01-RecordClass], [02-RecordAction],
...
FROM accounting
UNION ALL
SELECT 'fundstructures', [01-RecordClass], [02-RecordAction],
...
FROM fundstructures
UNION ALL
...
This presumes that you don't have too many of these tables, as SQL Server
only manages 256 tables in one query.
You would probably have to define dynamically from that file produced by
the Perl script. But from there you could work with the view with static
queries.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- References:
- sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Erland Sommarskog
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Erland Sommarskog
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Ed Murphy
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Ed Murphy
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Ed Murphy
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Erland Sommarskog
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- sql query which has got 3 dynamic parameters
- Prev by Date: Re: Syntax to access database on another server
- Next by Date: Re: reduce time for search query
- Previous by thread: Re: sql query which has got 3 dynamic parameters
- Next by thread: Re: sql query which has got 3 dynamic parameters
- Index(es):
Relevant Pages
|