Answer the question
In order to leave comments, you need to log in
Error inserting data into ms sql table?
Greetings dear forum users!
Please help me to solve this problem:
There is a filled table (dbo.Imp) with fields:
[StaffID] [varchar](50) NULL,
[Position Name] [varchar](50) NULL,
[Position Description] [varchar](50 ) NULL,
[Pay Period] [varchar](50) NULL,
[Pay Rate] [varchar](50) NULL.
Data in a table like this:
StaffID | Position Name | Position Description | Pay Period | Pay Rate
1 | text1 | text | text | 0.00
2 | text | text213 | Text43 | 1.42
etc.
Now I'm using this query (look just below), copying the fields from the dbo.Imp table and inserting them into the dbo.Position table:
Fields in dbo.Position:
[PositionId] [smallint] NOT NULL,
[PositionName] [varchar](50) NOT NULL,
[PositionDescription] [varchar](1000) NULL,
[PayPeriod] [varchar](10) NOT NULL,
[Payrate] [decimal](10, 2) NOT NULL,
The query itself:
insert into dbo.Position(PositionId,PositionName, PositionDescription, Payrate, PayPeriod)
select StaffId, [Position Name], [Position Description], [Pay Rate], [Pay Period]
from dbo.Imp
Answer the question
In order to leave comments, you need to log in
You have data loss in two fields
https://social.technet.microsoft.com/Forums/ru-RU/...
https://stackoverflow.com/questions/16172259/msg-8...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question