I am an Access user.
In Access when I create a relationship between 2 tables is use
Enforce Referential Integrity
Cascade Update Related Fields
Cascade Delete Related Records
If I change data in Primary Table is Update automaticaly in Foreign table.
I use a MSDE database, and I create 2 tabele
Table 1 - with a primary key (AUT_ID)
Table 2 (Foreign table) with 2 fields
Field :AUT_ID
Field: Field1
I use Access interfaces (adp Database) and I create a Diagram
Primary key table: Table_1; Field: AUT_ID
Foreign table: Table_2; Field: AUT_ID
PROBLEM: If I change data in Table_1 (field AUT_ID) data is not change in Table_2 and error occurs.[i]
PROBLEM: If I change data in Table_1 (field AUT_ID) data is not change in Table_2 and error occurs.
I see nothing that requests any sort of cascading-update.
Furthermore, Table_2 is clearly the master-table of the relationship and Table_1 the subordinate. Thus a change to Table_1 to introduce a key not in Table_2 would be disallowed, as you see.|||Is a version problem if I understud corectly
SQL vers.7 did not suport ON UPDATE NO ACTION / CASCADE
SQL vers.8 (suport ON UPDATE NO ACTION / CASCADE)
I installed vers.8 and everything is OK.
Thanks.
Showing posts with label update. Show all posts
Showing posts with label update. Show all posts
Friday, March 30, 2012
Relationships on MSDE
Labels:
access,
create,
database,
enforce,
fieldscascade,
integritycascade,
microsoft,
msde,
mysql,
oracle,
referential,
related,
relationship,
relationships,
server,
sql,
tables,
update,
user
Monday, March 26, 2012
Relation to dbid in sysdatabases
What if i update a dbid from 14 to 24 say for example, is there a reference
to it in any system tables in the corresponding user database itself that i
would also need to update. Just curious.
Will the db go into suspect mode or will it just continue to function as
normal ?I don't think there are references in the database itself to the dbid, but
there are plenty of references in master to the database id, including in
sysxlogins, which you also asked about. Some of the tables are
pseudo-tables, so they would probably be fine, but many are real tables what
could be corrupted if you updated a dbid.
I have never done this, so I can't tell you for sure what might break.
This query will show you all the columns in tables in master that reference
dbid:
use master
select name, object_name(id), objectproperty(id, 'tableisfake') from
syscolumns where name = 'dbid'
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:ORSqfECdDHA.372@.TK2MSFTNGP11.phx.gbl...
> What if i update a dbid from 14 to 24 say for example, is there a
reference
> to it in any system tables in the corresponding user database itself that
i
> would also need to update. Just curious.
> Will the db go into suspect mode or will it just continue to function as
> normal ?
>|||Hi Hassan,
I've never tried this, a lot of the system uses the database name as it's
key, so maybe you would get away without breaking too much
......but any update to system tables is unsupported..........
Why would you want to do this ?
Regards,
Clive Challinor [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
to it in any system tables in the corresponding user database itself that i
would also need to update. Just curious.
Will the db go into suspect mode or will it just continue to function as
normal ?I don't think there are references in the database itself to the dbid, but
there are plenty of references in master to the database id, including in
sysxlogins, which you also asked about. Some of the tables are
pseudo-tables, so they would probably be fine, but many are real tables what
could be corrupted if you updated a dbid.
I have never done this, so I can't tell you for sure what might break.
This query will show you all the columns in tables in master that reference
dbid:
use master
select name, object_name(id), objectproperty(id, 'tableisfake') from
syscolumns where name = 'dbid'
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:ORSqfECdDHA.372@.TK2MSFTNGP11.phx.gbl...
> What if i update a dbid from 14 to 24 say for example, is there a
reference
> to it in any system tables in the corresponding user database itself that
i
> would also need to update. Just curious.
> Will the db go into suspect mode or will it just continue to function as
> normal ?
>|||Hi Hassan,
I've never tried this, a lot of the system uses the database name as it's
key, so maybe you would get away without breaking too much
......but any update to system tables is unsupported..........
Why would you want to do this ?
Regards,
Clive Challinor [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
Friday, March 23, 2012
Relace function of mysql
Hi,
Want to know that is their any option of inserting a record if the record does not exist in the table..while firing update query.
In mysql, we have replace which updates or inserts the record.
do let me know
thanx,
vivek.No SQL Server does not have a command like that. In my case all of my commands are done within a stored procedure, so I first check to see if the record exists, if yes then UPDATE else INSERT.
IF EXISTS (SELECT * FROM myTable WHERE pkey = @.pkey) BEGIN
UPDATE myTable
.
.
.
.
END ELSE
INSERT myTable
.
.
.
.
END|||Thanx,
will surely try with Stored procs.
regards,
vivek.
Want to know that is their any option of inserting a record if the record does not exist in the table..while firing update query.
In mysql, we have replace which updates or inserts the record.
do let me know
thanx,
vivek.No SQL Server does not have a command like that. In my case all of my commands are done within a stored procedure, so I first check to see if the record exists, if yes then UPDATE else INSERT.
IF EXISTS (SELECT * FROM myTable WHERE pkey = @.pkey) BEGIN
UPDATE myTable
.
.
.
.
END ELSE
INSERT myTable
.
.
.
.
END|||Thanx,
will surely try with Stored procs.
regards,
vivek.
Friday, March 9, 2012
reindex or update stat
Hi,
I have a database that will have couple thousands row inserted normally, but
there will be 3 or 4 days in a year that will have 20000 row inserted daily
. I set up the Maintenance Plan to have Optimizations to reorganize the data
and index, and it runs onc
e a week. During that busy week how can I imporve the performance? ThanksJen,
20,000 rows is really not all that many and will most likely not cause a
change in the way the queries are run. It's possible but not enough to get
excited about. The once a week will most likely be fine.
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> Hi,
> I have a database that will have couple thousands row inserted normally,
but there will be 3 or 4 days in a year that will have 20000 row inserted
daily. I set up the Maintenance Plan to have Optimizations to reorganize the
data and index, and it runs once a week. During that busy week how can I
imporve the performance? Thanks|||Thanks. In the past we did experience some problem in that few days. actuall
y it's about 60,000 in one table, and every record in this table will be dou
bled in another table, that is 120,000. How much will be the red line?
-- Andrew J. Kelly wrote: --
Jen,
20,000 rows is really not all that many and will most likely not cause a
change in the way the queries are run. It's possible but not enough to get
excited about. The once a week will most likely be fine.
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> Hi,
> I have a database that will have couple thousands row inserted normally,
but there will be 3 or 4 days in a year that will have 20000 row inserted
daily. I set up the Maintenance Plan to have Optimizations to reorganize the
data and index, and it runs once a week. During that busy week how can I
imporve the performance? Thanks|||That's imposable to tell without a breakdown of the data. Essentially if
the selectivity of the new data is about the same as the existing data it
will most likely not be any different. If it is drastically different there
may be some changes in the plans. But in either case if you have auto
update statistics turned on sql server should deal with it appropriately.
If not or you just don't want to leave it to chance you can simply issue an
update stats when your done with the import. If the data being imported is
going to cause a lot of page splits you may just want to reindex afterwards.
The number of rows is not the main deciding factor in if it will affect
performance. It's more the type of data, the schema and the way it is
imported.
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:DF02E261-55FC-4AB1-A170-FE1B51128260@.microsoft.com...
> Thanks. In the past we did experience some problem in that few days.
actually it's about 60,000 in one table, and every record in this table will
be doubled in another table, that is 120,000. How much will be the red line?
> -- Andrew J. Kelly wrote: --
> Jen,
> 20,000 rows is really not all that many and will most likely not
cause a
> change in the way the queries are run. It's possible but not enough
to get
> excited about. The once a week will most likely be fine.
> --
> Andrew J. Kelly
> SQL Server MVP
>
> "Jen" <anonymous@.discussions.microsoft.com> wrote in message
> news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
normally,
> but there will be 3 or 4 days in a year that will have 20000 row
inserted
> daily. I set up the Maintenance Plan to have Optimizations to
reorganize the
> data and index, and it runs once a week. During that busy week how
can I
> imporve the performance? Thanks
>
>
I have a database that will have couple thousands row inserted normally, but
there will be 3 or 4 days in a year that will have 20000 row inserted daily
. I set up the Maintenance Plan to have Optimizations to reorganize the data
and index, and it runs onc
e a week. During that busy week how can I imporve the performance? ThanksJen,
20,000 rows is really not all that many and will most likely not cause a
change in the way the queries are run. It's possible but not enough to get
excited about. The once a week will most likely be fine.
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> Hi,
> I have a database that will have couple thousands row inserted normally,
but there will be 3 or 4 days in a year that will have 20000 row inserted
daily. I set up the Maintenance Plan to have Optimizations to reorganize the
data and index, and it runs once a week. During that busy week how can I
imporve the performance? Thanks|||Thanks. In the past we did experience some problem in that few days. actuall
y it's about 60,000 in one table, and every record in this table will be dou
bled in another table, that is 120,000. How much will be the red line?
-- Andrew J. Kelly wrote: --
Jen,
20,000 rows is really not all that many and will most likely not cause a
change in the way the queries are run. It's possible but not enough to get
excited about. The once a week will most likely be fine.
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> Hi,
> I have a database that will have couple thousands row inserted normally,
but there will be 3 or 4 days in a year that will have 20000 row inserted
daily. I set up the Maintenance Plan to have Optimizations to reorganize the
data and index, and it runs once a week. During that busy week how can I
imporve the performance? Thanks|||That's imposable to tell without a breakdown of the data. Essentially if
the selectivity of the new data is about the same as the existing data it
will most likely not be any different. If it is drastically different there
may be some changes in the plans. But in either case if you have auto
update statistics turned on sql server should deal with it appropriately.
If not or you just don't want to leave it to chance you can simply issue an
update stats when your done with the import. If the data being imported is
going to cause a lot of page splits you may just want to reindex afterwards.
The number of rows is not the main deciding factor in if it will affect
performance. It's more the type of data, the schema and the way it is
imported.
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:DF02E261-55FC-4AB1-A170-FE1B51128260@.microsoft.com...
> Thanks. In the past we did experience some problem in that few days.
actually it's about 60,000 in one table, and every record in this table will
be doubled in another table, that is 120,000. How much will be the red line?
> -- Andrew J. Kelly wrote: --
> Jen,
> 20,000 rows is really not all that many and will most likely not
cause a
> change in the way the queries are run. It's possible but not enough
to get
> excited about. The once a week will most likely be fine.
> --
> Andrew J. Kelly
> SQL Server MVP
>
> "Jen" <anonymous@.discussions.microsoft.com> wrote in message
> news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
normally,
> but there will be 3 or 4 days in a year that will have 20000 row
inserted
> daily. I set up the Maintenance Plan to have Optimizations to
reorganize the
> data and index, and it runs once a week. During that busy week how
can I
> imporve the performance? Thanks
>
>
reindex or update stat
Hi
I have a database that will have couple thousands row inserted normally, but there will be 3 or 4 days in a year that will have 20000 row inserted daily. I set up the Maintenance Plan to have Optimizations to reorganize the data and index, and it runs once a week. During that busy week how can I imporve the performance? ThanksJen,
20,000 rows is really not all that many and will most likely not cause a
change in the way the queries are run. It's possible but not enough to get
excited about. The once a week will most likely be fine.
--
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> Hi,
> I have a database that will have couple thousands row inserted normally,
but there will be 3 or 4 days in a year that will have 20000 row inserted
daily. I set up the Maintenance Plan to have Optimizations to reorganize the
data and index, and it runs once a week. During that busy week how can I
imporve the performance? Thanks|||Thanks. In the past we did experience some problem in that few days. actually it's about 60,000 in one table, and every record in this table will be doubled in another table, that is 120,000. How much will be the red line?
-- Andrew J. Kelly wrote: --
Jen
20,000 rows is really not all that many and will most likely not cause
change in the way the queries are run. It's possible but not enough to ge
excited about. The once a week will most likely be fine
--
Andrew J. Kell
SQL Server MV
"Jen" <anonymous@.discussions.microsoft.com> wrote in messag
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com..
> Hi
> I have a database that will have couple thousands row inserted normally
but there will be 3 or 4 days in a year that will have 20000 row inserte
daily. I set up the Maintenance Plan to have Optimizations to reorganize th
data and index, and it runs once a week. During that busy week how can
imporve the performance? Thank|||That's imposable to tell without a breakdown of the data. Essentially if
the selectivity of the new data is about the same as the existing data it
will most likely not be any different. If it is drastically different there
may be some changes in the plans. But in either case if you have auto
update statistics turned on sql server should deal with it appropriately.
If not or you just don't want to leave it to chance you can simply issue an
update stats when your done with the import. If the data being imported is
going to cause a lot of page splits you may just want to reindex afterwards.
The number of rows is not the main deciding factor in if it will affect
performance. It's more the type of data, the schema and the way it is
imported.
--
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:DF02E261-55FC-4AB1-A170-FE1B51128260@.microsoft.com...
> Thanks. In the past we did experience some problem in that few days.
actually it's about 60,000 in one table, and every record in this table will
be doubled in another table, that is 120,000. How much will be the red line?
> -- Andrew J. Kelly wrote: --
> Jen,
> 20,000 rows is really not all that many and will most likely not
cause a
> change in the way the queries are run. It's possible but not enough
to get
> excited about. The once a week will most likely be fine.
> --
> Andrew J. Kelly
> SQL Server MVP
>
> "Jen" <anonymous@.discussions.microsoft.com> wrote in message
> news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> > Hi,
> > I have a database that will have couple thousands row inserted
normally,
> but there will be 3 or 4 days in a year that will have 20000 row
inserted
> daily. I set up the Maintenance Plan to have Optimizations to
reorganize the
> data and index, and it runs once a week. During that busy week how
can I
> imporve the performance? Thanks
>
>
I have a database that will have couple thousands row inserted normally, but there will be 3 or 4 days in a year that will have 20000 row inserted daily. I set up the Maintenance Plan to have Optimizations to reorganize the data and index, and it runs once a week. During that busy week how can I imporve the performance? ThanksJen,
20,000 rows is really not all that many and will most likely not cause a
change in the way the queries are run. It's possible but not enough to get
excited about. The once a week will most likely be fine.
--
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> Hi,
> I have a database that will have couple thousands row inserted normally,
but there will be 3 or 4 days in a year that will have 20000 row inserted
daily. I set up the Maintenance Plan to have Optimizations to reorganize the
data and index, and it runs once a week. During that busy week how can I
imporve the performance? Thanks|||Thanks. In the past we did experience some problem in that few days. actually it's about 60,000 in one table, and every record in this table will be doubled in another table, that is 120,000. How much will be the red line?
-- Andrew J. Kelly wrote: --
Jen
20,000 rows is really not all that many and will most likely not cause
change in the way the queries are run. It's possible but not enough to ge
excited about. The once a week will most likely be fine
--
Andrew J. Kell
SQL Server MV
"Jen" <anonymous@.discussions.microsoft.com> wrote in messag
news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com..
> Hi
> I have a database that will have couple thousands row inserted normally
but there will be 3 or 4 days in a year that will have 20000 row inserte
daily. I set up the Maintenance Plan to have Optimizations to reorganize th
data and index, and it runs once a week. During that busy week how can
imporve the performance? Thank|||That's imposable to tell without a breakdown of the data. Essentially if
the selectivity of the new data is about the same as the existing data it
will most likely not be any different. If it is drastically different there
may be some changes in the plans. But in either case if you have auto
update statistics turned on sql server should deal with it appropriately.
If not or you just don't want to leave it to chance you can simply issue an
update stats when your done with the import. If the data being imported is
going to cause a lot of page splits you may just want to reindex afterwards.
The number of rows is not the main deciding factor in if it will affect
performance. It's more the type of data, the schema and the way it is
imported.
--
Andrew J. Kelly
SQL Server MVP
"Jen" <anonymous@.discussions.microsoft.com> wrote in message
news:DF02E261-55FC-4AB1-A170-FE1B51128260@.microsoft.com...
> Thanks. In the past we did experience some problem in that few days.
actually it's about 60,000 in one table, and every record in this table will
be doubled in another table, that is 120,000. How much will be the red line?
> -- Andrew J. Kelly wrote: --
> Jen,
> 20,000 rows is really not all that many and will most likely not
cause a
> change in the way the queries are run. It's possible but not enough
to get
> excited about. The once a week will most likely be fine.
> --
> Andrew J. Kelly
> SQL Server MVP
>
> "Jen" <anonymous@.discussions.microsoft.com> wrote in message
> news:1FB99858-33E7-43A8-A561-51BD048C53F6@.microsoft.com...
> > Hi,
> > I have a database that will have couple thousands row inserted
normally,
> but there will be 3 or 4 days in a year that will have 20000 row
inserted
> daily. I set up the Maintenance Plan to have Optimizations to
reorganize the
> data and index, and it runs once a week. During that busy week how
can I
> imporve the performance? Thanks
>
>
Monday, February 20, 2012
register hasnt been updated
hi,
i have a programmer problem. When i exec a update sql with odbc
drivers, in database i dont update register, but if i exec the execute
sql in manager, then i update the register. Someone knwos what is
happening?
thanks for answer.AKS (dagato2@.terra.es) writes:
> i have a programmer problem. When i exec a update sql with odbc
> drivers, in database i dont update register, but if i exec the execute
> sql in manager, then i update the register. Someone knwos what is
> happening?
i have a programmer problem. When i exec a update sql with odbc
drivers, in database i dont update register, but if i exec the execute
sql in manager, then i update the register. Someone knwos what is
happening?
thanks for answer.AKS (dagato2@.terra.es) writes:
> i have a programmer problem. When i exec a update sql with odbc
> drivers, in database i dont update register, but if i exec the execute
> sql in manager, then i update the register. Someone knwos what is
> happening?
Eh, no. I'm not sure that I understand. Is "register" a table, or do
you mean the registry?
If you are working with code, could you supply an example?
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Labels:
database,
exec,
executesql,
hasnt,
microsoft,
mysql,
odbcdrivers,
oracle,
programmer,
register,
server,
sql,
update,
updated
Subscribe to:
Posts (Atom)