1. TapesAndJobs Vie
-----------------------------------------------------------------------------------------------------
USE [NICISTapeTrackerSQL]
GO
/****** Object: View [dbo].[TapesAndJobs] Script Date: 09/16/2009
10:35:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[TapesAndJobs]
AS
SELECT dbo.TapeJobs.No, dbo.TapeJobs.JobNo, dbo.TapeJobs.TapeNo,
dbo.Jobs.No AS Expr1, dbo.Tapes.No AS Expr2, dbo.Tapes.Status,
dbo.Tapes.Pool,
dbo.Tapes.Location, dbo.Jobs.Date,
dbo.Jobs.Successful, dbo.Jobs.RetentionRule,
dbo.RetentionRules.RetentionPeriod,
dbo.RetentionRules.RetentionCycles
FROM dbo.TapeJobs LEFT OUTER JOIN
dbo.Tapes ON dbo.TapeJobs.TapeNo = dbo.Tapes.No LEFT
OUTER JOIN
dbo.RetentionRules INNER JOIN
dbo.Jobs ON dbo.RetentionRules.No =
dbo.Jobs.RetentionRule ON dbo.TapeJobs.JobNo = dbo.Jobs.N
-----------------------------------------------------------------------------------------------------
2.1 Jobs Tabl
-----------------------------------------------------------------------------------------------------
<- I've had to remove this because it's too big and I get the following
USENET error: Your post is too long. Please reduce the amount of text. (Limit
= 30000, Current = 96763) ->
-----------------------------------------------------------------------------------------------------
2.2 Tapes Tabl
-----------------------------------------------------------------------------------------------------
<- I've had to remove this because it's too big and I get the following
USENET error: Your post is too long. Please reduce the amount of text. (Limit
= 30000, Current = 96763) ->
-----------------------------------------------------------------------------------------------------
2.3 TapeJobs Tabl
-----------------------------------------------------------------------------------------------------
USE [NICISTapeTrackerSQL]
GO
/****** Object: Table [dbo].[TapeJobs] Script Date: 09/16/2009 10:46:25
******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TapeJobs](
[No] [int] IDENTITY(1,1) NOT NULL,
[JobNo] [int] NOT NULL,
[TapeNo] [int] NOT NULL,
CONSTRAINT [PK_TapeJobs] PRIMARY KEY CLUSTERED
(
[No] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY =
OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_AggregateType', @value=-1 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnHidden', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnOrder', @value=1 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnWidth', @value=765 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DisplayControl', @value=N'109' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Format', @value=N'' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_IMEMode', @value=N'0' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_TextAlign', @value=0x00 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'No'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_AggregateType', @value=-1 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_AllowValueListEdits',
@value=False , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnCount', @value=N'4' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnHeads', @value=N'-1' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnHidden', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnOrder', @value=0 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnWidth', @value=1080 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnWidths',
@value=N'1701.000;1701.000;1701.000;1701.000' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DisplayControl', @value=N'111' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Format', @value=N'' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_IMEMode', @value=N'0' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_LimitToList', @value=N'-1' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ListItemsEditForm', @value=NULL ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ListRows', @value=N'20' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_RowSource', @value=N'dbo.Jobs' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ShowOnlyRowSourceValues',
@value=False , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_TextAlign', @value=0x00 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'JobNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_AggregateType', @value=-1 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_AllowValueListEdits',
@value=False , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnCount', @value=N'4' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnHeads', @value=N'-1' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnHidden', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnOrder', @value=0 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnWidth', @value=1140 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ColumnWidths',
@value=N'1701.000;1701.000;1701.000;1701.000' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DisplayControl', @value=N'111' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Format', @value=N'' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_IMEMode', @value=N'0' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_LimitToList', @value=N'-1' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ListItemsEditForm', @value=NULL ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ListRows', @value=N'20' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_RowSource', @value=N'dbo.Tapes' ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_ShowOnlyRowSourceValues',
@value=False , @level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_TextAlign', @value=0x00 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs',
@level2type=N'COLUMN',@level2name=N'TapeNo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DefaultView', @value=0x02 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Filter', @value=NULL ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_FilterOnLoad', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_HideNewField', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_OrderBy', @value=NULL ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_OrderByOn', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_OrderByOnLoad', @value=True ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Orientation', @value=0x00 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_TableMaxRecords', @value=10000 ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_TotalsRow', @value=False ,
@level0type=N'SCHEMA',@level0name=N'dbo',
@level1type=N'TABLE',@level1name=N'TapeJobs'
GO
ALTER TABLE [dbo].[TapeJobs] WITH CHECK ADD CONSTRAINT [FK_TapeJobs_Jobs]
FOREIGN KEY([JobNo])
REFERENCES [dbo].[Jobs] ([No])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TapeJobs] CHECK CONSTRAINT [FK_TapeJobs_Jobs]
GO
ALTER TABLE [dbo].[TapeJobs] WITH NOCHECK ADD CONSTRAINT
[FK_TapeJobs_Tapes] FOREIGN KEY([TapeNo])
REFERENCES [dbo].[Tapes] ([No])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TapeJobs] CHECK CONSTRAINT [FK_TapeJobs_Tapes]
-----------------------------------------------------------------------------------------------------
2.4 RetentionRules Table
-----------------------------------------------------------------------------------------------------
<- I've had to remove this because it's too big and I get the following
USENET error: Your post is too long. Please reduce the amount of text. (Limit
= 30000, Current = 96763) ->
-----------------------------------------------------------------------------------------------------
3. Trace Results - Filtered by all TSQL statements only
-----------------------------------------------------------------------------------------------------
I've never run this tool before and am not particularly sure whether this
satisfies your request, but here goes:
<- I've had to remove the trace results from here because they are too big
and I get the following USENET error: Your post is too long. Please reduce
the amount of text. (Limit = 30000, Current = 96763) ->
SET NO_BROWSETABLE OFF
go
EXEC sp_fkeys NULL, NULL, NULL, 'RetentionRules', 'dbo', 'NICISTapeTrackerSQL'
go
EXEC sp_fkeys NULL, NULL, NULL, 'Tapes', 'dbo', 'NICISTapeTrackerSQL'
go
EXEC sp_fkeys NULL, NULL, NULL, 'Jobs', 'dbo', 'NICISTapeTrackerSQL'
go
EXEC sp_fkeys NULL, NULL, NULL, 'TapeJobs', 'dbo', 'NICISTapeTrackerSQL'
go
SET ROWCOUNT 10000 SET NO_BROWSETABLE ON
go
SET ROWCOUNT 0 SET NO_BROWSETABLE OFF
go
EXEC sp_MShelpcolumns N'dbo.TapeJobs' , NULL, 'id', 1
go
EXEC sp_MShelpcolumns N'dbo.Jobs' , NULL, 'id', 1
go
EXEC sp_MShelpcolumns N'dbo.Tapes' , NULL, 'id', 1
go
EXEC sp_MShelpcolumns N'dbo.RetentionRules' , NULL, 'id', 1
go
SELECT (3)
go
SELECT (7)
go
SELECT (1)
go
SELECT (getdate())
go
SELECT * FROM "dbo"."Tapes"
go
SET NO_BROWSETABLE ON
go
SELECT *, sql_variant_property(value, 'basetype') AS type FROM
::fn_listextendedproperty(NULL,N'user',N'dbo',N'table',N'Tapes',N'column',NULL) ORDER BY PATINDEX(N'MS_DisplayControl', name) DESC
go
SELECT (getdate()) AS Column1, (3) AS Column2, (7) AS Column3, (1) AS
Column4
go
SET ROWCOUNT 10000
go
SET FMTONLY ON select "No" from "NICISTapeTrackerSQL"."dbo"."Tapes" WHERE
1=2 SET FMTONLY OFF
go
SET ROWCOUNT 0 SET NO_BROWSETABLE OFF
go
SET FMTONLY ON select "No","JobNo","TapeNo" from
"NICISTapeTrackerSQL"."dbo"."TapeJobs" WHERE 1=2 SET FMTONLY OFF
go
SET NO_BROWSETABLE ON
go
Please keep in mind that I am not a DBA and neither I nor my organisation
have access to one. I apologise therefore for the poor presentation here,
but I'm doing the best I can. I really appreciate your help on this and look
forward to hearing back from you. If you need to use e-mail for larger
quantities of information, such as the full trace, e-mail me at
paul.anderson@
[email protected] (take the NOSP@M bit out).