插入行时保留顺序 [英] Retain The Order while Insert Rows

查看:48
本文介绍了插入行时保留顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我放置了一个排序组件来对我的数据进行排序.并且对数据进行了排序.但我的目标表是无序的!

I put a sort component to sort my data. and the data was sorted. but my destination table is unordered!

如何在使用 ssis 将它们插入到 sql 表时保留已排序行的顺序?

How can retain the Order of sorted rows while Inserting them into sql Table with ssis?

推荐答案

SQL Server 表中的行没有固有的顺序.您需要添加排序顺序"列或编写查询,以便它们生成正确排序的结果集.

There is no inherent ordering of rows in a SQL Server table. You'll need to either add a 'sort order' column or write your queries so that they produce properly sorted result sets.

您可以使用 IDENTITY 列作为您的排序顺序"列,因为它会随着插入的内容而增加.

You can use an IDENTITY column as your 'sort order' columns, since it will increment as things get inserted.

了解对 sql 数据库重复执行给定的查询不能保证以相同的顺序返回结果,因此您的查询需要每次都这样做.

Understand that repeated executions of a given query against a sql database are specifically not guaranteed to return results in the same order, so your queries need to do it each and every time.

这篇关于插入行时保留顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆