SQL Server Invalid Column Name Error -


i have invalid column name error when inserting record sql server table. here's definition:

create table [dbo].[mytable]  (     [id] int identity(1, 1) not null,     [person_name] varchar(255) not null,     [modified_by] varchar(255) not null ) on [primary] (data_compression = none); go 

and insert

insert mydb.dbo.mytable (id, person_name, modified_by)  values (1, 'aishwarya', 'admin') 

but following error upon execution:

lookup error - sql server database error: invalid column name 'modified_by'.

i can select column fine. thing i've noticed in error "by" capitalized, contrary table definition. ideas?

update: updating syntax errors, apologeez

is database set case sensitive collation? can check running query:

select databasepropertyex('<insert database name>', 'collation') sqlcollation; 

case insensitive collations have ci in name, such sql_latin1_general_cp1_ci_as.

where case sensitive collation might latin1_general_bin.

if database has case sensitive collation, capitalization in t-sql must match column definition.

your post here doesn't include modified_by capitalization in insert statement, double check that. if it's capitalized there properly, check if there triggers on table might have improper spelling.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -