Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Error
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Query Error
Divers
Thread ID:
01375273
Message ID:
01375273
Vues:
47
I'm trying to create this proc:
--DROP PROC sp_GetCustomers

GO

CREATE PROCEDURE sp_GetCustomers
	@RecordId		INT = NULL,
	@FirstName		VARCHAR(30) = NULL,
	@LastName		VARCHAR(30) =NULL,
	@CreditLimit	MONEY = NULL,
	@State			VARCHAR(2) = NULL,
	@Active			BIT = NULL
	 
AS

	SELECT * 
		FROM Students
		WHERE ((@RecordId IS NULL) OR (RecordId = @RecordId)) AND 
			  ((@FirstName IS NULL) OR (FirstName = @FirstName)) AND 
			  ((@LastName IS NULL) OR (LastName = @LastName)) AND 
			  ((@CreditLimit IS NULL) OR (CreditLimit = @CreditLimit)) AND 
			  ((@State IS NULL) OR (State = @State)) AND 
			  ((@Active IS NULL) OR (Active = @Active)) 
I'm getting
Msg 207, Level 16, State 1, Procedure sp_GetCustomers, Line 17
Invalid column name 'CreditLimit'.
Msg 207, Level 16, State 1, Procedure sp_GetCustomers, Line 18
Invalid column name 'State'.
Msg 207, Level 16, State 1, Procedure sp_GetCustomers, Line 19
Invalid column name 'Active'.
The column names are correct.

Anyone?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform