Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Problem using "Active" as a column name

Author  Topic 

zippy
Yak Posting Veteran

69 Posts

Posted - 2001-10-06 : 18:02:04
This is my table,
I have been using it for a while with the Active column in there, it either contains a 1 or a 0 (this is so I dont have to check through the startdates for nulls

CREATE TABLE [dbo].[tblCountries] (
[CountryID] [int] NOT NULL ,
[Active] [int] NOT NULL ,
[Country] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[StartDate] [datetime] NULL
) ON [PRIMARY]

It has been working fine for ages, I have been using a storedprocedure to add countries and update values,
my problem is this,
I am transfering a whole bunch of data from an access database to this, I dont like using DTS so I am just making scripts to execute in asp to do it (maybe not the most elegant way but i find it good - ususally).
When I try to create this sp

CREATE PROCEDURE upAddCountry
@CountryID INT,
@Country VARCHAR(20),
@Active INT,
@StartDate DATETIME
AS
IF Active = 1
INSERT INTO tblCountries (CountryID, Active, Country, StartDate) VALUES (@CountryID, @Active, @Country, @StartDate)
ELSE
INSERT INTO tblCountries (CountryID, Country, Active) VALUES (@CountryID, @Country, @Active)
GO

It gives me this message:
Server: Msg 207, Level 16, State 3, Procedure upAddCountry, Line 7
Invalid column name 'Active'.

Why would that be?

Check out the worlds fastest computers at http://www.ocgurus.com
   

- Advertisement -