Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid Column Name error
Message
 
 
À
10/11/2010 20:32:17
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01488773
Message ID:
01488774
Vues:
50
You're missing quotes around string literals. Add PRINT @SQL to see it

>
>Was hopiing someone could see why I get this message
>
>Msg 207, Level 16, State 1, Line 8
>Invalid column name 'MMMMM'.
>
>(1 row(s) affected)
>
>
>This is my stored procedure, and the 'MMMMM' is what I passing in as the second parameter.
>
>
>ALTER PROCEDURE [dbo].[AppointmentsSelectByTutorsAndStudentID]
>(
>	@TutorIDs varchar(500),
>	@StudentID char(5)
>)
>AS
>BEGIN
>	SET NOCOUNT ON;
>	DECLARE @SQL varchar(600)
>	
>	SET @SQL = 'SELECT 
>		AppointmentID,
>		TutorID,
>		Description
>	FROM [dbo].[Appointment]
>	WHERE 
>		TutorID IN (' + @TutorIDs + ') OR
>		AppointmentID IN (SELECT AppointmentID FROM StudentAppointments WHERE StudentID = ' + @StudentID + ')' 
>	EXEC(@SQL)
>END
>
>
>
>Here is the window when it runs
>
>USE [StudAthl]
>GO
>
>DECLARE	@return_value int
>
>EXEC	@return_value = [dbo].[AppointmentsSelectByTutorsAndStudentID]
>		@TutorIDs = N'10101, 30303',
>		@StudentID = N'MMMMM'
>
>SELECT	'Return Value' = @return_value
>
>GO
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform