- 康康map
-
DROP TABLE CELL_TCH;
DROP TABLE MS;
DROP TABLE MSC;
DROP TABLE BSC;
DROP TABLE BTS;
DROP TABLE CELL;
DROP TABLE ANTENNA;
DROP TABLE DATA;
DROP TABLE TEST;
DROP TABLE NEIGHBOR;
CREATE TABLE MSC (
MSCID INTEGER NOT NULL,
MSCNAME CHARACTER (10),
MSCCOMPANY CHARACTER (10),
MSCLONGITUDE DECIMAL (9,6),
MSCLATITUDE DECIMAL (8,6),
MSCALTITUDE INTEGER,
PRIMARY KEY ( MSCID) ) ;
CREATE TABLE BSC (
BSCID INTEGER NOT NULL,
BSCNAME CHARACTER (10),
BSCCOMPANY CHARACTER (10),
LONGITUDE DECIMAL (9,6),
LATITUDE DECIMAL (8,6),
MSCID INTEGER,
PRIMARY KEY (BSCID),
FOREIGN KEY (MSCID) REFERENCES MSC (MSCID)) ;
CREATE TABLE BTS (
BTSNAME CHARACTER (20) NOT NULL,
BSCID INTEGER NOT NULL,
LONGITUDE DECIMAL (9,6),
LATITUDE DECIMAL (8,6),
ALTITUDE INTEGER,
BTSCOMPANY CHARACTER (10),
BTSPOWER DECIMAL (2,1),
PRIMARY KEY (BTSNAME),
FOREIGN KEY (BSCID) REFERENCES BSC (BSCID)) ;
CREATE TABLE CELL (
CELLID INTEGER NOT NULL,
BTSNAME CHARACTER (20),
AREANAME CHARACTER (10),
LAC INTEGER,
LONGITUDE DECIMAL (9,6),
LATITUDE DECIMAL (8,6),
DIRECTION INTEGER,
RADIOUS INTEGER,
ANTNUM INTEGER,
BCCH INTEGER,
PRIMARY KEY ( CELLID),
FOREIGN KEY (BTSNAME) REFERENCES BTS (BTSNAME)) ;
CREATE TABLE MS (
IMEI BIGINT NOT NULL,
MSISDN BIGINT,
USERNAME VARCHAR(10),
MSCOMPANY VARCHAR (20),
GSMMSPSENSE INTEGER,
GSMMSHEIGHT DECIMAL (3,2),
GSMMSPFOUT DECIMAL (3,2),
MZONE CHARACTER (10),
CELLID INTEGER,
PRIMARY KEY ( IMEI),
FOREIGN KEY (CELLID) REFERENCES CELL (CELLID)) ;
CREATE TABLE ANTENNA (
CELLID INTEGER NOT NULL,
ANTENNAHIGH INTEGER,
HALFPANGLE INTEGER,
MAXATTENUATION INTEGER,
GAIN INTEGER,
ANTTILT INTEGER,
PT INTEGER,
MSPWR INTEGER,
PRIMARY KEY ( CELLID));
CREATE TABLE CELL_TCH (
CELLID INTEGER,
FREQ INTEGER,
FOREIGN KEY (CELLID) REFERENCES CELL (CELLID));
CREATE TABLE DATA (
DATE INTEGER NOT NULL,
TIME INTEGER NOT NULL,
CELLID INTEGER NOT NULL,
NTCH INTEGER,
TRAFF DECIMAL (9,7),
RATE DECIMAL (10,9),
THTRAFF DECIMAL (9,7),
CALLNUM INTEGER,
CONGSNUM INTEGER,
CALLCONGS DECIMAL (10,9),
PRIMARY KEY ( DATE,TIME,CELLID)) ;
CREATE TABLE TEST (
KEYNUM INTEGER NOT NULL,
CELLID INTEGER,
LATITUDE DECIMAL (9,6),
LONGITUDE DECIMAL (8,6),
RXLEV DECIMAL (9,6),
PRIMARY KEY ( KEYNUM),
FOREIGN KEY (CELLID) REFERENCES CELL (CELLID));
CREATE TABLE NEIGHBOR (
CELLID INTEGER,
ADJCELLID INTEGER,
CELLLAC INTEGER,
ADJCELLLAC INTEGER,
FOREIGN KEY (CELLID) REFERENCES CELL (CELLID));
IMPORT FROM "C:msc.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6) MESSAGES "1" INSERT INTO DB2ADMIN.MSC (MSCID, MSCNAME, MSCCOMPANY, MSCLONGITUDE, MSCLATITUDE, MSCALTITUDE);
IMPORT FROM "C:sc.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6) MESSAGES "1" INSERT INTO DB2ADMIN.BSC (BSCID, BSCNAME, BSCCOMPANY, LONGITUDE, LATITUDE, MSCID);
IMPORT FROM "C:ts.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6, 7) MESSAGES "1" INSERT INTO DB2ADMIN.BTS (BTSNAME, BSCID, LONGITUDE, LATITUDE, ALTITUDE, BTSCOMPANY, BTSPOWER);
IMPORT FROM "C:cell.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) MESSAGES "1" INSERT INTO DB2ADMIN.CELL (CELLID, BTSNAME, AREANAME, LAC, LONGITUDE, LATITUDE, DIRECTION, RADIOUS, ANTNUM, BCCH);
IMPORT FROM "C:data.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) MESSAGES "1" INSERT INTO "DATA" (DATE, TIME, CELLID, NTCH, TRAFF, RATE, THTRAFF, CALLNUM, CONGSNUM, CALLCONGS);
IMPORT FROM "C:ms.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6, 7, 8, 9) MESSAGES "1" INSERT INTO DB2ADMIN.MS (IMEI, MSISDN, USERNAME, MSCOMPANY, GSMMSPSENSE, GSMMSHEIGHT, GSMMSPFOUT, MZONE, CELLID);
IMPORT FROM "C:Cell_TCH.csv" OF DEL METHOD P (1, 2) MESSAGES "1" INSERT INTO DB2ADMIN.CELL_TCH (CELLID, FREQ);
IMPORT FROM "C: est.csv" OF DEL METHOD P (1, 2, 3, 4, 5) MESSAGES "1" INSERT INTO DB2ADMIN.TEST (KEYNUM, CELLID, LATITUDE, LONGITUDE, RXLEV);
IMPORT FROM "C:antenna.csv" OF DEL METHOD P (1, 2, 3, 4, 5, 6, 7, 8) MESSAGES "1" INSERT INTO DB2ADMIN.ANTENNA (CELLID, ANTENNAHIGH, HALFPANGLE, MAXATTENUATION, GAIN, ANTTILT, PT, MSPWR);
IMPORT FROM "C: eighbor.csv" OF DEL METHOD P (1, 2, 3, 4) MESSAGES "1" INSERT INTO DB2ADMIN.NEIGHBOR (CELLID, ADJCELLID, CELLLAC, ADJCELLLAC);
自己写的SQL脚本,做数据库试验时写的。
- bikbok
-
create table student
(
自动编号 int identity(1,1)
学号 varchar(20) not null primary key
姓名 varchar(16) not null
所在班级 varchar(30)
...
)
或者
create table student
(
自动编号 int identity(1,1)
学号 varchar(20) not null
姓名 varchar(16) not null
所在班级 varchar(30)
...
primary key(学号)
)
说明:自动编号可有可无。
- tt白
-
create table 表名
(
字段名 类型,
字段名 类型
)
这是建数据表。
但你说的建表格就不清楚了。
- 以心消业
-
create table t1
(
tid int inentity (1,1) primary key,
tname varchar(20),
tpwd varchar(20)
)
- 余辉
-
当 SQL Server Database Engine 与应用程序通信时,它将使用称为“表格格式数据流”(TDS) 数据包的 Microsoft 通信格式来格式化通信数据。服务器和客户机上的 Net-Library 都可以将 TDS 数据包封装到标准通信协议中,如 TCP/IP 或 Named Pipes。在通信的服务器端,Net-Library 是数据库引擎 的一部分。在客户端,Net-Library 是 SQL Native Client 的一部分。不直接配置 Net-Library。而是配置服务器和 SQL Native Client 来使用网络协议。然后,数据库引擎 和 SQL Native Client 自动使用相应的 Net-Library 设置。服务器为每个网络协议创建一个称为“TDS 端点”的 SQL Server 对象。在服务器上安装 SQL Server 期间,SQL Server 将安装 Net-Library 和 TDS 端点。
创建端点并定义其属性,这些属性包括可用于客户端应用程序的方法。关于相关权限的信息,请参阅 GRANT 端点权限 (Transact-SQL)。
CREATE ENDPOINT 的语法在逻辑上分为两部分:
第一部分从 AS 开始,到 FOR 子句之前结束。
在此部分中,需要提供传输协议(TCP 或 HTTP)特定的信息,设置端点的侦听端口号,以及设置端点身份验证的方法和/或要限制访问端点的 IP 地址列表(如果有的话)。
第二部分从 FOR 子句开始。
在此部分中,需要定义端点上所支持的负载。该负载可以为下列几种受支持的类型之一:SOAP、Transact-SQL、Service Broker、数据库镜像。在此部分中,还需要提供语言特定信息。例如,在使用 HTTP SOAP 期间,需要标识要在端点中将其公开为 Web 方法的过程。对于每种 Web 方法,需要标识相应的 SQL Server 存储过程或它所映射到的用户定义函数。这样,客户端应用程序就可以在端点中发送调用这些方法的 HTTP SOAP 请求。此外,还可以提供其他 SOAP 配置信息,如下所示:
是否允许即席查询请求
是否为结果集返回 XSD 架构
在其中执行所请求的方法的数据库上下文
端点的命名空间
如何处理结果中 XML 无效的字符
Transact-SQL 语法约定
CREATE ENDPOINT endPointName [ AUTHORIZATION login ]
STATE = { STARTED | STOPPED | DISABLED }
AS { HTTP | TCP } (
<protocol_specific_arguments>
)
FOR { SOAP | TSQL | SERVICE_BROKER | DATABASE_MIRRORING } (
<language_specific_arguments>
)
<AS HTTP_protocol_specific_arguments> ::=
AS HTTP (
PATH = "url"
, AUTHENTICATION =( { BASIC | DIGEST | INTEGRATED | NTLM | KERBEROS } [ ,...n ] )
, PORTS = ( { CLEAR | SSL} [ ,... n ] )
[ SITE = {"*" | "+" | "webSite" },]
[, CLEAR_PORT = clearPort ]
[, SSL_PORT = SSLPort ]
[, AUTH_REALM = { "realm" | NONE } ]
[, DEFAULT_LOGON_DOMAIN = { "domain" | NONE } ]
[, COMPRESSION = { ENABLED | DISABLED } ]
)
<AS TCP_protocol_specific_arguments> ::=AS TCP (
LISTENER_PORT = listenerPort
[ , LISTENER_IP = ALL | (<4-part-ip> | <ip_address_v6> ) ]
)
<FOR SOAP_language_specific_arguments> ::=
FOR SOAP(
[ { WEBMETHOD [ "namespace" .] "method_alias"
( NAME = "database.owner.name"
[ , SCHEMA = { NONE | STANDARD | DEFAULT } ]
[ , FORMAT = { ALL_RESULTS | ROWSETS_ONLY } ]
)
} [ ,...n ] ]
[ BATCHES = { ENABLED | DISABLED } ]
[ , WSDL = { NONE | DEFAULT | "sp_name" } ]
[ , SESSIONS = { ENABLED | DISABLED } ]
[ , LOGIN_TYPE = { MIXED | WINDOWS } ]
[ , SESSION_TIMEOUT = timeoutInterval | NEVER ]
[ , DATABASE = { "database_name" | DEFAULT }
[ , NAMESPACE = { "namespace" | DEFAULT } ]
[ , SCHEMA = { NONE | STANDARD } ]
[ , CHARACTER_SET = { SQL | XML }]
[ , HEADER_LIMIT = int ]
)
<FOR SERVICE_BROKER_language_specific_arguments> ::=
FOR SERVICE_BROKER (
[ AUTHENTICATION = {
WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ]
| CERTIFICATE certificate_name
| WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ] CERTIFICATE certificate_name
| CERTIFICATE certificate_name WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ]
} ]
[ , ENCRYPTION = { DISABLED | SUPPORTED | REQUIRED }
[ ALGORITHM { RC4 | AES | AES RC4 | RC4 AES } ]
]
[ , MESSAGE_FORWARDING = { ENABLED | DISABLED* } ]
[ , MESSAGE_FORWARD_SIZE = forward_size ]
)
<FOR DATABASE_MIRRORING_language_specific_arguments> ::=
FOR DATABASE_MIRRORING (
[ AUTHENTICATION = {
WINDOWS [ { NTLM | KERBEROS | NEGOTIATE } ]
| CERTIFICATE certificate_name
} ]
[ [ , ] ENCRYPTION = { DISABLED |SUPPORTED | REQUIRED }
[ ALGORITHM { RC4 | AES | AES RC4 | RC4 AES } ]
]
[,] ROLE = { WITNESS | PARTNER | ALL }
)
示例
CREATE ENDPOINT sql_endpoint
STATE = STARTED
AS HTTP(
PATH = "/sql",
AUTHENTICATION = (INTEGRATED ),
PORTS = ( CLEAR ),
SITE = "SERVER"
)
FOR SOAP (
WEBMETHOD "GetSqlInfo"
(name="master.dbo.xp_msver",
SCHEMA=STANDARD ),
WEBMETHOD "DayAsNumber"
(name="master.sys.fn_MSdayasnumber"),
WSDL = DEFAULT,
SCHEMA = STANDARD,
DATABASE = "master",
NAMESPACE = "http://tempUri.org/"
);
GO
- 奇石珠宝真君
-
关键看你的中文表格是什么格式的。补充一下问题吧