You are on page 1of 8

SELECT * FROM AMT_EXTTEXT WHERE [TAG NUMBER] NOT LIKE'%[0-9]%' AND [TAG NUMBER] NOT

LIKE'%[A-Z]%' AND PATH='A:\202_BAB_NON TEFF_COMMENTS\8\16V-101\SECTION-6 MISC.


WIRING DIAGRAM\452B01DW00004 R2 SHT005.IGR'

SELECT * FROM AMT_EXTTEXT WHERE [TAG NUMBER] LIKE'%[A-Z0-9]%' AND


PATH='A:\202_BAB_NON TEFF_COMMENTS\8\16V-101\SECTION-6 MISC. WIRING
DIAGRAM\452B01DW00004 R2 SHT005.IGR'

SELECT * FROM AMT_EXTTEXT A WHERE NOT EXISTS(SELECT * FROM AMT_EXTTEXT B WHERE B.


[TAG NUMBER] NOT LIKE'%[0-9]%' AND B.Path='A:\202_BAB_NON TEFF_COMMENTS\8\16V-
101\SECTION-6 MISC. WIRING DIAGRAM\452B01DW00004 R2 SHT005.IGR')

SELECT * FROM AMT_EXTTEXT WHERE [TAG NUMBER] LIKE'%[^0-9A-Z]%' AND [TAG NUMBER] NOT
LIKE'%[A-Z]%' AND [TAG NUMBER] NOT LIKE'%[0-9]%' AND PATH='A:\202_BAB_NON
TEFF_COMMENTS\8\16V-101\SECTION-6 MISC. WIRING DIAGRAM\452B01DW00004 R2 SHT005.IGR'

SELECT * FROM AMT_EXTTEXT WHERE PATH='A:\202_BAB_NON TEFF_COMMENTS\8\16V-


101\SECTION-6 MISC. WIRING DIAGRAM\452B01DW00004 R2 SHT005.IGR'

SELECT * FROM AMT_EXTTEXT WHERE [TAG NUMBER] LIKE'%[^0-9A-Z]%' AND


PATH='A:\202_BAB_NON TEFF_COMMENTS\8\16V-101\SECTION-6 MISC. WIRING
DIAGRAM\452B01DW00004 R2 SHT005.IGR'

SELECT * FROM AMT_EXTTEXT WHERE [TAG NUMBER] LIKE'%[0-9A-Z]%' AND


PATH='A:\202_BAB_NON TEFF_COMMENTS\8\16V-101\SECTION-6 MISC. WIRING
DIAGRAM\452B01DW00004 R2 SHT005.IGR'

SELECT * FROM AMT_EXTTEXT where [Path]='A:\01_1100\BAB Extraction plant


(Engineering design books)\VOL 1-1.3 - PROMPT MATERIAL STATUS REPORT AND EQUIPMENT
LIST.pdf' and SystemRemarks='127'

---DELETE FROM AMT_EXTTEXT WHERE [TAG NUMBER] NOT LIKE'%[0-9]%'

SELECT * from AMT_EXTTEXT where [Tag number] like '%req.%' OR [Tag number] like
'%requisition%' OR [Tag number] like '%purchase%' OR [Tag number] like '%P.O%' --
[Tag number] like '%PO%' OR [Tag number] like '%P.O.%' OR

SELECT * from AMT_EXTTEXT where [Path]='A:\201_Multiple Projects\08) PIPING


DRAWINGS\08) NGL LINE REPACEMENT PROJ\900-A1-5-103.PDF' AND ([Tag number] like
'%req.%' OR [Tag number] like '%requisition%' OR [Tag number] like '%purchase%' OR
[Tag number] like '%P.O%')

select [Document Number] from TE510_Document_Index group by [Document Number]

select A.[Document Number],B.[Tag Number ] from TE510_Document_Index A JOIN


TE510_Tag_Index B ON B.[Document Number]=A.[Document Number] group by A.[Document
Number],B.[Tag Number ]

SELECT COUNT(*) FROM TE510_Tag_Index

SELECT COUNT([Document Number]) FROM TE510_Tag_Index GROUP BY [Document Number]

select count(*) from TMP_EXTTEXT

INSERT INTO [AMT_EXTTEXT] SELECT * FROM [TMP_EXTTEXT] B WHERE NOT EXISTS ( SELECT *
FROM [AMT_EXTTEXT] A WHERE A.[PATH] = B.[PATH] AND A.[TAG NUMBER] = B.[TAG
NUMBER])

select * from AMT_EXTTEXT WHERE [TAG NUMBER] NOT LIKE'%[0-9]%' AND [Tag number]
NOT like '%req.%'
AND [Tag number] NOT like '%requisition%' AND [Tag number] NOT like '%purchase%'
AND [Tag number] NOT like '%P.O%' AND [Tag number] NOT like 'PO%' AND [Tag number]
NOT like 'P/O%'

select [Indexed By], SUBSTRING([Index Date],1,10) AS [DATE],count(*) from


TE510_Tag_Index group by [Indexed By],SUBSTRING([Index Date],1,10) order by
[Indexed By]

select [Indexed By], SUBSTRING([Index Date],1,10) AS [DATE],count(*) from


TE510_Document_Index group by [Indexed By],SUBSTRING([Index Date],1,10) order by
[Indexed By]

select SUBSTRING([Date],1,10) as IDATE,count(*) as Cnt from HTY_ImportHistory WHERE


[Filename] like 'INSERT INTO %' group by SUBSTRING([Date],1,10)

select convert(varchar,SUBSTRING([Index Date],1,10),100) AS [DATE],count(*) from


TE510_Document_Index group by SUBSTRING([Index Date],1,10) order by [DATE]

SELECT CONVERT(VARCHAR,SUBSTRING([INDEX DATE],1,10),100) AS [DATE],COUNT(*) as Cnt


FROM TE510_DOCUMENT_INDEX GROUP BY SUBSTRING([INDEX DATE],1,10) ORDER BY [DATE]

select [Indexed By],cast([Index Date] as date) from TE510_Document_Index where


len([Index Date])<10 and [Index Date]<>''
--group by [Indexed By],cast([Index Date] as date)
---group by [Indexed By],convert(date,[Index Date],3)

select revision, [Revision Description/Status] from TE510_Document_Index group by


revision, [Revision Description/Status] order by Revision

select [Index Date] from TE510_Document_Index group by [Index Date]

select convert(varchar,[Index Date],21) FRom TE510_Document_Index where len([Index


Date])>10 group by [Index Date]

select [User],count(*) as Cnt from HTY_ImportHistory where [Filename] like 'INSERT


INTO %' group by [User]

select [User],CHARINDEX('Document Number',[Filename],1),


REPLACE(SUBSTRING([Filename],CHARINDEX('Number',[Filename],1)+8,255),'''','') from
HTY_ImportHistory where [User]='sb' and [Filename] like '%TE510_Document_Index%'

select REPLACE(SUBSTRING([Filename],CHARINDEX('Document Number',


[Filename],1)+8,255),'''','') As DocumentNumber,[User],[Date] from
HTY_ImportHistory
where [Filename] like '%TE510_Document_Index%' and [Filename] not like '%category%'
and [Filename] not like '%Document Type%' and [Filename] not like '%Sub-Type%' and
[user]='sb'
group by REPLACE(SUBSTRING([Filename],CHARINDEX('Document Number',
[Filename],1)+8,255),'''',''),[User],[Date] order by [date]

SELECT A.[User],SUM(A.Cnt) FROM (


select [User],count(*) As cnt from HTY_ImportHistory
where [Filename] like '%TE510_Document_Index%' and [Filename] not like '%category%'
and [Filename] not like '%Document Type%' and [Filename] not like '%Sub-Type%'
group by REPLACE(SUBSTRING([Filename],CHARINDEX('Document Number',
[Filename],1)+17,255),'''',''),[User]) A GROUP by A.[User] ORDER by A.[User]

select B.[Document Number],B.[Unit],B.[Indexed By],B.[Index Date] from


TE510_Tag_Index A right JOIN (select [Document Number],[filename],[Unit],[Indexed
By],[Index Date] from TE510_Document_Index
where [Filename] like '%.dwg' group by [Document Number],[filename],[Unit],[Indexed
By],[Index Date]) B ON a.[Document Number]=B.[Document Number]
where a.[Document Number] is null group by B.[Document Number],B.[Unit],B.[Indexed
By],B.[Index Date]

select B.[Document Number],B.[Unit],B.[Indexed By],B.[Index Date] from


TE510_Tag_Index A right JOIN (select [Document Number],[Unit],[Indexed By],[Index
Date] from TE510_Document_Index
where [Filename] like '%.dwg' and [Tag] not like 'N/A' group by [Document Number],
[filename],[Unit],[Indexed By],[Index Date]) B ON a.[Document Number]=B.[Document
Number]
where a.[Document Number] is null group by B.[Document Number],B.[Unit],B.[Indexed
By],B.[Index Date]

select B.[Document Number],B.[Unit],B.[Indexed By] from TE510_Tag_Index A right


JOIN (select [Document Number],[Unit],[Indexed By],[Index Date] from
TE510_Document_Index
where [Filename] like '%.pdf' and [Tag] not like 'N/A' group by [Document Number],
[filename],[Unit],[Indexed By],[Index Date]) B ON a.[Document Number]=B.[Document
Number]
where a.[Document Number] is null group by B.[Document Number],B.[Unit],B.[Indexed
By],B.[Index Date]

select A.[Document Number],A.Filename,B.Unit from TE510_Tag_Index A join


TE510_Document_Index B ON A.[Document Number] =B.[Document Number] AND A.Filename =
B.Filename
where (A.unit is null or A.unit='') AND B.Unit IS NOT NULL GROUP BY A.[Document
Number],B.Unit,A.Filename

select [Source Folder],[filename],[Tag Number ], Unit from TE510_Tag_Index


where SUBSTRING([Tag Number ],1,1) in ('1','2','3','4','5','6','7','8','9','0') and
(Unit is null or Unit='') and Remarks not like 'Del%'
and LEN([Tag Number ]) > 5

SELECT B.Path FROM AMT_EXTTEXT A RIGHT JOIN (Select REPLACE([file full


path],'.dwg','.igr') AS [PATH] from TE510_Document_Index where [Filename] like
'%.dwg') B
ON A.Path = B.PATH WHERE A.Path IS NULL GROUP BY B.Path

SELECT A.[Document Number] FROM TE510_Document_Index A LEFT JOIN TE510_Tag_Index B


ON A.[Document Number]=B.[Document Number] WHERE A.Tag LIKE 'REFER%' AND B.
[Document Number] IS NULL
GROUP BY A.[Document Number]

select a.[Document Number], COUNT(*) from


(select [Document Number], Unit from [TE510_Document_Index] where unit is not null
or unit<>'' Group by [Document Number], Unit ) A group by a.[Document Number]
having COUNT(*) > 1

SELECT A.* FROM TE510_Document_Index A JOIN


(SELECT D.[Document Number] FROM TE510_Document_Index D JOIN TE510_Document_Index E
ON D.[Document Number]=E.[Document Number] WHERE D.[File Format]='CAD' AND D.
[Document Number] IS NOT NULL
AND E.[File Format] ='PDF' AND E.[Document Number] IS NOT NULL GROUP BY D.
[Document Number]) C
ON A.[Document Number]=C.[Document Number] ORDER BY A.[Document Number],A.Revision
DESC

INSERT INTO DLT_Tag_Index


SELECT * FROM TE510_Tag_Index WHERE Remarks LIKE 'DEL%'

DELETE FROM TE510_Tag_Index WHERE Remarks LIKE 'DEL%'

SELECT B.[Source Folder],B.Filename,B.[File Full Path] FROM TE510_Document_Index A


RIGHT JOIN ADM_FILELIST B ON A.[File Full Path] = B.[File Full Path]
WHERE A.[File Full Path] IS NULL AND (B.[File Extension]='PDF' OR B.[File
Extension]='DWG')

SELECT B.[Source Folder],B.Filename,B.[File Full Path] FROM


(SELECT [SOURCE FOLDER],[FILENAME],[Document Number],[File Full Path] FROM
ADNOC_BAB.DBO.TE510_DOCUMENT_INDEX
UNION ALL
SELECT [SOURCE FOLDER],[FILENAME],[Document Number],[File Full Path] FROM
ADNOC_BAB_OTHER.DBO.TE510_DOCUMENT_INDEX) A RIGHT JOIN ADM_FILELIST B ON A.[File
Full Path] = B.[File Full Path]
WHERE A.[File Full Path] IS NULL AND (B.[File Extension]='PDF' OR B.[File
Extension]='DWG') order by b.[Source Folder]

SELECT [SOURCE FOLDER],[FILENAME],[Document Number],[File Full Path] FROM


ADNOC_BAB.DBO.TE510_DOCUMENT_INDEX
UNION ALL
SELECT [SOURCE FOLDER],[FILENAME],[Document Number],[File Full Path] FROM
ADNOC_BAB_OTHER.DBO.TE510_DOCUMENT_INDEX

SELECT A.HASH,A.Filename,A.[File Full Path] from ADM_FILELIST A JOIN (SELECT


[HASH] FROM ADM_FILELIST group by [HASH] having (HASH <>'') and count(*)>1) B ON
A.HASH=B.HASH
ORDER BY A.HASH

select A.[File Full Path],A.Filename,A.[Document Number] from TE510_Document_Index


A JOIN
(SELECT A.HASH,A.Filename,A.[File Full Path] from ADM_FILELIST A JOIN (SELECT
[HASH] FROM ADM_FILELIST group by [HASH] having [HASH] is not null and count(*)>1)
B ON A.HASH=B.HASH
) B ON A.[File Full Path]=B.[File Full Path] AND A.Filename = B.Filename
WHERE B.[File Full Path] LIKE 'A:\202_bab_non teff_Comments\%' AND (B.HASH <>'' OR
B.HASH IS NOT NULL) order by A.[Document Number]
Update TMP_Tag_Index SET [Document Number] = replace(replace(replace([Document
Number],Char(13),''),Char(10),''),Char(9),'')
WHERE [Document Number] is Not Null

Update TE510_Document_Index SET [Document Number] =


RTRIM(LTRIM(replace(replace(replace([Document
Number],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Document Number] is Not Null

Update TE510_Document_Index SET [Purchase Order No#] =


RTRIM(LTRIM(replace(replace(replace([Purchase Order
No#],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Purchase Order No#] is Not Null

Update TE510_Document_Index SET [Vendor Name] =


RTRIM(LTRIM(replace(replace(replace([Vendor
Name],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Vendor Name] is Not Null

Update TE510_Tag_Index SET [Document Number] =


RTRIM(LTRIM(replace(replace(replace([Document
Number],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Document Number] is Not Null

Update TE510_Tag_Index SET [Tag Number ] = RTRIM(LTRIM(replace(replace(replace([Tag


Number ],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Tag Number ] is Not Null

Update TE510_Tag_Index SET [Purchase Order No#] =


RTRIM(LTRIM(replace(replace(replace([Purchase Order
No#],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Purchase Order No#] is Not Null

Update TE510_Tag_Index SET [Tag Vendor/OEM Name] =


RTRIM(LTRIM(replace(replace(replace([Tag Vendor/OEM
Name],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Tag Vendor/OEM Name] is Not Null

Update TE510_Tag_Index SET [OEM Name] = RTRIM(LTRIM(replace(replace(replace([OEM


Name],Char(13),''),Char(10),''),Char(9),'')))
WHERE [OEM Name] is Not Null

Update TE510_PurchaseOrder_Index SET [Purchase Order No] =


RTRIM(LTRIM(replace(replace(replace([Purchase Order No]
,Char(13),''),Char(10),''),Char(9),'')))
WHERE [Purchase Order No] is Not Null

Update TE510_Vendor_Index SET [Vendor/Supplier Name] =


RTRIM(LTRIM(replace(replace(replace([Vendor/Supplier Name]
,Char(13),''),Char(10),''),Char(9),'')))
WHERE [Vendor/Supplier Name] is Not Null

Update TE510_Manufacturer_Index SET [Manufacturer/OEM Name] =


RTRIM(LTRIM(replace(replace(replace([Manufacturer/OEM
Name],Char(13),''),Char(10),''),Char(9),'')))
WHERE [Manufacturer/OEM Name] is Not Null

UPDATE ADM_FILELIST SET [IGNORE]=1 WHERE [FILE EXTENSION]<>'BIN' AND [FILE


EXTENSION]<>'BMP' AND [FILE EXTENSION]<>'CSV' AND [FILE EXTENSION]<>'DGN' AND [FILE
EXTENSION]<>'DOC'
AND [FILE EXTENSION]<>'DOCX' AND [FILE EXTENSION]<>'DWG' AND [FILE
EXTENSION]<>'EXE' AND [FILE EXTENSION]<>'JPG' AND [FILE EXTENSION]<>'PDF'
AND [FILE EXTENSION]<>'TIF' AND [FILE EXTENSION]<>'TIFF' AND [FILE
EXTENSION]<>'XLSX' AND [FILE EXTENSION]<>'XLS'

UPDATE ADM_FILELIST SET IGNORE=0 WHERE IGNORE IS NULL

SELECT MAIN_FOLDER,COUNT(*) FROM ADM_FILELIST WHERE IGNORE = 0 GROUP BY MAIN_FOLDER

SELECT HASH,COUNT(*) FROM ADM_FILELIST GROUP BY HASH HAVING HASH IS NOT NULL AND
COUNT(*)>1

SELECT * FROM ADM_FILELIST WHERE HASH IS NULL AND IGNORE = 0 order by Filename

select [Source Folder],[filename],[Tag Number ], Unit from TE510_Tag_Index


where SUBSTRING([Tag Number ],1,1) not in ('1','2','3','4','5','6','7','8','9','0')
and (Unit is null or Unit='') and Remarks not like 'Del%'
and LEN([Tag Number ]) > 5

select A.[Tag Number ],A.Unit from TE510_Tag_Index A JOIN (


select [Tag Number ] from TE510_Tag_Index
where SUBSTRING([Tag Number ],1,1) not in ('1','2','3','4','5','6','7','8','9','0')
and (Unit is null or Unit='') and Remarks not like 'Del%'
and LEN([Tag Number ]) > 5 GROUP BY [Tag Number ]) B ON A.[Tag Number ]=B.[Tag
Number ] WHERE A.unit <>''

UPDATE A SET [WITH ISSUES?]=B.CNT FROM TE510_DOCUMENT_INDEX A JOIN


(SELECT [DOCUMENT NUMBER] ,COUNT(*) AS CNT FROM TE510_DOCUMENT_INDEX GROUP BY
[DOCUMENT NUMBER] HAVING COUNT(*)=1) B ON A.[DOCUMENT NUMBER]=B.[DOCUMENT NUMBER]

select A.[Tag Number ],A.Unit from TE510_Tag_Index A JOIN (


select [Tag Number ] from TE510_Tag_Index
where SUBSTRING([Tag Number ],1,1) not in ('1','2','3','4','5','6','7','8','9','0')
and (Unit is null or Unit='') and Remarks not like 'Del%'
and LEN([Tag Number ]) > 5 GROUP BY [Tag Number ]) B ON A.[Tag Number ]=B.[Tag
Number ] WHERE A.unit <>'' group by A.[Tag Number ],A.Unit

update TE510_Document_Index SET Discipline='Civil & Structural' WHERE DISCIPLINE


='Civil'

SELECT C.SNO,C.HASH FROM ADM_FILELIST C JOIN (


select MIN(A.SNO) AS ROWNO, a.HASH from ADM_FILELIST A JOIN
(select HASH,COUNT(*) AS CNT from ADM_FILELIST group by hash having COUNT(*) >1 and
hash is not null and hash <>'') B ON A.HASH = B.HASH GROUP BY A.HASH ) D ON
C.HASH=D.HASH AND C.SNO<>D.ROWNO
SELECT session_id, num_writes, st.text AS statement_text
FROM sys.dm_exec_connections AS ec
CROSS APPLY sys.dm_exec_sql_text(ec.most_recent_sql_handle) AS st
ORDER BY num_writes DESC

USE master
EXEC sp_monitor

select Main_Folder,COUNT(*) from ADM_FILELIST where ignore=0 and duplicate=0


group by Main_Folder
SELECT [USER],COUNT(*) FROM ADM_FILELIST GROUP BY [USER]

select Main_Folder,[User],COUNT(*) as Indexed from ADM_FILELIST where Indexed=1


group by Main_Folder,[User] order by Main_Folder,[User]
select Main_Folder,[User],COUNT(*) as Assigned from ADM_FILELIST where ignore=0
and duplicate=0 and [user] is not null group by Main_Folder,[User] order by
Main_Folder,[User]

UPDATE E SET E.DUPLICATE=1 FROM ADM_FILELIST E JOIN (


SELECT C.SNO,C.HASH FROM ADM_FILELIST C JOIN (
select MIN(A.SNO) AS ROWNO, a.HASH from ADM_FILELIST A JOIN
(select HASH,COUNT(*) AS CNT from ADM_FILELIST group by hash having COUNT(*) >1 and
hash is not null and hash <>'') B ON
A.HASH = B.HASH GROUP BY A.HASH ) D ON C.HASH=D.HASH AND C.SNO<>D.ROWNO ) F ON
F.SNo=E.SNo WHERE E.Duplicate=0

SELECT [TAG NUMBER], STUFF((SELECT ',' + [Document Number] FROM TE510_TAG_INDEX EE


WHERE EE.[TAG NUMBER]=E.[TAG NUMBER]
ORDER BY [TAG NUMBER] -- To order the Courses in order
FOR XML PATH('')), 1, 1, '') AS 'Document Number' FROM TE510_TAG_INDEX E
GROUP BY E.[TAG NUMBER]

myquery = "select [Doc-Doc] from TE510_Document_Index where [File Full


Path]='A:\201_Multiple Projects\00) DRAWING INDEX\EDB-BAB DRAWINGS INDEX.xlsx'"
oSQL.SQLQueryDataSet(myquery, "Table", sServer, sDatabase, "", "")
Dim docdoc As String = ds.Tables("Table").Rows(0).Item("Doc-Doc")
Dim spdoc = docdoc.Split(",")

SELECT C.[USER],C.ASSIGNED,C.INDEXED,D.TAG,C.AVG1 AS [AVG.DOC/DAY],


(D.TAG/8) AS [AVG.TAG/DAY] FROM
(SELECT A.[USER],A.ASSIGNED,B.INDEXED,(B.INDEXED / 8) AS AVG1 FROM
(SELECT [USER],COUNT(*) AS ASSIGNED FROM ADM_FILELIST WHERE IGNORE=0 AND
DUPLICATE=0 AND [USER] <>'' GROUP BY [USER]) A LEFT JOIN
(SELECT [USER],COUNT(*) AS INDEXED FROM ADM_FILELIST WHERE IGNORE=0 AND DUPLICATE=0
AND [USER] <>'' AND INDEXED=1 GROUP BY [USER]) B ON A.[USER] = B.[USER]) C LEFT
JOIN
(SELECT [INDEXED BY],COUNT(*) AS TAG FROM TE510_TAG_INDEX GROUP BY [INDEXED BY]) D
ON C.[USER] = D.[INDEXED BY] order by c.[User]
select b.Main_Folder,b.ftotal as Total,a.Indexed, ((cast(a.Indexed as
float)/cast(b.ftotal as float) * 100)) as Progress from (select
Main_Folder,COUNT(*) as Indexed from ADM_FILELIST where Indexed=1 and ignore=0 and
duplicate=0 group by Main_Folder ) A right join
(select Main_Folder,COUNT(*) as ftotal from ADM_FILELIST where ignore=0 and
duplicate=0 group by Main_Folder) B on a.Main_Folder=b.Main_Folder order by
b.Main_Folder

select [Indexed By],sum( cast([No of Sheets] as int) ) from TE510_Document_Index


where [No of Sheets] is not null group by [Indexed By]

Public Function GetURL(c As Range) As String


On Error Resume Next
GetURL = c.Hyperlinks(1).Address
End Function

Public Function GetURL1(c As Range) As String


On Error Resume Next
GetURL1 = c.Hyperlinks(2).Address
End Function

SELECT SUBSTRING([FILE FULL PATH],1,5) AS proj,COUNT(*) FROM TE510_Tag_Index GROUP


BY SUBSTRING([FILE FULL PATH],1,5) ORDER BY PROJ

update TE510_Document_Index set [to]='ADNOC Gas Processing' where [To] is null or


[to] = ''

UPDATE A SET Indexed=1 FROM ADM_FILELIST A JOIN TE510_Document_Index B ON A.[File


Full Path]=B.[File Full Path]

UPDATE A SET A.[Document Number]=B.[Document Number] from TE510_Tag_Index A JOIN


TE510_Document_Index B ON A.[File Full Path]=B.[File Full Path]
UPDATE A SET A.[Document Number]=B.[Document Number] from TE510_Tag_Index A JOIN
TE510_Document_Index B ON A.[File Full Path] =B.[File Full Path] where A.[Document
Number] is null

select * from TE510_Tag_Index where [Tag Number] like '%[*<>;:~`&^@!•(]%'

insert into FILEFORMAT select * from ADNOC_PIPELINE_NETWORK.dbo.FILEFORMAT

update A set a.[User]=B.[Indexed By] from ADM_FILELIST A join TE510_Document_Index


B on A.[File Full Path]=B.[File Full Path]

You might also like