Re: sql query which has got 3 dynamic parameters



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
.



Relevant Pages

  • AVAILABILITY LIST OF MY CONSULTANTS
    ... organizational and Techno Functional skills. ... Profit Center Accounting Product Costing. ... Services, SQL Server 2000 /2005, Crystal Reports, SQL Server Reports ...
    (rec.games.chess.politics)
  • Re: Replication problem - 1024 column
    ... SQL Server does not allow more than 1024 columns for a Table. ... A system with 1024 columns...especially accounting. ... Mike Epprecht, Microsoft SQL Server MVP ... > replication there is one table with 1024 column and hence ...
    (microsoft.public.sqlserver.replication)
  • Re: sql query which has got 3 dynamic parameters
    ... TestData6061 and there are bunch of others so I want to have a query ... parameterise table names - and therefore there is no direct feature to ... Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books ... ... its going to return accounting or if I pass 4 its going to return ...
    (comp.databases.ms-sqlserver)
  • Re: sql query which has got 3 dynamic parameters
    ... basically accounting, fundstructures, transaction contain a set of ... Object Types (each object class would have a bunch of object types ... Well, if you don't care, and want to explain to us what you are working, ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: Query Help Please - Consecutive Dates
    ... > derived data), just because it is easier for humans to work with. ... Thanks for taking your time to explain your business a little more, ... but have no experience of accounting or don't realise the relation ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)