Blog Archives

How to connect Python and SQL Server – Part 2

Hey Guys,

In my first blog post about Python and SQL Server, I gave a very short introduction in how to actually connect and execute a simple query. Today I want to extend a bit on using Python and SQL Server.

As I described in the end of the previous post the ideal scenario is that you inherit the database connection from a single file and then use it whenever and anywhere you want. This makes your code to look cleaner and eliminate redundant work in case you need to change credentials or something else. For that I will show to you how to do it. Read the rest of this entry

Advertisements

How to connect Python and SQL Server

Hi everyone!!

Lately I have been studying a bit of Python that I intend to use at work for some projects and also for learning a new language. I would recommend for you to also learn it, because as you know Python is coming to SQL Server 2017. The thing is that with Python you can use in your Machine Learning models, build Websites using some other frameworks such as: Django or Flask and even automate trivial tasks of your daily basis.

However, something that I know from the top of my head now is: Python was not designed in the first hand to deal with Microsoft SQL Server as a backend database. You don’t find lot’s of examples, the documentation sometimes is a bit misleading and errors and more errors that you cannot even imagine. If you search about Python + MySQL, Python + PostgreSQL, you will find lots of examples out there. I am not saying this is bad or anything, but it is just the way it is. Read the rest of this entry

The most read posts of June – 2017

Hi guys,

I have decided that I will continue to do this kind of blog post. So you don’t need any other introduction about the subject. So, let me list the top 5 posts of June.

1)  Transaction log cheio? E agora? – 327 views – Posted on 13.06.2011

2) Como visualizar o conteudo de procedures criptografadas –  182 views – Posted on 11.03.2015

3) Configurando Linked Server de SQL Server para Oracle – 175 views – Posted on 15.06.2012

4) SQL Server no Linux – os primeiros passos – 115 views – Posted on 02.01.2017

2) Adding SSISDB to AG for SQL Server 2016 – 97 views – Posted on 28.04.2017

You see it, that’s not a looot of reads, but I’ll try to improve my writing skills and share more with you, because I have been doing some pretty cool stuff at work!

I hope you like this type of post!

Olá pessoal,

Decidi que vou continuar com esse tipo de postagem. Bom, acredito que não preciso fazer mais nenhuma introdução sobre esse assunto, então segue os 5 posts mais acessados do meu blog.

1)  Transaction log cheio? E agora? – 327 views – Posted on 13.06.2011

2) Como visualizar o conteudo de procedures criptografadas –  182 views – Posted on 11.03.2015

3) Configurando Linked Server de SQL Server para Oracle – 175 views – Posted on 15.06.2012

4) SQL Server no Linux – os primeiros passos – 115 views – Posted on 02.01.2017

2) Adding SSISDB to AG for SQL Server 2016 – 97 views – Posted on 28.04.2017

Para falar bem a verdade, o numero de visualizações é bem baixo até, acho que preciso fazer mais propaganda Open-mouthed smile. Está acontecendo bastante coisa legal no trabalho e vou tentar escrever mais conteúdos para todos.

Se vocês gostaram desse tipo de post, deixa um comentário, já é um bom incentivo.

Regards,
Marcos Freccia
Data Platform MVP

How much transaction log, transactions generate?

Hi Everyone,

I wanted to share something that I am doing this week at work. One of the applications that I support is generating a lot of transaction log in the database. Just to have an idea, we run Transaction Log backups every 30 minutes and I have backups over 100GB and sometimes 200GB. The difficult part of investigating what is generating that amount of log is because the databases involved are used by at least 3 different applications and streams. So, I remember that in the past I created a simple script that looks at this information in the database and then I may have more inputs of what is really generating that amount of log. Read the rest of this entry

The overlapped instance error

One of the possible scenarios for SQL Server FCI to AG migration is adding a third node to the Windows Failover Cluster and creating an Availability Groups between the FCI and the third standalone SQL Server, or having one node as FCI and the other node as a standalone SQL.

In my case I am running with the second option. I have one node with SQL Server 2014 FCI and the other node SQL Server 2016 Standalone, but the servers are in the Windows Cluster. When you try to create the Availability Groups between them you get the following error. Read the rest of this entry