![]() $SqlDataReader = $SQLCommand. $SQLCommand.CommandText = 'SELECT database_id, name, user_access_desc, state_desc from Sys.Databases' For example, if a company has a database that stores invoices only until they are paid (open), then its retention is FIXED. $SQLCommand = $SQLConnection.CreateCommand() $SQLConnection= New-Object ($ConnectionString) Type the characters above into the field below. Take one of the lines above and add it to the PowerShell snippit below as the very first line like this example for WID2012+: $ConnectionString = 'server=\\.\pipe\MICROSOFT#WID\tsql\query database=SUSDB trusted_connection=true ' WID2012+ $ConnectionString = 'server=\\.\pipe\MICROSOFT#WID\tsql\query database=SUSDB trusted_connection=true ' WID2008: $ConnectionString = 'server=\\.\pipe\MSSQL$MICROSOFT#SSEE\sql\query database=SUSDB trusted_connection=true ' The following example will take a simple SELECT statement and return it’s values in a PowerShell variable. You must open PowerShell in Elevated mode by “Run as administrator”. You can use PowerShell to also connect and execute SQL commands directly to the database. Expand the SUSDB, expand Tables, and you should see a listing of tables in the database. Then expand Databases and you should see SUSDB and any other databases on this instance. It should connect successfully to the WID SQL instance. Keep the setting for use Windows Authentication and click connect. WID2012+ np:\\.\pipe\MICROSOFT#WID\tsql\query ![]() WID2008 np:\\.\pipe\MSSQL$MICROSOFT#SSEE\sql\query To do this, open SSMS by using right click, “Run as administrator” and in the database server copy/paste Although an end-user database management tool may be just the ticket in some situations, it is not the best answer for specialized tasks such as invoicing. SQL Server Management Studio (SSMS) is by far the easiest way to graphically connect and explore the database server instance.To tell if the WID carries more than the SUSDB database, you’ll need to install SSMS and connect to the WID instance. This is one of the trade-offs for using WID over SQL Express (but SQL Express carries a hard database size limit where as the WID does not). Connecting to the Windows Internal Database (WID) can only be done LOCALLY. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |