-4
我在我的數據庫中有4個表。我想編寫一個返回表名的單個查詢,不。的行,表大小,日期表被創建和修改,誰創建的表是由。加入SQL服務器查詢
我的數據庫:
CREATE TABLE Branch(
Br_ID int IDENTITY(1,1) PRIMARY KEY,
Name varchar(255),
Desp varchar(255)
);
CREATE TABLE Region(
R_ID int IDENTITY(1,1) PRIMARY KEY,
Name varchar(255),
Desp varchar(255)
);
CREATE TABLE Customer(
Cust_ID int IDENTITY(1,1) PRIMARY KEY,
Name varchar(255),
Desp varchar(255)
);
CREATE TABLE Customer_Branch(
Br_ID int FOREIGN KEY REFERENCES Branch(Br_ID) not null,
Cust_ID int FOREIGN KEY REFERENCES Customer(Cust_ID) not null,
PRIMARY KEY (Br_ID, Cust_ID)
);
INSERT INTO Branch (Name, Desp)
VALUES ('xyz', 'headoffice');
你有什麼已經嘗試過? –
首先查看'[master] .sys.tables'表 – dbajtr