GithubHelp home page GithubHelp logo

Comments (13)

kevcunnane avatar kevcunnane commented on September 9, 2024 4

@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.

kevcunnane avatar kevcunnane commented on September 9, 2024 1

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.

MaximoTrinidad avatar MaximoTrinidad commented on September 9, 2024

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.

MaximoTrinidad avatar MaximoTrinidad commented on September 9, 2024

Never mind!! I got to it to work. Woohoo!!

I finally connected Linux to SQL Server using SQL Authentication via SMO.

poshcoresql_03_2017-06-08_9-45-42

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.

MaximoTrinidad avatar MaximoTrinidad commented on September 9, 2024

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.

MaximoTrinidad avatar MaximoTrinidad commented on September 9, 2024

@kenvanhyning,

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!!

winlinuxsqlsmo_authen_2017-06-08_14-25-01

from sqltoolsservice.

mkurz avatar mkurz commented on September 9, 2024

@kevcunnane Thanks for the hint with PersistSecurity - you save me a lot of time!

from sqltoolsservice.

mkurz avatar mkurz commented on September 9, 2024

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.

mkurz avatar mkurz commented on September 9, 2024

@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.

shueybubbles avatar shueybubbles commented on September 9, 2024

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.

MaximoTrinidad avatar MaximoTrinidad commented on September 9, 2024

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.

shueybubbles avatar shueybubbles commented on September 9, 2024

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.

MaximoTrinidad avatar MaximoTrinidad commented on September 9, 2024

Sounds Good!!

Apologies for not getting back soon. If anything I'll post if there are any issues pending.
:)

from sqltoolsservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.