In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge about "how to create tables in sqlserver". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
The method is as follows:
1: In sql statements, temporary tables have two types: local and global temporary tables. Local temporary tables are only visible in their sessions (transactions), and global temporary tables can be accessed by any program or module in the session (transactions).
2: Create a local temporary table
use db_sqlservergocreate table #db_local_table( id int, name varchar(50), age int, area int)
Temporary tables created cannot be shared with other sessions, and both row and table definitions will be deleted when the session ends
3: Create global temporary tables
use db_sqlservergocreate table ##db_local_table( id int, name varchar(50), age int, area int)
The global temporary table is visible to all users and will not be deleted until every user accessing the table disconnects from the server
4: Create database tables with primary key and foreign key associations
use db_sqlserver;gocreate table db_table5(employee number int primary key, employee number varchar(50) unique, warehouse number varchar(50), salary int) gocreate table db_table6(order number int primary key, order number varchar(50) unique, employee number varchar(50) references db_table5(employee number), order date datetime, sales amount int)
5: Create database tables with check constraint fields
use db_sqlserver;gocreate table db_table7(warehouse number int primary key, employee number varchar(50) unique, warehouse number varchar(50), salary int, area int check(area>=600 and area =800 and base wage =300 and area =300 and area
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.