Skip to main content

I've got a table in sqlserver with an id column with unique identifier type and default value newsequentialid(). I need to reference these keys from another table so i need to exactly move this column as FK to another table but when i use SQLExecutor() with query 'select id from table' to write these attribute the order of GUID's get disruted and does not maintain its original order? Is it possible to maintain its order?

Hi @dzhakob, generally you cannot expect any regularity on the order of records in a query result unless you specify the order explicitly with the SQL statement. Consider adding ORDER BY clause to the SQL statement if you need to sort the resulting records.


Reply