Friday, March 23, 2012

Is the word "Name" a reserved word?

Is the word "Name" a reserved word in SQL? look at line 10 of my stored procedure. When I use the word "Name"
it is highlited in blue by SQL Server?

Note I only list part of the stored proc

1 CREATE PROCEDURE [dbo].[GetXMLPeopleNames]
2
3 (
4 @.Status nvarchar(3)
5)
6 AS
7 SELECT
8 PersonId,
9 PersonDescription,
10 Name,
11 UpdateDate,
12 UpdateAppUser
13 FROM
14 Customer WHERECustomer.PersonDescription=@.Status
15 ORDER BY

It is not a reserved word as in Access. It is advised to use brackets to enclose the name. [Name] etc. If you use reserved words in Access, I think the query actually fails (been a long long time since I used Access so not sure if its still an issue), not so in SQL Server.

|||

Yes - it is a reserved word in Access. Here's a great list that covers Access, ODBC, Jet (which you will use with Access) and Sql Server.

http://sqlserver2000.databases.aspfaq.com/what-are-reserved-access-odbc-and-sql-server-keywords.html

[Edit]

Misread the original post which is why my answer doesn't appear to make a lot of sense in relation to it.

But I hope the list is useful...

No comments:

Post a Comment