Without these statistics, or with outdated statistics, the query will be slow, as the query optimizer uses inaccurate statistics to create the query execution plan, which is not the optimal plan to execute the query in this case.
SQL Server usually does its job in keeping these statistics up-to-date.
We always upload the data to a table and then begin the process.
Although this process works are you familiar with any other options to directly perform the INSERT, UPDATE or DELETE operations?
Use the code in Listing 1 to create the Get Nums functions the sample database. This meant that if you wanted indexes in your table variables, your only option was to define those indirectly via inline PRIMARY KEY and UNIQUE constraint definitions.
These statistics provide the query optimizer with the distribution of the columns values in the table and the number of rows, also called the cardinality that will result from the query.
Are their any benefits to transitioning our code to another approach with the OPENROWSET command?
Yes - You are correct the OPENROWSET command can directly support INSERT, UPDATE or DELETE operations as shown in these tips: Export data from SQL Server to Excel and Different Options for Importing Data into SQL Server.
This has been beneficial for us because in our environment because our business users provide data to us in the form of Excel spreadsheets.
Many of the situations end up translating to INSERT, UPDATE or DELETE code in one or more of our SQL Server databases.