I'm trying to insert some data into a SQL Server table I created from scratch and cannot add the two values I would like to add which is 'Technology Question' under the column technology questions nor am I able to enter a time stamp under my time_entered column.
I'm basically trying to create a Microsoft SQL Server database to eventually take over the existence of an existing SQLite3 database so in my early test case here I am attempting to pull in one piece of data from the existing SQLite3 table into the SQL Server table.
I have tried changing the syntax around in as many ways as I can think of but am failing to get anywhere e.g. ensuring single quote tick around data values etc.
select * from questiontype
select [Technology Questions], time_entered
from questiontype
INSERT INTO questiontype ([Technology Questions], time_entered)
VALUES ('Technology Question', '2019-03-23 16:59')
I was hoping to see the data values 'Technology Question', '2019-03-23 16:59' in their respective columns within the SQL Server table 'questiontype'
When I try to do above I get the following,
Msg 8152, Level 16, State 4, Line 6
String or binary data would be truncated
sp_help 'questiontype'to see the column data types and maximum lengths. If the column's max length is too short to accommodate the data, SQL Server will give you that error.intis a rarely (never) a good idea.intis a keyword, for the data type of the same name, and calling your column that will be confusing. In your insert statement you aren't inserting a value into your columnintand hence the error. It's quite clear here.