This post is from a low-reputation account and contains an unverified outbound link. Be cautious before clicking external links.

SQLRelease Python

Words
166
Reading
1 min
Listen
Play
8y

In this post, we are going to learn how we can leverage python in SQL server to generate comma separated values.
If we want to combine all values of a single column it is fairly easy as we can use COALESCE function to do that. Here is a reference to the already existing post. But have you ever thought what would happen if we needed a comma separated value in a column along with other columns? In that scenario, this approach would not work.
We can get comma separated values in a column along with other columns using FOR XML PATH query wrapped inside a sub-query, but there also we would need to take care of HTML encoded characters like < and >.
Now, with python’s integration with SQL Server 2017, it can be achieved very easily and efficiently as we do not have to rely on subqueries and XML PATH. Let us see how we can achieve this using Python in SQL Server.

https://goo.gl/v9w2K3

#Python #pandas #SQLServer2017 #SQLReleaseScreenshot_2018-06-02-19-47-08-713.jpeg

SQLRelease Python | Ecency