|
Posted by Dan Guzman on 04/29/07 20:04
> I assumed that it is not possible to create a partitioned tables from
> existing ones. But I have not worked much with partitioned tables, so
> I could be wrong.
It is possible to move a non-partitioned table (actually a single partition)
into a partitioned table with ALTER TABLE...SWITCH PARTITION. The
source/target table must have the same schema (including indexes) and
table/indexes must reside on the same , filegroup(s). Also, the source
table must have a check constraint on the partitioning column to ensure data
is within the target partition boundaries.
One caveat is that the index stats are not updated when data is switched
into the partitioned table so it's probably a good idea to update stats
after SWITCH.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns99216E9ABE6C8Yazorman@127.0.0.1...
>B D Jensen (bjorn.d.jensen@gmail.com) writes:
>> Functions are written in T-SQL (i also wrote them in CLR, but in this
>> case they were slower). The original columns have incorrect datatypes,
>> that uses too much storage, so the functions check that values are in
>> correct domain and if not they return null - what is a correct result,
>> because the values then are physical impossible.
>
> I would recommend that you have the expressions inline, at least if
> you desire to cut down execution time.
>
>> I wondered why you only wrote that I can't use "select into" for
>> patitioned tables.
>
> I assumed that it is not possible to create a partitioned tables from
> existing ones. But I have not worked much with partitioned tables, so
> I could be wrong.
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|