0% found this document useful (0 votes)
4 views2 pages

SQL Table Location Update Script

The document outlines SQL commands for managing a table location database. It includes instructions to view the current table locations, update their priority, and insert new tables (T01-T10 and D01-D10) with specific attributes. Finally, it provides a command to view the updated table locations sorted by priority.

Uploaded by

muhamad jazuli
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

SQL Table Location Update Script

The document outlines SQL commands for managing a table location database. It includes instructions to view the current table locations, update their priority, and insert new tables (T01-T10 and D01-D10) with specific attributes. Finally, it provides a command to view the updated table locations sorted by priority.

Uploaded by

muhamad jazuli
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

--view before

select * from tablelocation

--move existing tables to the bottom of the list


--update tablelocation set priority = priority+20

--insert T01-T10 and D01-D10


/*
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T01', 0, 0, 1, 0, 1, 1, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T02', 0, 0, 1, 0, 1, 2, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T03', 0, 0, 1, 0, 1, 3, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T04', 0, 0, 1, 0, 1, 4, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T05', 0, 0, 1, 0, 1, 5, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T06', 0, 0, 1, 0, 1, 6, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T07', 0, 0, 1, 0, 1, 7, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T08', 0, 0, 1, 0, 1, 8, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T09', 0, 0, 1, 0, 1, 9, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('T10', 0, 0, 1, 0, 1, 10, 'ExpressTable', getdate(), 'SYSTEM', 0)

insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,


priority, userfld1, modifiedon, modifiedby, deleted)
values('D01', 0, 0, 1, 0, 1, 11, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D02', 0, 0, 1, 0, 1, 12, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D03', 0, 0, 1, 0, 1, 13, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D04', 0, 0, 1, 0, 1, 14, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D05', 0, 0, 1, 0, 1, 15, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D06', 0, 0, 1, 0, 1, 16, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D07', 0, 0, 1, 0, 1, 17, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D08', 0, 0, 1, 0, 1, 18, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D09', 0, 0, 1, 0, 1, 19, 'ExpressTable', getdate(), 'SYSTEM', 0)
insert into tablelocation(tablenumber, x, y, areaid, istakeaway, tabletypeid,
priority, userfld1, modifiedon, modifiedby, deleted)
values('D10', 0, 0, 1, 0, 1, 20, 'ExpressTable', getdate(), 'SYSTEM', 0)
*/

--view after
select * from tablelocation order by priority

You might also like