logo       

Re: SQL: msg#00355

windows.devel.dotnet.winforms

Subject: Re: SQL

I think you need BEGIN and END frame in your WHILE


___________
Vince P http://66.93.114.145/vince/

MSN Messenger: this address
AIM: pacelvi

"Nobody said it'd be easy. Nobody said that it would be this hard." -
Coldplay


-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx] On Behalf Of Andrew
Dunn
Sent: Wednesday, 25 February, 2004 20:07
To: DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx
Subject: [DOTNET-WINFORMS] SQL

Can someone tell me what is wrong with this? I get the error:

----------------
Server: Msg 137, Level 15, State 2, Line 16
Must declare the variable '@TABLE_NAME'.
----------------


DECLARE @INSTALLATION_DATE DateTime
DECLARE @NO_MONTHS int
DECLARE @EMPTY_MONTHS varchar(50)
DECLARE @COUNTER int
DECLARE @TABLE_NAME varchar(50)

SET @TABLE_NAME = '__After_Hours_Monthly'
SET @COUNTER = 0
SET @INSTALLATION_DATE = (Select Installation_Date From
__Installation_Date)
SET @NO_MONTHS = DATEDIFF(m,@INSTALLATION_DATE,GETDATE())

WHILE @COUNTER > 0

SELECT * FROM @TABLE_NAME
SET @COUNTER = @COUNTER - 1



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise