Comments (13)
@mkurz - thanks for sharing this. It's nice to see people start to use the SMO DLLs on .Net Core.
You might be interested in the similar work @pensivebrian from our team did to release a commandline tool that does this exact thing called mssql-scripter.
- Github page
- Blog overview
- The project is a simple wrapper over the ScriptingService in this tools service. Including this as a reference since I'm guessing this service closely mirrors your projects implementation, so you might get some benefit from looking at it.
Would you be interested in trying out mssql-scripter and perhaps contributing to it if there are gaps with it? Most all issues can be fixed in the C# code (the scripting service implementation).
from sqltoolsservice.
OK. One thing we've noticed - in the .Net Core version there's an issue where the PersistSecurity
connection property must be set to True for some scenarios with SMO to work. It's one blocker that's stopped us releasing a nuget package up to now. If you still run into trouble with Property Not Set, try this. We believe the problem may be due to lack of "Clone" functionality in .Net Core 1.0, which impacts the ability to deep-copy an active connection including the underlying auth tokens.
from sqltoolsservice.
Oops!! FYI
I did copy all ServiceLayers DLL's into the PowerShell folder...but is I do the same with the Credentials DLL's then I just broke PowerShell:
maxt@MTrinidadLT2:~$ powershell
Error: assembly specified in the dependencies manifest was not found -- package: 'runtime.linux-x64.Microsoft.NETCore.DotNetAppHost', version: '2.0.0-preview1-002106-00', path: 'runtimes/linux-x64/native/apphost'
Haha!! I'm a menace!!
This lead me to another question about installing these sqltoolsservice components: Where should I install these DLL's? And, should I add a PATH to it. I know enough Linux to push thru some stuff but I'm not an expert.
:)
from sqltoolsservice.
Never mind!! I got to it to work. Woohoo!!
I finally connected Linux to SQL Server using SQL Authentication via SMO.
Current Environment:
Windows 10 Build 16199 - BASH
PowerShell Beta.2
And, Installing the SqlToolsCredential in the user folder and then adding both "/SqlToolsCredential" and the "/SqlToolsCredential/refs" folder to the ~/.bashrc file.
Blogging on this soon!
from sqltoolsservice.
Hi @kevcunnane,
This is Awesome!! I just had this breakthrough and I know it isn't perfect yet.
I will be testing it further as I'm very interest in providing cross-platform samples
for my new upcoming presentations.
:)
from sqltoolsservice.
Hum!! I found the property UseIntegratedSecurity {get.set}. I can use this setting $true for Windows and $false for Linux (SQL Authentication). It's working for what I want to do.
I'm drilled!!
from sqltoolsservice.
@kevcunnane Thanks for the hint with PersistSecurity
- you save me a lot of time!
from sqltoolsservice.
Maybe this is of interest for someone: I hacked together a C# app which allows you to generate SQL server scripts from the command line in Linux by using the SMO NuGet package from this repositoy here. All you need is .Net Core 2 preview: https://github.com/mkurz/SQLServerScripter
from sqltoolsservice.
@kevcunnane Awesome! I haven't heard about this project yet - would have saved me some time 😄 (However I learned something new while hacking the app together). This is exactly what I was looking for! I will for sure try it and let you know if there is something missing for our use case. Thank you very much giving me this hint! 👍
from sqltoolsservice.
I've just merged an upgrade of the SMO bits into the tools service. Also, this issue with Login property not set was fixed previously in the official Microsoft.SqlServer.SqlManagementObjects Nuget package. Is there any reason not to close this issue?
from sqltoolsservice.
Hi @shueybubbles,
Let me check again within a few days. I've been busy with Azure and work stuff recently that I need to refresh my files.
Few months ago, I did create a cross-platform SMO script which I I can be use on any version of PowerShell (Windows and Core).
I'll get back to you!
:)
from sqltoolsservice.
I'm closing this issue based on having the newest SMO bits for both 140 and 150 compatibility available on NuGet.org. Please open a new issue if those NuGets are causing problems.
from sqltoolsservice.
Sounds Good!!
Apologies for not getting back soon. If anything I'll post if there are any issues pending.
:)
from sqltoolsservice.
Related Issues (20)
- Provide SMO database properties values to the Options tab
- Get server properties
- Provide SMO database properties values to the Database Scoped Configurations tab
- "Save as CSV" does not remove CR from data
- why does the application name always add "-azdata" suffix HOT 3
- Provide SMO database properties values to the Files Tab
- Enable script option for Server Properties tabs
- Review all service errors are logged and inner exception is included where possible HOT 1
- Provide SMO database properties experience to the Filegroups Tab
- Microsoft.Data.Tools.Schema.SqlTasks.targets missing from .NET 7 HOT 1
- Provide SMO database properties experience to the QueryStore Tab
- Validate all properties dropdown options for Localization
- Add condition to verify processors old values with new values
- Query store tab wait statistics option should be changed as Dropdown instead of chekbox
- Move Restore Dialog to MSSQL extension
- Add URL support to new Restore dialog for MI server
- Notebook Agent Jobs fail on named instances
- Supporting materialized views in Kusto
- Error: Request error: UNABLE_TO_GET_ISSUER_CERT_LOCALLY HOT 1
- System.Exception: SpecifiedUri does not have existing connection.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqltoolsservice.