Database documentation

I inherited the sql server, which is used to create reports, text file outputs, and fixed-width files for use and import into other systems.

Developer (X) did not document or comment on one bit of code. X also used stored procedures, views, SSIS, SQLCMD, and each combination between them. X also created several databases in the environment to store these views, SP, etc. Thus, we have situations where SP opens a view that opens another view that invokes SQLCMD at the end of it. A lot of using RTRIM, REPLACE, STR, CONVERT ... I'm sure you will get the image ... (this is the background).

I want ideas on the best way to approach, fix, and document this environment so that it can be supported.

I began to follow the query chain by copying the requests into a single text file and commenting in Notepad ++ formatting ... then I try to consolidate the request in order to be efficient and documented.

Is there less time to use? I'm sure many DBAs went through this, what is the recommended approach?

PS. Apologies for the long post

+4
source share
3 answers

PS. Apologies for the long post

Fugetaboutit, our sympathy for your position seriously mitigates any annoyance on a long post (and it wasn’t so long).

, - . ER, , .

, . , X ​​ , . , " RTRIM, REPLACE, STR, CONVERT..." . , .

, , ( ). , . ( ), , . , . . , , .

+2

, -, :

DECLARE @SearchText varchar(100)
SET @SearchText = 'myTable'

SELECT
   schema_name(ob.schema_id)  SchemaName
  ,ob.name
  ,ob.type_desc
  ,len(mo.definition) CodeLength
  --,mo.definition
 from sys.sql_modules mo
  inner join .sys.objects ob
   on ob.object_id = mo.object_id
 where mo.definition like '%' + @SearchText + '%'
 order by
   case schema_name(ob.schema_id)
     when 'dbo' then 'A'
     else 'B' + str(ob.schema_id, 10)
   end
  ,ob.type_desc
  ,ob.name

" " (, , , ), @SearchText . , , (, , SELECT *), , "", , procs .., ... , ... ..

(* , , , .)

+2

, , , . .

1) ( ER)

2) SQL-

3)

4)

5) -

6) UML

7) , , ,

http://www.yazooconsulting.com/products.html

0

Source: https://habr.com/ru/post/1542103/


All Articles