question

ashok2012 avatar image
ashok2012 asked

How Data is stored inside SQL Server? What order is it stored?

Hi Experts, When we insert Records into SQL Server How Data is stored inside SQL Server? What order is it stored?
sqlstorage
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
Data is not guaranteed to be stored in any particular way. Order is only enforced when you query, and include an ORDER BY. It is often said that data in a clustered index is stored physically in order, but even that is an abstraction - the physical pages may not necessarily be contiguous or in order, but the pointers from page to page ensure that the clustered index structure is in order. Why do you ask? Are you expecting the data to come 'out' the same way it went 'in'?
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ashok2012 avatar image
ashok2012 answered
Hi Key Riley Suppose there is a table called Transaction Transactionid Transactionname Date Amount Here Transactionid has alpha numeric data type. it dont have primary key value. Now we have insert 10000 Records My Question 1)Which column Way SQL Server Stored this Data like Transactionid or Transactionname? 2)How records Stored inside database engine like pages or which mechanism SQL is following?
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 - I'll have to repeat myself - SQL Server does not store data in any particular order. Why is this important to you? 2 - Yes data is stored in pages. Read more here from someone who writes better content than me: http://www.brentozar.com/archive/2013/02/how-does-sql-server-store-data/
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.