I have a table created with the following schema:
CREATE TABLE [dbo].[Visualizations] ( VisualizationID int identity (1,1) NOT NULL )
Since the table has no settable fields, I'm not sure how to insert a record. I tried:
INSERT INTO [Visualizations]; INSERT INTO [Visualizations] () VALUES ();
Neither work. What is the proper syntax to do this?
Edit: Since a number of people seem confused by my table, it is used purely to represent a parent of a number of sub-tables... each one references this table by FK and each of those FKs are PKs, so that across all of those tables, the IDs are unique.
You can insert NULL value into an int column with a condition i.e. the column must not have NOT NULL constraints. The syntax is as follows. INSERT INTO yourTableName(yourColumnName) values(NULL);
If you want to add data to your SQL table, then you can use the INSERT statement. Here is the basic syntax for adding rows to your SQL table: INSERT INTO table_name (column1, column2, column3,etc) VALUES (value1, value2, value3, etc); The second line of code is where you will add the values for the rows.
There are two basic syntax of INSERT INTO statement is as follows: INSERT INTO TABLE_NAME (column1, column2, column3,... columnN)] VALUES (value1, value2, value3,... valueN);
Your best bet is to copy-paste the data from the Word document into a text file and then use perl, python, java, etc. to generate your insert statements.
See this (example "F. Load data using the DEFAULT VALUES option"):
INSERT INTO [Visualizations] DEFAULT VALUES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With