From: GW on
Need help.

Msg 207, Level 16, State 3, Procedure PROC_CLN_DATA, Invalid Column Name ,
Line nn

Received the above error when I execute the following

Thanks.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO

--drop proc PROC_CLN_DATA
ALTER PROCEDURE PROC_CLN_DATA AS

BEGIN
set nocount on

DECLARE @SYS_DATE DATETIME, @sys_dt char(10),@l_count int,@sys_dt1 datetime

declare @old_post_dt varchar(8), @post_dt varchar(8),@post_dt1 varchar(10)

declare @date_mat smalldatetime
set @date_mat = (select getdate()-day(getdate())-1)

SELECT @SYS_DATE = GETDATE()
select @sys_dt1 = dateadd(d,-day(@sys_date),@sys_date)
select @sys_dt = convert(char(10),@sys_dt1,103)
select @sys_dt = replace(@sys_dt,'/','')
select @old_post_dt = post_dt from old_bcb
select @post_dt = post_dt from bcb
select @post_dt1 =substring(@post_dt,1,2)+'/'+
substring(@post_dt,3,2)+'/'+substring(@post_dt,5,4)


update a
set a.br_cd = 'SEA1'
from ccris_ref..nploan a,
seasam b
where ltrim(rtrim(a.loan_acno)) = ltrim(rtrim(b.mano))
and ltrim(rtrim(a.acct_no)) = ltrim(rtrim(b.sano))
From: Hugo Kornelis on
On Fri, 19 Mar 2010 01:24:01 -0700, GW wrote:

>Need help.
>
>Msg 207, Level 16, State 3, Procedure PROC_CLN_DATA, Invalid Column Name ,
>Line nn
>
>Received the above error when I execute the following
(snip)

Hi GW,

It means exactly what it says on the label - you have a column name
misspelled or prefixed with the incorrect table.

If you double-click on the message in SSMS, you'll be positioned in the
immeidate vicinity of the problem - the incorrect column name is
probably in the query you are then positioned on or in the one before
it.

Since you removed the line number from the copied error message, and you
did not include the design of your tables, that's all I can say.

--
Hugo Kornelis, SQL Server MVP
My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis