Recommended documenting utilities
|
- xCase has pretty good reverse-engineering capabilities and is not nearly as expensive as some of the other data-modelling packages available.
- Visio will document everything, with an advantage of further exporting the
diagrams to an ERWin model, if required.
- You can also try powerdesign www.sybase.com and AllFusion ErWin www.ca.com
by several people on thread #824372 and thread #820926 |
|
|
Generate Base36 string from integer
|
You can use following code to convert integer value into Base36 encoded string.
DECLARE @i int, @key int,
@B36 char(36), @Key5 varchar(5)
SET @key = 1234578910
SET @B36=
'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
SET @Key5 = ''
SET @i = 1
WHILE @i < 6
BEGIN
SET @Key5=SUBSTRING(@B36,
(@key % 36)+1,1) + @Key5
SET @key = CAST(@key / 36 AS int)
SET @i = @i + 1
END
SELECT @Key5
by Sergey Berezniker on thread #823200 |
|
Get physical locations of data files
|
Each database can be located in it's own directory or even in multiple directories.
The following select will return directory for the primary filegroup for each DB.
SELECT name, filename,
REVERSE(SUBSTRING(REVERSE(filename),
CHARINDEX('\', REVERSE(filename)), 4000))
FROM master.dbo.sysdatabases
by Sergey Berezniker on thread #826365 |
|
|
User-defined functions in queries are slow
|
The costs within a user-defined function might be not exposed to the show plan. However, they are very expensive. Try to avoid them at all cost.
Two tips for avoiding them:
- Pre-calculate values in additional column in database, so query gets data from a field, not from a function.
- Use sub-queries, if it is possible.
by Michael Levy on thread #801022 |
|