Showing posts with label row. Show all posts
Showing posts with label row. Show all posts

Wednesday, March 28, 2012

Mapping of columns in SqlDataReader

Hi,

I use SqlDataReader to read one row from database and than set some properties to values retrieved like this:

string myString = myReader.GetValue(0) // this sets myString to first value in a row

If, however, I change order of columns returned by stored procedure myString would be set to wrong value.

Is there a way to do something like this: string myString = myReader.GetValue["ColumnName"];

you can get the ordinal position of your column like this

//dynamicall get our columns position in our readerint myOrdinal = myReader.GetOrdinal["ColumnName"];//use the discovered ordinal to retrieve the datastring myString = myReader.GetValue(myOrdinal);
|||

This looks ok.

One more question. Does this impact performance and how (much)?

|||

it will use a few cpu cycles - but everything does...
If you are iterating over a reader, you can collect all the ordinal positions up front before entering your loop and then you've minimized the overhead.

i can give you an exact performance impact, but i think it's relatively insignificant and i always do it like this so i'm not dependent on the position of the columns in the data being returned.

|||OK, thanks.|||

it should be also possible to do this:

string myString = myReader.GetValue("Column name")

so you can save some processor cycles and memory

Thanks

|||

jpazgier:

it should be also possible to do this:

string myString = myReader.GetValue("Column name")

so you can save some processor cycles and memory

When you access a reader column using the column name, the ordinal lookup is still performed (behind the scenes) so you wont actually get any cpu savings.

when you are iterating over a datareader and you access all your columns by name, you are actually performing this ordinal lookup on each row of data which results in a performance penalty. since the columns cannot move around after you have created your reader, you can collect up all the ordinal positions outside of your loop (before the: while reader.read). then you would use only the pre-collected ordinal positions when inside of your loop.

this should result in a net performance gain.

in my testing, i actually saw about a 10% performance increase when using ordinal column positions over using column names inside the loop.

|||Thank you both. You really pointed out some interesting things. Really helpful.

Friday, March 23, 2012

many to many query with 1 row per result?

I have three tables
Student
-ID
-FirstName
<etc.>
Test
-ID
-Date
<etc.>
StudentTests
- TestID
- ChildID
- Grade
What I want to do is have a query that returns a student's information,
with a list of tests they've had. So, one row per student would be
ideal. I thought about changing table layout to have a fixed number of
tests, but I want to be able to change the number of tests pretty much
dynamically. Then I thought I could change table layout dynamically
(adding / removing columns as needed, and using dynamic SQL) but then I
thought that ... might not be the best idea :)
Right now I have this query
SELECT S.ID, S.FirstName, S.LastName, T.ID, T.Date, ST.Grade
FROM dbo.Student S
LEFT JOIN dbo.StudentTests ST ON ST.StudentID = S.ID
LEFT JOIN dbo.Test T ON T.ID = ST.TestID
ORDER BY S.LastName
Let's say there are 5 tests, I get 5 rows, I'm not super excited by
that, but I'm also not coming up with a way to change it.
So is there a way to do this?Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. Sample data is also a good idea, along with clear
specifications. It is very hard to debug code when you do not let us
see it.
You might also want to learn ISO-11179 data element naming rules so
that when you do write DDL, it will be usable. Only one student,
magical "id" in the tables, reserved words, compound table names (do
you really say "mid-term exams" or "mid-term studenttest"?), etc. This
is sloppy even for a personal pseudo-code. Is this what you meant?
CREATE TABLE Students
(student_id INTEGER NOT NULL PRIMARY KEY,
.);
CREATE TABLE TestForms
(test_id INTEGER NOT NULL PRIMARY KEY,
test_date DATETIME NOT NULL,
.);
CREATE TABLE Exams
(student_id INTEGER NOT NULL
REFERENCES Students(student_id)
ON UPDATE CASCADE,
test_id INTEGER NOT NULL
REFERENCES TestForms(test_id)
ON UPDATE CASCADE,
test_grade CHAR(1) DEFAULT 'I' NOT NULL
CHECK ( test_grade IN ('I', 'W', 'A', 'B', 'C', 'D', 'F'),
PRIMARY KEY (student_id, test_id));
Did you know that you are supposed to do reports in application and not
the database in a tiered architecture?
Did you know that a table has a fixed number of columns by definition?
You are describing a report, which should be done in the front end.
Finally, you got something right! Dynamic SQL is a way of saying that
you have no idea what to do, so you will let someone else decide at run
time.
If the tests are attributes of an exam schedule, then each one gets a
column. just like height, weight and eye color would in a table that
models a person. If the tests are separate entities related to a
student, then each one gets a row in a gradebook or exams table.
This report is called a cross tabs and has been for the last 250+
years. So of course Microsoft calls it a PIVOT to be different. Her
is a quick way to write it in portable, standard SQL:
SELECT S1.student_id,
MAX(CASE WHEN T1.test_id = 1 THEN T1.test_grade ELSE '' END)
AS exam_1,
MAX(CASE WHEN T1.test_id = 2 THEN T1.test_grade ELSE '' END)
AS exam_2,
MAX(CASE WHEN T1.test_id = 3 THEN T1.test_grade ELSE '' END)
AS exam_3,
MAX(CASE WHEN T1.test_id = 4 THEN T1.test_grade ELSE '' END)
AS exam_4,
MAX(CASE WHEN T1.test_id = 5 THEN T1.test_grade ELSE '' END)
AS exam_5
FROM Students AS S1, Exams AS T1
WHERE S1.student_id = T1.student_id
GROUP BY S1.student_id;|||There are users of this group who have varying degrees of expertise.
If these questions bother you so much - STOP RESPONDING!!!! Aren't you
afraid that by being so abusive you are going to hurt your book sales?
--CELKO-- wrote:
> Please post DDL, so that people do not have to guess what the keys,
> constraints, Declarative Referential Integrity, data types, etc. in
> your schema are. Sample data is also a good idea, along with clear
> specifications. It is very hard to debug code when you do not let us
> see it.
> You might also want to learn ISO-11179 data element naming rules so
> that when you do write DDL, it will be usable. Only one student,
> magical "id" in the tables, reserved words, compound table names (do
> you really say "mid-term exams" or "mid-term studenttest"?), etc. This
> is sloppy even for a personal pseudo-code. Is this what you meant?
> CREATE TABLE Students
> (student_id INTEGER NOT NULL PRIMARY KEY,
> ..);
> CREATE TABLE TestForms
> (test_id INTEGER NOT NULL PRIMARY KEY,
> test_date DATETIME NOT NULL,
> ..);
> CREATE TABLE Exams
> (student_id INTEGER NOT NULL
> REFERENCES Students(student_id)
> ON UPDATE CASCADE,
> test_id INTEGER NOT NULL
> REFERENCES TestForms(test_id)
> ON UPDATE CASCADE,
> test_grade CHAR(1) DEFAULT 'I' NOT NULL
> CHECK ( test_grade IN ('I', 'W', 'A', 'B', 'C', 'D', 'F'),
> PRIMARY KEY (student_id, test_id));
>
> Did you know that you are supposed to do reports in application and not
> the database in a tiered architecture?
>
> Did you know that a table has a fixed number of columns by definition?
> You are describing a report, which should be done in the front end.
>
> Finally, you got something right! Dynamic SQL is a way of saying that
> you have no idea what to do, so you will let someone else decide at run
> time.
>
> If the tests are attributes of an exam schedule, then each one gets a
> column. just like height, weight and eye color would in a table that
> models a person. If the tests are separate entities related to a
> student, then each one gets a row in a gradebook or exams table.
> This report is called a cross tabs and has been for the last 250+
> years. So of course Microsoft calls it a PIVOT to be different. Her
> is a quick way to write it in portable, standard SQL:
> SELECT S1.student_id,
> MAX(CASE WHEN T1.test_id = 1 THEN T1.test_grade ELSE '' END)
> AS exam_1,
> MAX(CASE WHEN T1.test_id = 2 THEN T1.test_grade ELSE '' END)
> AS exam_2,
> MAX(CASE WHEN T1.test_id = 3 THEN T1.test_grade ELSE '' END)
> AS exam_3,
> MAX(CASE WHEN T1.test_id = 4 THEN T1.test_grade ELSE '' END)
> AS exam_4,
> MAX(CASE WHEN T1.test_id = 5 THEN T1.test_grade ELSE '' END)
> AS exam_5
> FROM Students AS S1, Exams AS T1
> WHERE S1.student_id = T1.student_id
> GROUP BY S1.student_id;|||Please send the table DDL, and a mock up of what your desired results looks
like.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
<jwsolt@.gmail.com> wrote in message
news:1150901561.790662.157270@.b68g2000cwa.googlegroups.com...
>I have three tables
> Student
> -ID
> -FirstName
> <etc.>
> Test
> -ID
> -Date
> <etc.>
> StudentTests
> - TestID
> - ChildID
> - Grade
> What I want to do is have a query that returns a student's information,
> with a list of tests they've had. So, one row per student would be
> ideal. I thought about changing table layout to have a fixed number of
> tests, but I want to be able to change the number of tests pretty much
> dynamically. Then I thought I could change table layout dynamically
> (adding / removing columns as needed, and using dynamic SQL) but then I
> thought that ... might not be the best idea :)
> Right now I have this query
> SELECT S.ID, S.FirstName, S.LastName, T.ID, T.Date, ST.Grade
> FROM dbo.Student S
> LEFT JOIN dbo.StudentTests ST ON ST.StudentID = S.ID
> LEFT JOIN dbo.Test T ON T.ID = ST.TestID
> ORDER BY S.LastName
> Let's say there are 5 tests, I get 5 rows, I'm not super excited by
> that, but I'm also not coming up with a way to change it.
> So is there a way to do this?
>|||"Gary Gibbs" <ggibbs@.aahs.org> wrote in message
news:1150903867.254646.88710@.u72g2000cwu.googlegroups.com...
> There are users of this group who have varying degrees of expertise.
> If these questions bother you so much - STOP RESPONDING!!!! Aren't you
> afraid that by being so abusive you are going to hurt your book sales?
Here, here...|||jwsolt@.gmail.com wrote:
> What I want to do is have a query that returns a student's information,
> with a list of tests they've had. So, one row per student would be
> snipped
> Let's say there are 5 tests, I get 5 rows, I'm not super excited by
> that, but I'm also not coming up with a way to change it.
> So is there a way to do this?
>
I don't completely understand what you're looking for. You say you want
to return the student's information with a list of tests they've taken.
You then say that if there are five tests, you get back five records,
which is not what you want. If a student has taken five tests, and you
want a list of the tests that student has taken, why would you not want
five records returned?|||It seems that a cross-tab report presentation is what is desired. It should
happen at the client -or investigate SQL Reporting Services.
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:OA3IfGVlGHA.4772@.TK2MSFTNGP03.phx.gbl...
> jwsolt@.gmail.com wrote:
> I don't completely understand what you're looking for. You say you want
> to return the student's information with a list of tests they've taken.
> You then say that if there are five tests, you get back five records,
> which is not what you want. If a student has taken five tests, and you
> want a list of the tests that student has taken, why would you not want
> five records returned?|||> I don't completely understand what you're looking for. You say you want
> to return the student's information with a list of tests they've taken.
> You then say that if there are five tests, you get back five records,
> which is not what you want. If a student has taken five tests, and you
> want a list of the tests that student has taken, why would you not want
> five records returned?
They want a pivot table of sorts.
e.g. Student Test 1 Test 2 Test 3 Test 4 Test 5
a 90 72 NULL 54 99
b NULL NULL NULL NULL 71
The problem is that SQL does not lend itself to figuring out how far across
you have to go. This kind of data shaping is definitely better for
client-side reporting tools.
http://www.aspfaq.com/2462|||Aaron Bertrand [SQL Server MVP] wrote:
> They want a pivot table of sorts.
> e.g. Student Test 1 Test 2 Test 3 Test 4 Test 5
> a 90 72 NULL 54 99
> b NULL NULL NULL NULL 71
> The problem is that SQL does not lend itself to figuring out how far acros
s
> you have to go. This kind of data shaping is definitely better for
> client-side reporting tools.
> http://www.aspfaq.com/2462
>
Ahhh, I get it now. His use of the phrase "list of tests" threw me...|||Personally I think his sales have been in decline for sometime and he tries
to drum up sales by being so abusive and ignorant - loudest voice gets
noticed and all that; if only he realised what a fool he has made of
himself.
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Gary Gibbs" <ggibbs@.aahs.org> wrote in message
news:1150903867.254646.88710@.u72g2000cwu.googlegroups.com...
> There are users of this group who have varying degrees of expertise.
> If these questions bother you so much - STOP RESPONDING!!!! Aren't you
> afraid that by being so abusive you are going to hurt your book sales?
> --CELKO-- wrote:
>sql

Wednesday, March 21, 2012

many inserts results in a massive reserved space for table

Hi,
I've got a real problem inserting approx 1,000,000 rows of data into
some SQL server 2000 tables. The data is being inserted 1 row at a
time using a T-sql cursor. When I view the table size using
sp_spaceused I get the following type of results:
reserved = 27021280 KB
data = 3376216 KB
Unused = 23642952
why is the reserved space sooooo much more than the actual amount of
data in the table?
The table cannot be fragmented as this is the first data which has
been inserted into it.
I cannot use a different insert method (like DTS) as logic needs to be
applied to the data before it is inserted.
Is there any way round this?
Shrinking the tables after the event is also not an option, as I would
run out of disk space way before all of the tables are populated.Out-of-date space usage info? Have you tried DBCC UPDATEUSAGE?
Also, what indexes do you have on the table. This along with the data distribution of the data you
are inserting will determine the level of fragmentation you get when you perform your inserts. Did
you check fragmentation level using DBCC SHOWCONTIG?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jackie" <jackiesmith_3@.hotmail.com> wrote in message
news:6cb5ab33.0410040640.4e8dc430@.posting.google.com...
> Hi,
> I've got a real problem inserting approx 1,000,000 rows of data into
> some SQL server 2000 tables. The data is being inserted 1 row at a
> time using a T-sql cursor. When I view the table size using
> sp_spaceused I get the following type of results:
> reserved = 27021280 KB
> data = 3376216 KB
> Unused = 23642952
> why is the reserved space sooooo much more than the actual amount of
> data in the table?
> The table cannot be fragmented as this is the first data which has
> been inserted into it.
> I cannot use a different insert method (like DTS) as logic needs to be
> applied to the data before it is inserted.
> Is there any way round this?
> Shrinking the tables after the event is also not an option, as I would
> run out of disk space way before all of the tables are populated.|||Thanks for your advice, I am new to SQL server so had not heard of
these procedures before...
DBCC UPDATEUSAGE - has no effect.
When I do DBCC SHOWCONTIG it shows that the table is MASSIVELY
fragmented (at least I think that's what it's saying) - results:
- Pages Scanned........................: 429774
- Extents Scanned.......................: 429755
- Extent Switches.......................: 429754
- Avg. Pages per Extent..................: 1.0
- Scan Density [Best Count:Actual Count]......: 12.50% [53722:429755]
- Extent Scan Fragmentation ...............: 98.13%
- Avg. Bytes Free per Page................: 7712.6
- Avg. Page Density (full)................: 4.71%
There are no indexes on the table at all (I am trying this routine on
a test database before running it elsewhere and I assumed that leaving
off the indexes would increase the rate of the inserts) - are you
suggesting that if I had the indexes on the table it would reduce the
fragmentation as the data is inserted?
you say "This along with the data distribution of the data you are
inserting", but how can I control where the data is physically written
to? (and therefore control the fragmentation)
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message news:<uRyrH1iqEHA.1992@.TK2MSFTNGP09.phx.gbl>...
> Out-of-date space usage info? Have you tried DBCC UPDATEUSAGE?
> Also, what indexes do you have on the table. This along with the data distribution of the data you
> are inserting will determine the level of fragmentation you get when you perform your inserts. Did
> you check fragmentation level using DBCC SHOWCONTIG?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jackie" <jackiesmith_3@.hotmail.com> wrote in message
> news:6cb5ab33.0410040640.4e8dc430@.posting.google.com...
> > Hi,
> >
> > I've got a real problem inserting approx 1,000,000 rows of data into
> > some SQL server 2000 tables. The data is being inserted 1 row at a
> > time using a T-sql cursor. When I view the table size using
> > sp_spaceused I get the following type of results:
> >
> > reserved = 27021280 KB
> > data = 3376216 KB
> > Unused = 23642952
> >
> > why is the reserved space sooooo much more than the actual amount of
> > data in the table?
> > The table cannot be fragmented as this is the first data which has
> > been inserted into it.
> >
> > I cannot use a different insert method (like DTS) as logic needs to be
> > applied to the data before it is inserted.
> >
> > Is there any way round this?
> >
> > Shrinking the tables after the event is also not an option, as I would
> > run out of disk space way before all of the tables are populated.|||The pages seems indeed very empty, on average. To say anything more conclusive, we would need the
table layout and what indexes you have on the table. You say no indexes, but that means they you
didn't define a primary key (or unique constraint). This is not recommended! Sp_helpindex will list
the indexes you have on the table.
In general every table should have a clustered index. Which column(s) you define in the clustered
index is based on both the data distribution and your queries. It is likely that you will have less
"emptiness" in the pages with a proper clustered index.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jackie" <jackiesmith_3@.hotmail.com> wrote in message
news:6cb5ab33.0410050059.7bbdb78f@.posting.google.com...
> Thanks for your advice, I am new to SQL server so had not heard of
> these procedures before...
> DBCC UPDATEUSAGE - has no effect.
> When I do DBCC SHOWCONTIG it shows that the table is MASSIVELY
> fragmented (at least I think that's what it's saying) - results:
> - Pages Scanned........................: 429774
> - Extents Scanned.......................: 429755
> - Extent Switches.......................: 429754
> - Avg. Pages per Extent..................: 1.0
> - Scan Density [Best Count:Actual Count]......: 12.50% [53722:429755]
> - Extent Scan Fragmentation ...............: 98.13%
> - Avg. Bytes Free per Page................: 7712.6
> - Avg. Page Density (full)................: 4.71%
> There are no indexes on the table at all (I am trying this routine on
> a test database before running it elsewhere and I assumed that leaving
> off the indexes would increase the rate of the inserts) - are you
> suggesting that if I had the indexes on the table it would reduce the
> fragmentation as the data is inserted?
> you say "This along with the data distribution of the data you are
> inserting", but how can I control where the data is physically written
> to? (and therefore control the fragmentation)
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:<uRyrH1iqEHA.1992@.TK2MSFTNGP09.phx.gbl>...
>> Out-of-date space usage info? Have you tried DBCC UPDATEUSAGE?
>> Also, what indexes do you have on the table. This along with the data distribution of the data
>> you
>> are inserting will determine the level of fragmentation you get when you perform your inserts.
>> Did
>> you check fragmentation level using DBCC SHOWCONTIG?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "Jackie" <jackiesmith_3@.hotmail.com> wrote in message
>> news:6cb5ab33.0410040640.4e8dc430@.posting.google.com...
>> > Hi,
>> >
>> > I've got a real problem inserting approx 1,000,000 rows of data into
>> > some SQL server 2000 tables. The data is being inserted 1 row at a
>> > time using a T-sql cursor. When I view the table size using
>> > sp_spaceused I get the following type of results:
>> >
>> > reserved = 27021280 KB
>> > data = 3376216 KB
>> > Unused = 23642952
>> >
>> > why is the reserved space sooooo much more than the actual amount of
>> > data in the table?
>> > The table cannot be fragmented as this is the first data which has
>> > been inserted into it.
>> >
>> > I cannot use a different insert method (like DTS) as logic needs to be
>> > applied to the data before it is inserted.
>> >
>> > Is there any way round this?
>> >
>> > Shrinking the tables after the event is also not an option, as I would
>> > run out of disk space way before all of the tables are populated.|||Well, I don't understand at all!!
It was true that the tables did not have indexes or primary keys on -
this was simply because I was running a test and I thought it would
run more quickly - again my not understanding SQL Server properly (not
because I think it's a good idea in terms of design!).
After your latest message - here's what I did (sorry if this is
longwinded).
I loaded the indexes / PKs onto the relevent tables - although I
notice there are no clustered indexes on any of the 5 tables which I
am inserting data into - please bear in mind though that I have no
influence over the design of the database...
I re-ran my routine against THE SAME SET OF DATA - this time the data
loaded in a 100th of the time, and took up approx 350Mb per table!!
(prior to this the tables had 27Gb of reserved space, with maybe 3.5Gb
of data) - HOW CAN THIS BE SO DIFFERENT? (total size of database was
61Gb and now is 3Gb !!)
So, then I tried to run my same routine loading data into a different
database on a different server which already had the indexes on (same
data model). This server only had 12Gb of free space (the total data
in my first db took up 1.9Gb). Afetr a very short space of time the
database ran out of disk space after only a fraction of the data had
been inserted. Looking at SP_SPACEUSED, the reserved space was way out
of sync with the data figure as before.
I ran DBCC UPDATEUSAGE, truncated the 5 tables and re-ran my routine,
now the data is inserting happily and is taking up 353Mb per table
again!
I have no more servers to play with!!
Is the data "behaving properly" the 2nd time around simply because it
is the 2nd time the same routine has been run?
Or is the fact that each time I have run DBCC UPDATEUSAGE relevent?
Surely there must be a way of achieving the proper data figures during
the first time this routine is run (I clearly can't keep running the
same routines and running out of disk space when I come to run this
against production databases).
For reference - here is an example of one of the tables I am inserting
data into (results from sp_help) -
BookingPayment dbo user table 2004-08-24 11:48:44.210
BooRefNo int no 4 10 0 no (n/a) (n/a) NULL
PayID int no 4 10 0 no (n/a) (n/a) NULL
BpyDate datetime no 8 no (n/a) (n/a) NULL
BpyAmount money no 8 19 4 no (n/a) (n/a) NULL
BpyTzoName varchar no 3
yes no no SQL_Latin1_General_CP1_CI_AS
BpyDateUTC datetime no 8 yes (n/a) (n/a) NULL
BpyPayAmount money no 8 19 4 yes (n/a) (n/a) NULL
BpyExrRate float no 8 53 NULL yes (n/a) (n/a) NULL
WrkID varchar no 20 yes no no SQL_Latin1_General_CP1_CI_AS
UseID varchar no 20 yes no no SQL_Latin1_General_CP1_CI_AS
BpyCreatedWkgID varchar no 3
yes no no SQL_Latin1_General_CP1_CI_AS
BpyCreatedUgrID varchar no 3
yes no no SQL_Latin1_General_CP1_CI_AS
BpyCreatedProID varchar no 5
yes no no SQL_Latin1_General_CP1_CI_AS
BpyCreatedPrgID varchar no 3
yes no no SQL_Latin1_General_CP1_CI_AS
BpyInvStatus tinyint no 1 3 0 yes (n/a) (n/a) NULL
PaymentKey nonclustered, unique located on PRIMARY PayID, BooRefNo
PK___3__21 nonclustered, unique, primary key located on
PRIMARY BooRefNo, PayID, BpyDate
PRIMARY KEY (non-clustered) PK___3__21 (n/a) (n/a) (n/a) (n/a) BooRefNo,
PayID, BpyDate
there is a difference in 27Gb (!!!) in total space used between the
1st and 2nd times I insert data into this table...

Saturday, February 25, 2012

Managing a large row size

I have an app that requires 125 columns whcih blows away the 8060 byte
limit.
(It's a decision support app, and I've alreay broken out four subordinate
tables to fullfill a one-to-many need...but the 125 DO belong together.)
I need to split it into a minimum of three tables.
Is there sample code that would show how to keep these three tables in sync
when doing INS, UPDT, and DEL, including transactions?
Kyle!Try create a view based on the three tables and instead of trigger when
insert and update
"Kyle Jedrusiak" <kyle.jedrusiak@.princetoninformation.com> wrote in message
news:OuH9DOLQDHA.3768@.tk2msftngp13.phx.gbl...
> I have an app that requires 125 columns whcih blows away the 8060 byte
> limit.
> (It's a decision support app, and I've alreay broken out four subordinate
> tables to fullfill a one-to-many need...but the 125 DO belong together.)
> I need to split it into a minimum of three tables.
> Is there sample code that would show how to keep these three tables in
sync
> when doing INS, UPDT, and DEL, including transactions?
> Kyle!
>