Article View: comp.databases.ms-sqlserver
Article #56Need help using parameters in FROM clause
From: Brent Eubanks
Date: Thu, 06 Mar 1997 00:00
Date: Thu, 06 Mar 1997 00:00
32 lines
1245 bytes
1245 bytes
In SQL Server 6.5, I'm trying to write a stored procedure that takes a parameter and uses it in the FROM clause of a SELECT statement. ie: create proc test @office varchar(10) as select ... from @office where... When I try to run this, ISQLW screams and makes reference to the line with the FROM clause. Am I trying to do something that is simply not permitted, or is something else going on? I couldn't find any specific mention of _not_ being able to use variables/parameters in a FROM clause. I would appreciate it if replies were cc'd to my email account: brent@ugcs.caltech.edu Thanks Brent -- -- Brent Eubanks brent@ugcs.caltech.edu
Technical Details
Message-ID:
<5fl1lo$bbe@gap.cco.caltech.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11355a,ce6f816d56eea647,start X-Google-Attributes: gid11355a,public X-Google-Thread: 104de1,ce6f816d56eea647,start X-Google-Attributes: gid104de1,public From: brent@ugcs.caltech.edu (Brent Eubanks) Subject: Need help using parameters in FROM clause Date: 1997/03/06 Message-ID: <5fl1lo$bbe@gap.cco.caltech.edu> X-Deja-AN: 223390133 Organization: California Institute of Technology, Pasadena Keywords: SQL parameter from Newsgroups: comp.databases.ms-sqlserver,bit.listserv.sqlinfo