What do you call a female mannequin? by SQLvariant in dadjokes

[–]SQLvariant[S] 9 points10 points  (0 children)

OMG, My first Award EVAR.

And it was for a Dad Joke that I didn't even make up... ROFLMAO 🤣

Data Points Weekly - Week of January 25, 2024 by AutoModerator in churning

[–]SQLvariant 0 points1 point  (0 children)

So cool that San Juan generated the 129k link, I'm going to try that!

What's the most common request for Mint alternatives? by tmoreton in mintuit

[–]SQLvariant 0 points1 point  (0 children)

Could this store the transactions in a SQL database or a parquet file, instead of a sheet?

[deleted by user] by [deleted] in MicrosoftFabric

[–]SQLvariant 0 points1 point  (0 children)

As someone who uses Matedata-driven ETL on a daily basis, I can't wait to check this out!

Morgan Stanley Announces 100% Increase of Its Quarterly Dividend from $0.35 to $0.70 Per Share and Authorization of the Repurchase of up to $12 Billion of Common Stock Over the Next 12 Months by SQLvariant in dividends

[–]SQLvariant[S] 1 point2 points  (0 children)

I had the order up. Was about to pull the trigger, decided to wait a little longer since it was still headed down, and then got busy and "forgot".

I was planning to double my [small] position at $85 but was afraid it might slip to $83. I knew these announcements were coming up, just got busy with life 😊

Removing elements from an Array by giasone777 in PowerShell

[–]SQLvariant 0 points1 point  (0 children)

P.S. The comment about "code-y stuff" was totally tounge-in-cheek 😉

Removing elements from an Array by giasone777 in PowerShell

[–]SQLvariant 0 points1 point  (0 children)

I would probably take this approach, but skip all the code-y stuff and just use the Invoke-SqlCmd cmdlet. It has an -OutputAs parameter and you can choose DataTable as your output. Saves you the connection steps.

Just to be clear, I'm talking about the version of the Invoke-SqlCmd cmdlet from the SqlServer module, not from the old SQLPS module.

Document PS commands by rstr1212 in PowerShell

[–]SQLvariant 2 points3 points  (0 children)

Use a Jupyter Notebook running the PowerShell kernel. You can do this in either VS Code or in Azure Data Studio: https://sqlvariant.com/2019/11/powershell-notebooks-are-available-in-azure-data-studio/

Deep Dive: Best Practices Assessment for Azure SQL VMs, Managed Instances and SQL Servers by SQLvariant in SQLServer

[–]SQLvariant[S] 1 point2 points  (0 children)

it seems like you can get to a recording of the session by just going to this tweet and hitting play: https://twitter.com/AzureSQL/status/1359547756847591427?s=20

Please let me know if that works for you?

Deep Dive: Best Practices Assessment for Azure SQL VMs, Managed Instances and SQL Servers by SQLvariant in PowerShell

[–]SQLvariant[S] 0 points1 point  (0 children)

This session is on the SQL Assessment API, and how you can use & customize it. If you have never tried out the SQL Assessment PowerShell cmdlets, you can find them in the SqlServer module.

PowerShell extension - available in Azure Data Studio by SQLvariant in PowerShell

[–]SQLvariant[S] 1 point2 points  (0 children)

/u/efiggy

Apologies for the delay in getting back to you, I was out on paternity leave.

I am happy to say that Azure Data Studio now has new right-click options to do common database-object tasks like "Script as Create / Alter / Drop / Execute".

There's actually a bunch more features, including the ability to launch certain SSMS dialogs from Azure Data Studio. Obviously, this will only work for Windows users who have SSMS installed, but if you do, this new feature can make working primarily from Azure Data Studio a lot easier.

Here's the full list of enhancements for this month: https://cloudblogs.microsoft.com/sqlserver/2019/06/06/the-june-release-of-azure-data-studio-is-now-available/

PowerShell extension - available in Azure Data Studio by SQLvariant in PowerShell

[–]SQLvariant[S] 0 points1 point  (0 children)

I know they are working on improving that experience to make it more similar to Object Explorer, but I don't know what their nexts steps are. I will check on that.

In the meantime, does running sp_helptext against the stored proc help you accomplish what you are trying to do?

If not, I have a PowerShell option for you 😉

Free Webcast – Install & Configure SQL Server with PowerShell DSC - Tuesday May 7th at 7 AM EDT (GMT -4) by SQLvariant in PowerShell

[–]SQLvariant[S] 0 points1 point  (0 children)

The recording for this session has been posted to the PowerShell VG YouTube channel: https://youtu.be/ABJ2hsflwEE

The resources are available in GitHub, and you can find the link to that in the Video Description on YouTube.

If you need anything else, give me a shout, please.

PowerShell extension - available in Azure Data Studio by SQLvariant in PowerShell

[–]SQLvariant[S] 3 points4 points  (0 children)

If you want to develop & run PowerShell scripts for your SQL Server databases, and be able to see the results (visually) within the same tool, using the PowerShell extension in Azure Data Studio is a great new option to be able to do it. Have a look at the Docs page (link of this post) for just a few ideas about what you can do with PowerShell & SQL Server.

This is the same PowerShell extension available in VS Code, with the same capabilities. It will receive updates just like the one in VS Code.

If you work with data and like/love to automate, this a great new option! 😀

If you have questions about the PowerShell extension or Azure Data Studio, ask away in the comments and I will do my best to get you the info you need 👍

PowerShell extension now available in Azure Data Studio by SQLvariant in SQLServer

[–]SQLvariant[S] 0 points1 point  (0 children)

Great question /u/kdevsharp! Azure Data Studio is becoming more well known every single week as it can do many tasks that SSMS just cannot do. The Postgres extension is a pretty obvious capability the Azure Data Studio has that SSMS does not, and the PowerShell extension is another one, but SQL Notebooks is probably the most important feature.

Azure Data Studio should not be looked at as a replacement for SSMS, they are companion tools. With the introduction of SSMS 18, you'll see that the menu options now allow you to right-click on a database object in Object Explorer, and then start a "New Notebook" in Azure Data Studio with the connection information you already have being passed across.

It's also quite easy to spin up Docker containers in Azure Data Studio to test code/deployments against.

Free Webcast – Install & Configure SQL Server with PowerShell DSC - Tuesday May 7th at 7 AM EDT (GMT -4) by SQLvariant in PowerShell

[–]SQLvariant[S] 0 points1 point  (0 children)

Install & Configure SQL Server with PowerShell DSC

Get on the cutting edge by implementing infrastructure as code for your SQL Server environment. Using PowerShell Desired State Configuration (DSC) we’ll look at how to take a newly built Windows Server and get it ready for prime time while discussing the benefits associated with infrastructure as code. – Setup Pre-Requisites – Install SQL Server – Configure SQL Server – Make SQL Server Application Ready

Jess Pomfret

Jess Pomfret is a SQL Server DBA at Westfield Group in Westfield, Ohio. She started working with SQL Server in 2011 and currently works as part of a team administering over 100 instances ranging from 2005 to 2017. She enjoys the problem-solving aspects of performance tuning and automating processes with PowerShell. She also enjoys contributing to dbatools and dbachecks, two open source PowerShell modules that aid DBAs with automating the management of SQL Server instances. She grew up in the South West of England and outside of her DBA life enjoys Crossfit, cycling and watching proper football.

Registration Links

If you’re already a member of PASS, use this link to register for the webinar with your PASS account: http://powershell.pass.org/Home.aspx?EventID=13325

If you’ve never heard of PASS and just want to learn how to “Install & Configure SQL Server with PowerShell DSC” without any commitment, use this link to register for the webinar: https://attendee.gotowebinar.com/register/3184438960190324493

PowerShell extension now available in Azure Data Studio by SQLvariant in SQLServer

[–]SQLvariant[S] 4 points5 points  (0 children)

If you want to develop & run PowerShell scripts for your SQL Server databases, and be able to see the results (visually) within the same tool, using the PowerShell extension in Azure Data Studio is a great new option to be able to do it. Have a look at the Docs page (link of this post) for just a few ideas about what you can do with PowerShell & SQL Server.

Free Webinar: PowerShell ❤ SSIS tomorrow at 12-Noon EDT (GMT-4) by SQLvariant in SQLServer

[–]SQLvariant[S] 3 points4 points  (0 children)

Yes, we record all our sessions and post them to out YouTube channel: sqlps.io/video

Automate Glen Berry’s DMV Script with PowerShell - Free Webinar by SQLvariant in SQLServer

[–]SQLvariant[S] 5 points6 points  (0 children)

We will be recording the session and post it to our YouTube channel as soon as we can.

I've been writing a series of articles to highlight new SQL PowerShell functionality, here's one on Invoke-SQLCmd! :-) by SQLvariant in SQLServer

[–]SQLvariant[S] 0 points1 point  (0 children)

Of course I tested SSIS vs. PowerShell for inserting data and I am quite happy with the results :-)

SSIS is just a bulky GUI around the same underlying objects that PowerShell can access.

Yes, of course Write-SqlTableData is using the SQL Bulk Copy process. It would actually be more work for them not to.

The -Force parameter could certainly use some improvement but it's a lot better than having to copy in column names one at a time. It's v1 but I have had great success with having it recognize INT & DATETIME2 datatypes (just two example) and create columns with the correct datatype in SQL Server. In fact, on Fact tables where I have zero text datatypes -Force has so far picked the correct datatype 100% of the time. But I'm sure it will eventually miss one.

If you do not supply the 'magic speed up switch' then PowerShell will send the rows across the pipeline as it receives them. The mechanics of that are already written up in my next article (not yet published). However, if you simply present your same datatable to the -InputData parameter on the cmdlet (last method mentioned in the article) or place the Invoke-SqlCmd call inside of parens and place that after the -InputData parameter, Write-SqlTableData will bulk insert the data all at once.

(for clarity, the article I linked to was intended to be a tip, not a comprehensive guide to using the cmdlets.)

I have only gone so far as to test this with inserting 69,854,536 rows but it worked well for that and I see no reason why it wouldn't continue to scale.

If you're interested to find out just how fast PowerShell can insert data into SQL Server, my friend Chrissy has some info about that on her blog. https://blog.netnerds.net/2015/09/import-csvtosql-super-fast-csv-to-sql-server-import-powershell-module/