PowerShell play to all editions of SQL Server

Source: Internet
Author: User
Tags pack sql server manual

Microsoft has released the latest PowerShell for SQL Server 2016 command-line client library. This paper introduces the practical methods related to it.

PowerShell Missionary original article 2016-06-05,2016-06-30 to be reproduced, but must retain the name and provenance, otherwise investigate legal responsibility

Powershell,sql server,2016, Feature Pack, client, download

PowerShell play SQL Server is stronger than PowerShell playing MySQL!

Q: So the question comes, where is the strong?

A: Microsoft has done a powershell+sqlserver "client" library for us.

Q: So the question is, where is the client library? What's the name? Where to download?

Answer: In the SQL Server 20XX Feature Pack. or called "SQL Server 20xx with tools".

Take sqlserver2016 function Pack as an example, take some x64 as an example:

Must be installed sequentially:

1. NET 4.5 or more. (or the system comes with it)

2 Chs\x64\sqlsysclrtypes.msi

3 Chs\x64\sharedmanagementobjects.msi

4 Chs\x64\powershelltools.msi

5 I have tried it myself and restarted.

https://www.microsoft.com/zh-cn/download/details.aspx?id=52676

It can manage all SQL libraries from sql2008 to sql2016! (the sql2005 life cycle has ended).

Q: How does the library work?

Answer: Enter under PowerShell

Import-module ' Sqlps '

One of the most important commands is invoke-sqlcmd, such as:

Invoke-sqlcmd-query "SELECT @ @VERSION;"

Invoke-sqlcmd-inputfile C:\temp\SQLFiles.sql-ServerInstance deathstar-database Master-verbose | Out-file C:\temp\output.txt

Q: What are the commands?

A: The command list is as follows:

Get-command *-Module Sqlpsdecode-Sqlnameencode-Sqlnamesqlserver:add-Sqlavailabilitydatabaseadd-Sqlavailabilitygrouplistenerstaticipadd-Sqlfirewallrulebackup-Sqldatabaseconvertfrom-Encodedsqlnameconvertto-Encodedsqlnameconvert-urntopathdisable-sqlalwaysonenable-Sqlalwaysonget-Sqlcredentialget-Sqldatabaseget-Sqlinstanceget-Sqlsmartadmininvoke-Policyevaluationinvoke-Sqlcmdjoin-sqlavailabilitygroupnew-sqlavailabilitygroupnew-sqlavailabilitygrouplistenernew-sqlavailabilityreplicanew-sqlbackupencryptionoptionnew-sqlcredentialnew-Sqlhadrendpointremove-Sqlavailabilitydatabaseremove-Sqlavailabilitygroupremove-Sqlavailabilityreplicaremove-Sqlcredentialremove-Sqlfirewallrulerestore-Sqldatabaseresume-Sqlavailabilitydatabasesave-Sqlmigrationreportset-Sqlauthenticationmodeset-Sqlavailabilitygroupset-Sqlavailabilitygrouplistenerset-Sqlavailabilityreplicaset-Sqlcredentialset-Sqlhadrendpointset-Sqlnetworkconfigurationset-Sqlsmartadminstart-Sqlinstancestop-Sqlinstancesuspend-SqlavailabilitydatabaseSwitch-sqlavailabilitygrouptest-sqlavailabilitygrouptest-sqlavailabilityreplicatest-sqldatabasereplicastatetest-sqlsmartadmin
View Code

Q: Where is the manual?

For:

-----The PowerShell command for SQL Server Manual on MSDN------

https://msdn.microsoft.com/zh-cn/library/hh245198.aspx #中文版, support SQL Server 2016

https://msdn.microsoft.com/en-us/library/hh245198.aspx #英文版, SQL Server 2016

Q: Where is the PowerShell command-line operation for SQL Server applications?
For:
Data warehousing business, data out of the library to JSON and so on.
Data out of the library to be stored in Excel files.

Q: Where is SQL Server 2016 Simplified Chinese Enterprise Edition downloaded?

For:

2016-06-02 Cn_sql_server_2016_enterprise_x64_dvd_8699450.iso

SHA1:66A518194A021DE6A1AE2F73184B0AD4D83C64B4 ed2k://|file|cn_sql_server_2016_enterprise_x64_dvd_8699450.iso| 2452795392| d8afd8d6245f518f53f720c48e2819c0|h=y2s376kq25p5ig27tvc2k33t5szri5em|/

---"PostScript"---

A professor of level can not survive by copying the research ideas in others ' papers. That is the shame of a learned man's life!

Like a TV ad, repeated over and over again, by bombing. Use hundreds of mobile phones to cheat the app and swipe tickets. Repeating the posts over and over again is what the inferior people do.

Even distressed inferior people, it seems to let me hate is right. There's a word for the stink.

---finished---

PowerShell play to all editions of SQL Server

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.