the same table in différent file s according a rule

the same table in différent file s according a rule

Post by Ména » Wed, 03 Mar 2004 00:26:10



Hi,
does someone know if it is possible to force de store file of datas of the same table.

I would like for example to create 2 data file in two discs and i would like to put a rule specifiying that data before a certain date would be stored in the first disk and data after that date would be store in the other one (disk)?
I am not sur it is very clear but...

thx
Mena

 
 
 

the same table in différent file s according a rule

Post by Dejan Sark » Wed, 03 Mar 2004 00:34:05


Hi!

The article "Creating a Partitioned View" at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/crea...
describes how to partition data and then access it through a view.

--
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com


Quote:> Hi,
> does someone know if it is possible to force de store file of datas of the
same table.

> I would like for example to create 2 data file in two discs and i would

like to put a rule specifiying that data before a certain date would be
stored in the first disk and data after that date would be store in the
other one (disk)?
Quote:> I am not sur it is very clear but...

> thx
> Mena


 
 
 

the same table in différent file s according a rule

Post by Wayne Snyde » Wed, 03 Mar 2004 00:39:58


You could create two tables with different names on different filegroups.
Each table could have a check constraint which enforces the dates.

Your application would have to be smart enough to decide which table data
goes into.
However you could create a view on the two tables as select * from t1 union
all select * from t2 , then create an instead of trigger on the view which
would have the code to determine which table the actual row should be
inserted into.

--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), C*te, NC
www.computeredservices.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org


Quote:> Hi,
> does someone know if it is possible to force de store file of datas of the
same table.

> I would like for example to create 2 data file in two discs and i would

like to put a rule specifiying that data before a certain date would be
stored in the first disk and data after that date would be store in the
other one (disk)?
Quote:> I am not sur it is very clear but...

> thx
> Mena