|
|
|
|
Dynamic SQL Question....
Hi all,
I'm building a stored procedure that takes a few input parameters where each
of the parameters represent columns from different tables in the database.
The parameter's can be null or populated. I can build the WHERE clause of
the SELECT statement dynamically, not a problem.
The question is how do I build the FROM clause to join the right tables? Do
I include all the tables as if I was evaluating all the input parameters?
-THanks! Dave
220 500625
Reply-To: "dfate"
From: "dfate"
Subject: Dynamic SQL Question....
Date: Fri, 14 Jan 2005 13:05:10 -0500
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID:
Newsgroups: microsoft.public.sqlserver.programming
NNTP-Posting-Host: 12.0.170.2
Path: TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
Xref: TK2MSFTNGP08.phx.gbl microsoft.public.sqlserver.programming:500625
Hi all,
I'm building a stored procedure that takes a few input parameters where each
of the parameters represent columns from different tables in the database.
The parameter's can be null or populated. I can build the WHERE clause of
the SELECT statement dynamically, not a problem.
The question is how do I build the FROM clause to join the right tables? Do
I include all the tables as if I was evaluating all the input parameters?
-THanks! Dave
| |