我只想在数据库中创建一个新表,当我创建表时,得到了一些消息,例如
信息102,级别15,状态1,第5行,'tbl_invoice'附近的语法不正确。”
所以我的问题是我应该从哪里开始制作新桌子?
use master
use db_penjualan
create table tbl_invoice (
no_invoice varchar primary key (10),
jenis_pembayaran varchar(25),
user_generate varchar (10),
tgl_terbit date not null )
;
消息
消息102,级别15,状态1,第5行附近的语法不正确 'tbl_invoice'。
答案 0 :(得分:0)
问题在于主键声明语法。写为:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.4.RELEASE)
2019-04-28 22:51:09.741 INFO 73751 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication on xxx-MacBook-Pro.local with PID 73751 (/Users/strelok/code/demo-sb/target/classes started by strelok in /Users/strelok/code/demo-sb)
2019-04-28 22:51:09.745 INFO 73751 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default
2019-04-28 22:51:10.943 INFO 73751 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 16.746 seconds (JVM running for 23.386)
Name: Test