|
 |
|
เก็น Running No. ไว้ใน Table กลางแต่ไม่ทราบวิธีการเขียนยังไงค่ะในการเก็บข้อมูล |
|
 |
|
|
 |
 |
|
แนะนำเก็บแยกครับ
อยากรวมค่อยเอามา union
|
 |
 |
 |
 |
Date :
2013-10-21 16:11:19 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
การรีเควสจ็อบไอดี เก็บไว้ในตารางๆเดียวถูกต้องแล้วครับ
ถ้าแยกตารางจะต้องมีการสร้างตารางใหม่อยู่เรื่อย การเขียนโค้ดก็ต้องแก้ไข เพิ่มเติม อยู่ตลอด
SQL Server
CREATE TABLE Job_detail
(
job_id int IDENTITY(1,1) PRIMARY KEY,
job_number varchar(20) NOT NULL,
job_code varchar(10),
mod_code varchar(10)
)
หรือถ้ามีตารางนี้อยู่ก่อนแล้ว แต่ต้องการเซ็ตให้ job_id เป็นคอลัมน์ที่เพิ่มค่าอัตโนมัติก็ใช้คำสั่งนี้ครับ
Code (SQL)
ALTER TABLE Job_detail DROP COLUMN job_id
ALTER TABLE Job_detail ADD job_id INT IDENTITY(1,1)
|
 |
 |
 |
 |
Date :
2013-10-21 16:45:14 |
By :
sakuraei |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ้ายยย
มันเป็น job เหรอ ลืมดู
ถ้างานลักษณะนั้นก็เก็บรวมนะถูกแล้ว
|
 |
 |
 |
 |
Date :
2013-10-21 16:49:10 |
By :
ห้ามตอบเกินวันละ 2 กระทู้ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ
ต้องลอง
|
 |
 |
 |
 |
Date :
2013-10-21 17:31:36 |
By :
paphun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำได้แล้วค่ะ

|
 |
 |
 |
 |
Date :
2013-10-24 16:22:55 |
By :
paphun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ดีใจด้วยครับ 
|
 |
 |
 |
 |
Date :
2013-10-24 16:29:10 |
By :
sakuraei |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|