Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2005, 05:38 PM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default tables relations

I make the following steps to generate reports in ASP pages:

1. Users selects tables they want to query.
2. User selects fileds from the selected tables to show on the reports.
3. We allow the user to query via input predefined fileds from the selected tables to produce the report.

this is to generate dynamic report from group of tables.
my question is : this tables have many relations that are unknown because the selected tables to generate the report are different form user to othre, any one know how could i determine the relations between tables from code.
 
Old April 19th, 2005, 06:25 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

I am not very sure as to which views but I think u can get it from the INFORMATION_SCHEMA

Regards
Ganesh
 
Old April 19th, 2005, 02:37 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Not sure why you need to know the relations from code.
SQL Server will handle that for you.
 
Old April 19th, 2005, 02:45 PM
Registered User
 
Join Date: Feb 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You mean that when i write select statment without the relations between tables the sql server will handle it.
 
Old April 19th, 2005, 03:18 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

The relations are created using Enterprise manager or through SQL. Once the are there, you don't need to change them etc.

When you write a SQL SELECT statment, you still need to provide JOIN statements between tables.

   I think you may be confused between what a Relation is and Joining tables.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataset relations not working like expected panda869 C# 0 March 2nd, 2008 12:04 PM
data relations synchronization igalk474 ADO.NET 0 July 21st, 2007 05:36 AM
Standard Implementation of Embeded relations sal XML 1 August 13th, 2005 04:34 AM
Relations (Urgent plz) Samikaraeen Pro VB.NET 2002/2003 0 July 15th, 2004 03:50 AM
get table-relations from database GARAK ADO.NET 0 February 12th, 2004 07:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.