

--
--    Licensed Materials - Property of IBM
--    
--    BI and PM: JSM
--    
--    (c) Copyright IBM Corp. 2003, 2010.
--    
--    US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
--    


-------------------------------------------------------------------------------
-- NC300_UPDATE_SYBASE.SQL	       *DO NOT EDIT*		Data Store Version: 301		 
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$100-- backup create begin
-------------------------------------------------------------------------------

CREATE TABLE BC_NC_JMSQUEUE ( 
	QUEUE_ENTRY_ID               	INTEGER NOT NULL,
	QUEUE_NAME                   	NVARCHAR(50) NULL,
	SDS_INSTANCE_ID		     	CHAR (32) NULL,
	DATE_ENTERED			NUMERIC NOT NULL
)
go

-------------------------------------------------------------------------------
--$110-- backup inserts begin
-------------------------------------------------------------------------------
INSERT INTO BC_NC_JMSQUEUE (QUEUE_ENTRY_ID, QUEUE_NAME, SDS_INSTANCE_ID, DATE_ENTERED) SELECT QUEUE_ENTRY_ID, QUEUE_NAME, SDS_INSTANCE_ID, DATE_ENTERED FROM NC_JMSQUEUE
go

-------------------------------------------------------------------------------
--$130-- views drop begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$140-- tables drop begin
-------------------------------------------------------------------------------

DROP TABLE NC_JMSQUEUE
go
-------------------------------------------------------------------------------
--$200-- recreate tables begin
-------------------------------------------------------------------------------
CREATE TABLE NC_JMSQUEUE (
	QUEUE_ENTRY_ID               	INTEGER NOT NULL,
	QUEUE_NAME                	NVARCHAR(50) NULL,
	QUEUE_ENTRY             	IMAGE NULL,
	SDS_INSTANCE_ID			CHAR (32) NULL,
	DATE_ENTERED 		   	NUMERIC NOT NULL
) 
go

-------------------------------------------------------------------------------
--$202-- primary keys add begin
-------------------------------------------------------------------------------

DROP INDEX NC_JOBQUEUE.IN_JOBQUEUE_SELECTOR
go 

CREATE INDEX IN_JOBQ_SELECTOR ON NC_JOBQUEUE (SERVICE_NAME, SERVER_GROUP, DATE_ENTERED)
go

CREATE INDEX IX_NC_JMSQUEUE ON NC_JMSQUEUE(QUEUE_NAME, DATE_ENTERED, SDS_INSTANCE_ID) 
go

CREATE INDEX IX_NC_JMSQUEUE1 ON NC_JMSQUEUE(QUEUE_NAME, SDS_INSTANCE_ID) 
go

ALTER TABLE NC_JMSQUEUE ADD CONSTRAINT PN_NC_JMSQUEUE PRIMARY KEY (QUEUE_ENTRY_ID)
go

-------------------------------------------------------------------------------
--$210-- views create begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$220-- server data inserts begin
-------------------------------------------------------------------------------

INSERT INTO NC_DB_VERSION (DB_VERSION_ID,BUILD) VALUES(301,'build no.')
go


 -------------------------------------------------------------------------------
 --$230-- restore inserts begin
 -------------------------------------------------------------------------------

 -------------------------------------------------------------------------------
 --$250-- backup drop begin
 -------------------------------------------------------------------------------
DROP TABLE BC_NC_JMSQUEUE
go

-------------------------------------------------------------------------------
--$260-- end sql by function
-------------------------------------------------------------------------------
--	END NC301_UPDATE_SYBASE.SQL			*	DO NOT EDIT	 * 		 
-------------------------------------------------------------------------------
