SQL server extended storage process

Source: Internet
Author: User

-- Obtain the version number of MS SQL
Execute master .. sp_msgetversion

-- Obtain the hard disk file information
-- Parameter description: directory name, directory depth, and whether to display files
Execute master .. xp_dirtree 'C :'
Execute master .. xp_dirtree 'C: ', 1
Execute master .. xp_dirtree 'C: ', 1, 1

-- List all programs provided by OLEDB installed on the server
Execute master .. xp_enum_oledb_providers

-- List all code pages installed on the server
Execute master .. xp_enumcodepages

-- List the dsn configured on the server
Execute master .. xp_enumdsn

-- List the SQL server error logs and the last update time
Execute master .. xp_enumerrorlogs

-- List all windows Local Groups on the server
Execute master .. xp_enumgroups

-- Check file existence
Execute master .. xp_fileexist 'C: \ a. Bak'

Declare @ flag int

Exec master.. xp_fileexist 'C: \ abc. Bak', @ flag out

If @ flag = 1
Begin
Print 'exist'
End
Else
Begin
Print 'no exist'
End

-- List the fixed drives on the server and the available space for each drive
Execute master .. xp_fixeddrives

-- Obtain the computer name of the current SQL server.
Execute master .. xp_getnetname

-- List the specific content of the current Error Log
EXEC [master]. [dbo]. [xp_readerrorlog]

-- List all sub-directories under a specified directory
EXEC [master]. [dbo]. [xp_subdirs] 'C: \ WINNT'

--- List drive names
-- Low free space in bytes)
-- Drive type: Hard Drive (1), Hard Drive (2), cd-rom (8)
EXEC [master]. [dbo]. [xp_availablemedia]
-- The effect is as follows:

Name low free high free media type
C: \ 1270386688 0 2
D: \ 1726824448 2 2
E: \ 875053056 10 2
F: \ 0 0 8

The [master]. [dbo]. [sp_addlogin] contains the encryption function pwdencrypt. If you are interested, try again.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.