Skip to content

Commit cda49e0

Browse files
author
Matt Usher
authored
Merge pull request #40 from Azure-Samples/sqlextension
Adding the DBC.databases view to match the Teradata DBC.databases view
2 parents 8d8aeac + 457e20c commit cda49e0

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

SQL/Extension/deploy.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\functio
5858
ECHO Deploying views
5959

6060
REM Views
61+
sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\views\dbc.databases.sql
62+
sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\views\dbc.tables.sql
6163
sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\views\microsoft.dw_active_queries.sql
6264
sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\views\microsoft.dw_active_queue.sql
6365
sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\views\microsoft.dw_configuration.sql
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
DROP VIEW IF EXISTS [dbc].[databases];
2+
GO
3+
4+
CREATE VIEW [dbc].[databases] AS
5+
SELECT
6+
[DatabaseName] = d.name
7+
, [CreatorName] = 'dbo'
8+
, [OwnerName] = 'dbo'
9+
, [AccountName] = 'dbo'
10+
, [ProtectionType] = 'N'
11+
, [JournalFlag] = 'NN'
12+
, [PermSpace] = 0
13+
, [SpoolSpace] = 0
14+
, [TempSpace] = 0
15+
, [CommentString] = NULL
16+
, [CreateTimeStamp] = d.create_date
17+
, [LastAlterName] = 'dbo'
18+
, [LastAlterTimeStamp] = d.create_date
19+
, [DBKind] = 'U' -- or 'D'
20+
, [AccessCount] = NULL
21+
, [LastAccessTimeStamp] = NULL
22+
FROM
23+
sys.databases d
24+
GO

0 commit comments

Comments
 (0)