From the course: Complete Guide to Advanced SQL Server

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Include the index in a DataFrame

Include the index in a DataFrame - SQL Server Tutorial

From the course: Complete Guide to Advanced SQL Server

Include the index in a DataFrame

The index that Python uses can sometimes be useful to include when you send your DataFrame to a SQL result set, but since it isn't normally part of the data, it gets lost in the translation. Let's take a look at what I mean. I'm going to start out with our standard blank template here. And this time we're going to make use of the input_data_1 parameter. So I'll type in a comma @ input_data_1. And we're going to pull some information out of the Application.Cities table. I'm going to select the latest recorded population. That'll pull just a single column from this table. And if I just want to check on the SELECT statement make sure it works right, I can highlight this text and press "Execute." And that'll run just the SELECT statement. And that's the data there. Now, I'm going to go up here into my script, and I'm going to take the OutputDataSet and assign it the value of the InputDataSet. This will just pass the data straight through. We're not going to modify it in any way. And I can…

Contents