{"id":17658,"date":"2007-06-20T12:12:55","date_gmt":"2007-06-20T20:12:55","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/powershell\/?p=17658"},"modified":"2019-05-16T12:15:17","modified_gmt":"2019-05-16T20:15:17","slug":"demo-sql-provider-code","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/demo-sql-provider-code\/","title":{"rendered":"Demo SQL Provider Code"},"content":{"rendered":"<p>Hi,\nAttached is the code we used today in the Web cast for the SQL demo provider. Please note this is not a SQL management provider. It simply allows you to query data from a SQL server directly from the cmd line.\nInstall the Snapin: \nPS>$env:Windir\\Microsoft.NET\\Framework\\v2.0\\.50727\\InstallUtil.exe SQLProvider.dll\nAdd the snapin to your session:\nPS>Add-PsSnapin SqlPrototypeProvider\nYou can use it as follows:\nPS>cd SQL:\nSQL:>cd MySQLServer\nSQL:>dir\nmaster\ntempdb\nmodel\nmsdb\npubs\nNorthwind\nSQL:>cd Northwind\nSQL:>dir\nname\n&#8212;-\nCategories\nCustomerCustomerDemo\nCustomerDemographics\nCustomers\ndtproperties\nEmployees\nEmployeeTerritories\nOrder Details\nOrders\nProducts\nRegion\nShippers\nSuppliers\nTerritories\nSQL:>cd Employees\nSQL:>Dir -filter {where EmployeeId=8}\nEmployeeID      : 8\nLastName        : Callahan\nFirstName       : Laura\nTitle           : Inside Sales Coordinator\nTitleOfCourtesy : Ms.\nBirthDate       : 1\/9\/1958 12:00:00 AM\nHireDate        : 3\/5\/1994 12:00:00 AM\nAddress         : 4726 &#8211; 11th Ave. N.E.\nCity            : Seattle\nRegion          : WA\nPostalCode      : 98105\nCountry         : USA\nHomePhone       : (206) 555-1189\nExtension       : 2344\nPhoto           : {21, 28, 47, 0&#8230;}\nNotes           : Laura received a BA in psychology from the University of Washington.  She has also completed a course\n                   in business French.  She reads and writes French.\nReportsTo       : 2\nPhotoPath       : http:\/\/accweb\/emmployees\/davolio.bmp\n Wassim [MSFT]<\/p>\n<p>SQLProvider.zip<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, Attached is the code we used today in the Web cast for the SQL demo provider. Please note this is not a SQL management provider. It simply allows you to query data from a SQL server directly from the cmd line. Install the Snapin: PS>$env:Windir\\Microsoft.NET\\Framework\\v2.0\\.50727\\InstallUtil.exe SQLProvider.dll Add the snapin to your session: PS>Add-PsSnapin SqlPrototypeProvider [&hellip;]<\/p>\n","protected":false},"author":685,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-17658","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Hi, Attached is the code we used today in the Web cast for the SQL demo provider. Please note this is not a SQL management provider. It simply allows you to query data from a SQL server directly from the cmd line. Install the Snapin: PS>$env:Windir\\Microsoft.NET\\Framework\\v2.0\\.50727\\InstallUtil.exe SQLProvider.dll Add the snapin to your session: PS>Add-PsSnapin SqlPrototypeProvider [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/685"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=17658"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/17658\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=17658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=17658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=17658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}