My goal is to create a query based on user input (through a sort of wizard) and populate a matrix table.<BR><BR>The user will be asked several questions and can tick boxes etc. The answers form part of a query that will be dynamically generated (on an ASP page) and will run an SP that then populates a matrix table, which will be used to display certain links for a specific domain. The domain path (www......) is stored in the client table. This way the one db can serve multiple domains at once and show only the relevant links (which are purchased by our clients).<BR><BR>I have been struggling with the following in SQL Server:<BR><BR>I have 7 tables all linked:<BR><BR>1. utBA_States<BR>2. utBA_LegalTopics<BR>3. utBA_LegalAreas<BR>4. utBA_LegalLinks<BR>5. utBA_TypeOfInformation<BR>6. utBA_Clients<BR>7. utBA_ClientLegalLinkMtx<BR><BR>The user will do the following:<BR>1. select the client from the utBA_clients table (1 only)<BR>2. select jurisdiction from the utBA_states table (multiple possible)<BR>3. select legal topic from the utBA_legaltopics table (multiple possible)<BR>4. select legal area from the utBA_legalareas table (a selected list will appear based on the legal areas related to the topic chosen - multiple possible)<BR>5. select type of information from the utBA_typeofinformation table (multiple possible) <BR><BR>This is what I have on the links ASP page and which works well::<BR><BR>Dim ShowLinksRS<BR>Set ShowLinksRS = Server.CreateObject("ADODB.RecordSet")<BR>SQL = "EXEC sp_BA_ShowLinks "<BR>SQL = SQL & "&#039;" & Request.ServerVariables("SERVER_NAME") & "&#039;"<BR>ShowLinksRS.Open SQL, Conn<BR><BR>The SP does a lookup based on the URL:<BR><BR>CREATE PROCEDURE sp_BA_ShowLinks<BR> @baseurl varchar(1024)<BR>AS<BR>SET NOCOUNT ON<BR>SELECT<BR> utBA_TypeOfInformation.TypeOfInformation,<BR> utBA_States.State, utBA_LegalLinks.LegalLinkHeading,<BR> utBA_LegalLinks.LegalLinkName,<BR> utBA_LegalLinks.LegalLinkURL,<BR> utBA_LegalLinks.LegalLinkDescription,<BR> utBA_Clients.BaseURL<BR>FROM<BR> utBA_ClientLegalLinkMtx<BR>INNER JOIN<BR> utBA_Clients<BR>ON<BR> utBA_ClientLegalLinkMtx.ClientID = utBA_Clients.ClientID<BR>INNER JOIN<BR> utBA_LegalLinks<BR>ON<BR> utBA_ClientLegalLinkMtx.LegalLinkID = utBA_LegalLinks.LegalLinkID<BR>INNER JOIN<BR> utBA_States<BR>ON <BR> utBA_LegalLinks.StateID = utBA_States.StateID<BR>INNER JOIN<BR> utBA_TypeOfInformation<BR>ON <BR> utBA_LegalLinks.TypeOfInformationID = utBA_TypeOfInformation.TypeOfInformationID<BR>WHER E<BR> utBA_Clients.BaseURL = @baseurl<BR><BR>It is obvious that the matrix table needs to be populated. I don’t want to display all 1000+ links on one page and have the administrator tick boxes next to it to assign it to a client, topic, area etc.<BR><BR>What is the best approach for this problem?<BR>