Hello,
I want to insert data into sql data table but even though the fields exist in the database I get this error:
Msg 207, Level 16, State 1, Procedure insertIncid1, Line 53
Invalid column name 'Dayi'. and the same for PoD1 and 4 more
My procedure looks like this:
CREATE procedure insertIncid1
(
@Date DATETIME ,
@Day nvarchar (15),
@TimeFrom NVARCHAR (5),
@PoD1 nvarchar(2),
@TimeTo NVARCHAR (5),
@PoD2 NVARCHAR (2),
@Location NVARCHAR (60) ,
@IncidentType NVARCHAR (50) ,
@Direction NVARCHAR (60) ,
@LaneBlockage NVARCHAR (60) ,
@CCTV NVARCHAR (60) ,
@SignalTimingChanges NVARCHAR (100) ,
@Benefits NVARCHAR (100) ,
@Latitude DECIMAL (18, 6) ,
@Longitude DECIMAL (18, 6)
)
as
begin
INSERT INTO TrafInc1
(
Datei ,
Dayi,
TimeFrom,
PoD1,
TimeTo,
PoD2,
Location ,
IncidentType ,
Direction ,
LaneBlockage ,
CCTV ,
SignalTimingChanges ,
Benefits ,
Latitude ,
Longitude )
VALUES
(
@Date ,
@Day,
@TimeFrom,
@PoD1,
@TimeTo,
@PoD2,
@Location,
@IncidentType,
@Direction,
@LaneBlockage,
@CCTV ,
@SignalTimingChanges,
@Benefits,
@Latitude,
@Longitude
)
end
I didn't have that problem before And than I don't know what happened, what maybe I have unintentionally changed and now the insert procedure doesn't recognize these fields Yes, I did change the structure of the table, but the names are the same and the types as well
Here is the table
CREATE TABLE [dbo].[TrafInc1] (
[IncidentID] INT IDENTITY (1, 1) NOT NULL,
[Datei ] NVARCHAR (10) NULL,
[Dayi ] NVARCHAR (15) NULL,
[TimeFrom ] NVARCHAR (5) NULL,
[PoD1 ] NVARCHAR (2) NULL,
[TimeTo ] NVARCHAR (5) NULL,
[PoD2 ] NVARCHAR (2) NULL,
[Location] NVARCHAR (60) NULL,
[IncidentType] NVARCHAR (50) NULL,
[Direction ] NVARCHAR (60) NULL,
[LaneBlockage] NVARCHAR (60) NULL,
[CCTV] NVARCHAR (60) NULL,
[SignalTimingChanges] NVARCHAR (100) NULL,
[Benefits] NVARCHAR (100) NULL,
[Latitude ] DECIMAL (18, 6) NULL,
[Longitude ] DECIMAL (18, 6) NULL
);
Can anybody help me please what could be the problem?
Thanks
NelPosted Aug 25, 2014, 2:17 PM
Ramesh MaruthiPosted Aug 25, 2014, 11:32 AM
http://stackoverflow.com/questions/13765911/how-do-i-check-if-a-directory-exists-using-sql-server
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8ac1d787-9d15-495d-a81c-2f87f180801d/how-to-check-file-is-exist-or-not-in-directory-using-tsql-store-procedure-sql-server-2005-?forum=transactsql
NelPosted Aug 25, 2014, 11:27 AM
Hi Ramesh,
First thanks, but:
1 The alias names are correct in my sql table
2 All the column names exist
3 But I am not sure whether they are in the same folder (how to check if the table is in masters folder?) I put create table [dbo].[name] and create procedure [dbo].[name]
Ramesh MaruthiPosted Aug 24, 2014, 7:13 PM