system views : views « System « SQL Server / T-SQL






system views


12>
13> create database mydb
14> GO
Msg 226, Level 16, State 5, Server JAVA2S\SQLEXPRESS, Line 13
CREATE DATABASE statement not allowed within multi-statement transaction.
1>
2> SELECT v.name 'View name',
3>     s.name 'Schema name',
4>     DB_NAME() 'mydb'
5> FROM sys.views v JOIN sys.schemas s
6> ON v.schema_id = s.schema_id
7> WHERE v.name = 'myView'
8> GO
View name                                                                                                                        Schema name
                                                                              mydb

-------------------------------------------------------------------------------------------------------------------------------- -------------
----------------------------------------------------------------------------- ----------------------------------------------------------------
--------------------------
1>
2> drop database mydb
3> GO
Msg 574, Level 16, State 1, Server JAVA2S\SQLEXPRESS, Line 2
DROP DATABASE statement cannot be used inside a user transaction.
1>
2>
           
       








Related examples in the same category