Showing posts with label namefrom. Show all posts
Showing posts with label namefrom. Show all posts

Thursday, February 16, 2012

ADO error: this column does not exist

Table : Department

Col :

Department ID
Name
Description

CREATE PROCEDURE GetDepatmentID AS

SELECT Department ID, Name
FROM Department

RETURN

Trying to create strored procedure and get the error that "Department" column does not exist.

Please know verily new to this so have patienceSince you have a space character in your column name you should enclose the column name in square brackets whenever you refer to it in your SQL statements:


SELECT [Department ID], Name
FROM Department

FWIW Inever use space characters in my column names. I usually use Pascal casing (DepartmentID), and have used camel casing (departmentID) or an underscore (Department_ID) in the past.
Terri