Showing posts with label update. Show all posts
Showing posts with label update. Show all posts

Friday, March 23, 2012

external access denied to update a config file

Hello,

I'm having an issue with a CLR Stored procedure. Everything works great in a 32 bit environment, I have a CLR SP that updates an xml file stored on a local drive. When I execute the Stored proc it does go and update what I want it to in a 32 bit system. When I run the CLR SP on a 64 bit cluster, I seem to have give the "everyone" group write permissions to my G: drive (which is where the file is located that I'm updating). What security context is this SP running under? I thought it would be either under the SQL Service account (which is a domain user in the local administrators group) or what I'm logged in as when I run it from Management Studio (which is a domain admin, also in the local administrators group). If I have given the local administrators group "Full Control" access to the G: drive, why isn't this enough? Why do I have to give the Everyone group write access?

The security context seems odd to me, it seems like it's not running as either one of those 2 users I mentioned, because if it was, then it should be able to update the xml file.

Any help appreciated. Here's the error I'm getting:

Msg 6522, Level 16, State 1, Procedure usp_XMLWriter, Line 0

A .NET Framework error occurred during execution of user defined routine or aggregate 'usp_XMLWriter':

System.UnauthorizedAccessException: Access to the path 'g:\ssisPackages\BuildCalendar\andy.dtsConfig' is denied.

System.UnauthorizedAccessException:

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

at System.Xml.XmlTextWriter..ctor(String filename, Encoding encoding)

at System.Xml.XmlDocument.Save(String filename)

at XMLWriter.StoredProcedures.usp_XMLWriter(String xmlDocPath, String xmlNodePath, String xmlInnerText)

.

I found out that I'm able to get this to work if I put the SQL Service User account directly into the security of the G: Drive. For some reason, even though the user is in the Local Administrators group, it doesn't seem to pick up the fact that my user in is in the group, and therefore won't let him update a file in the folder.

Does anyone know of any issues in a 64 bit cluster where a CLR Stored proc isn't able to decipher the users in a local Group?

|||This turned out to be a cluster issue. We weren't doing permissions through the cluster, we were doing permissions to the file shares through each node, which is a mistake in a cluster.

Extension- Urgent Help Required - Recovery

I have actually extended my request

I have a scenario like this......

update esan set tes_address_city = 'TEST1' --at some time
update esan set tes_address_city = 'TEST12' --at some time
update esan set tes_address_city = 'TEST123' --at some time

backup database TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS.db'
backup log TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS01.log'

I take these backups at the end of day...
Now i want to recover till the second update ie 'TEST12'...
Assumptions to be made:-
I dont know the timing of the updates.
I am allowed to take back only once.
We can also assume to have a backup of the previous day also.

Is this possible and how can i do it......
Please help me ...and urgent also......

Thanks in advance
RVG

Extension is here
Suppose that ou database is crashing at 2.30 and i run the restore

RESTORE DATABASE TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS.DB'
with norecovery --Prev day log
RESTORE LOG TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS01.log'
with norecovery
RESTORE LOG TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS02.log'
with recovery, STOPAT = '2003-08-26 16:37:45.870'

i get message like this
This log file contains records logged before the designated
point-in-time. The database is being left in load state so you can
apply another log file.
RESTORE LOG successfully processed 0 pages in 0.389 seconds (0.000
MB/sec).

Now when i try to run a
Select * i get message lke

Server: Msg 927, Level 14, State 2, Line 1
Database 'TESTWMS' cannot be opened. It is in the middle of a restore.

How do i solve this problem. One way is to use a NO_TRUNCATE with a
backup in between (ie incase of database corruption).
But i dont want to use a log backup once again. I should be able to
solve it without using a log backup once again. In shot backup only
once a day. Aslo i need to refer to a database to that particular
point of time from my backup.

Thanks in advance
RVG"Rajesh Garg" <raj_chins@.rediffmail.com> wrote in message
news:14215add.0308260318.26e7c24b@.posting.google.c om...
> I have actually extended my request
> I have a scenario like this......
> update esan set tes_address_city = 'TEST1' --at some time
> update esan set tes_address_city = 'TEST12' --at some time
> update esan set tes_address_city = 'TEST123' --at some time
> backup database TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS.db'
> backup log TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS01.log'
> I take these backups at the end of day...
> Now i want to recover till the second update ie 'TEST12'...
> Assumptions to be made:-
> I dont know the timing of the updates.
> I am allowed to take back only once.
> We can also assume to have a backup of the previous day also.
>
> Is this possible and how can i do it......
> Please help me ...and urgent also......
> Thanks in advance
> RVG
> Extension is here
> Suppose that ou database is crashing at 2.30 and i run the restore
> RESTORE DATABASE TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS.DB'
> with norecovery --Prev day log
> RESTORE LOG TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS01.log'
> with norecovery
> RESTORE LOG TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS02.log'
> with recovery, STOPAT = '2003-08-26 16:37:45.870'
> i get message like this
> This log file contains records logged before the designated
> point-in-time. The database is being left in load state so you can
> apply another log file.
> RESTORE LOG successfully processed 0 pages in 0.389 seconds (0.000
> MB/sec).

From BOL :-

If you specify a STOPAT time that is beyond the end of the RESTORE LOG
operation, the database is left in an unrecovered state, just as if RESTORE
LOG had been run with NORECOVERY

So it looks like you haven't got the right log file with the transactions
you want.

> Now when i try to run a
> Select * i get message lke
> Server: Msg 927, Level 14, State 2, Line 1
> Database 'TESTWMS' cannot be opened. It is in the middle of a restore.

To make the database usable you would need to run :-

RESTORE DATABASE TESTWMS with recovery

Though it looks like you haven't got to the point you want yet.

Ian.|||Hi IAN thanks for prompt help ...
I will make it simpler to look...

I have DB1 - as backup for day 1
LOg1 as backup of logs

T1 T2 T3 T4 T5 ...some transaction on day 2

Now i backup again
DB2
Log2

I want to restore the database till the point of transaction T3 say. I
know the time or i assume a certain time.
Is this possible ....i tried several options but hand in between for
some reason or the other. How can i achieve my solution. Is there some
extra parameter i will require or what...i am wondering now that it
is not at all possible. Please help.
RVG

"Ian Stocks" <nospam@.testbox2.co.uk> wrote in message news:<3f4b813e$0$329$bed64819@.pubnews.gradwell.net>...
> "Rajesh Garg" <raj_chins@.rediffmail.com> wrote in message
> news:14215add.0308260318.26e7c24b@.posting.google.c om...
> > I have actually extended my request
> > I have a scenario like this......
> > update esan set tes_address_city = 'TEST1' --at some time
> > update esan set tes_address_city = 'TEST12' --at some time
> > update esan set tes_address_city = 'TEST123' --at some time
> > backup database TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS.db'
> > backup log TESTWMS to disk = 'D:\temp\RecoveryTest\TESTWMS01.log'
> > I take these backups at the end of day...
> > Now i want to recover till the second update ie 'TEST12'...
> > Assumptions to be made:-
> > I dont know the timing of the updates.
> > I am allowed to take back only once.
> > We can also assume to have a backup of the previous day also.
> > Is this possible and how can i do it......
> > Please help me ...and urgent also......
> > Thanks in advance
> > RVG
> > Extension is here
> > Suppose that ou database is crashing at 2.30 and i run the restore
> > RESTORE DATABASE TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS.DB'
> > with norecovery --Prev day log
> > RESTORE LOG TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS01.log'
> > with norecovery
> > RESTORE LOG TESTWMS FROM DISK='D:\temp\RecoveryTest\TESTWMS02.log'
> > with recovery, STOPAT = '2003-08-26 16:37:45.870'
> > i get message like this
> > This log file contains records logged before the designated
> > point-in-time. The database is being left in load state so you can
> > apply another log file.
> > RESTORE LOG successfully processed 0 pages in 0.389 seconds (0.000
> > MB/sec).
> From BOL :-
> If you specify a STOPAT time that is beyond the end of the RESTORE LOG
> operation, the database is left in an unrecovered state, just as if RESTORE
> LOG had been run with NORECOVERY
> So it looks like you haven't got the right log file with the transactions
> you want.
> > Now when i try to run a
> > Select * i get message lke
> > Server: Msg 927, Level 14, State 2, Line 1
> > Database 'TESTWMS' cannot be opened. It is in the middle of a restore.
> To make the database usable you would need to run :-
> RESTORE DATABASE TESTWMS with recovery
> Though it looks like you haven't got to the point you want yet.
> Ian.|||"Rajesh Garg" <raj_chins@.rediffmail.com> wrote in message
news:14215add.0308262006.2b60cde@.posting.google.co m...
> Hi IAN thanks for prompt help ...
> I will make it simpler to look...
> I have DB1 - as backup for day 1
> LOg1 as backup of logs
> T1 T2 T3 T4 T5 ...some transaction on day 2
> Now i backup again
> DB2
> Log2
> I want to restore the database till the point of transaction T3 say. I
> know the time or i assume a certain time.
> Is this possible ....i tried several options but hand in between for
> some reason or the other. How can i achieve my solution. Is there some
> extra parameter i will require or what...i am wondering now that it
> is not at all possible. Please help.

This is definately possible, try this for yourself :-

create database restore_test

create table changes (col1 varchar(128))

backup database restore_test to disk = 'c:\restore_test_1.bck'

backup log restore_test to disk = 'c:\restore_test_t1.bck'

insert into changes (col1) values ('insert 1')
select getdate()
waitfor delay '00:00:05'
insert into changes (col1) values ('insert 2')
select getdate() -- take a note of this time
waitfor delay '00:00:05'
insert into changes (col1) values ('insert 3')
select getdate()

select * from changes

backup database restore_test to disk = 'c:\restore_test_2.bck'

backup log restore_test to disk = 'c:\restore_test_t2.bck'

-- now restore to point in time
use master
restore database restore_test from disk = 'c:\restore_test_1.bck' with
norecovery

restore log restore_test from disk = 'c:\restore_test_t1.bck' with
norecovery

restore log restore_test from disk = 'c:\restore_test_t2.bck' with stopat =
'2003-08-27 10:43:20' -- this is the time just after 'insert 2'

select * from restore_test..changes -- 'insert 3' has not been included

Ian.|||Hey Ian that works and works good.
ACtually i too had come up with a solution but had some problems with
that. Just neede to discuss it over.
I just used no_truncate in my bakup logs.
The problem there was that sql was not able to free up the place used
as it does in normal case. ( i have though not tried whether it frees
the space in this case also but i assume it will). The solution u gave
to me looks better.
Thanks once again
Cheers
RVG

"Ian Stocks" <nospam@.testbox2.co.uk> wrote in message news:<3f4c7f7a$0$321$bed64819@.pubnews.gradwell.net>...
> "Rajesh Garg" <raj_chins@.rediffmail.com> wrote in message
> news:14215add.0308262006.2b60cde@.posting.google.co m...
> > Hi IAN thanks for prompt help ...
> > I will make it simpler to look...
> > I have DB1 - as backup for day 1
> > LOg1 as backup of logs
> > T1 T2 T3 T4 T5 ...some transaction on day 2
> > Now i backup again
> > DB2
> > Log2
> > I want to restore the database till the point of transaction T3 say. I
> > know the time or i assume a certain time.
> > Is this possible ....i tried several options but hand in between for
> > some reason or the other. How can i achieve my solution. Is there some
> > extra parameter i will require or what...i am wondering now that it
> > is not at all possible. Please help.
>
> This is definately possible, try this for yourself :-
> create database restore_test
> create table changes (col1 varchar(128))
> backup database restore_test to disk = 'c:\restore_test_1.bck'
> backup log restore_test to disk = 'c:\restore_test_t1.bck'
> insert into changes (col1) values ('insert 1')
> select getdate()
> waitfor delay '00:00:05'
> insert into changes (col1) values ('insert 2')
> select getdate() -- take a note of this time
> waitfor delay '00:00:05'
> insert into changes (col1) values ('insert 3')
> select getdate()
> select * from changes
> backup database restore_test to disk = 'c:\restore_test_2.bck'
> backup log restore_test to disk = 'c:\restore_test_t2.bck'
> -- now restore to point in time
> use master
> restore database restore_test from disk = 'c:\restore_test_1.bck' with
> norecovery
> restore log restore_test from disk = 'c:\restore_test_t1.bck' with
> norecovery
> restore log restore_test from disk = 'c:\restore_test_t2.bck' with stopat =
> '2003-08-27 10:43:20' -- this is the time just after 'insert 2'
> select * from restore_test..changes -- 'insert 3' has not been included
> Ian.|||Now i would lime to extend my requirement a little more. ...
I am able to restore to a certain point of time with the three
restores as explained by you. Now is there anyway where in i can do
something like

Restore DB1
Restore Log1
Restore Log2 at (say) 13.00.00.000

To restore to 13.01.01.011
i will need to
Restore DB1
Restore Log1
Restore Log2 at (say) 13.01.01.011

Is there anyway i can skip the first two restores.
It will add to look good.
Thanks for reading me...
Cheers
RVG

raj_chins@.rediffmail.com (Rajesh Garg) wrote in message news:<14215add.0308270710.62d49362@.posting.google.com>...
> Hey Ian that works and works good.
> ACtually i too had come up with a solution but had some problems with
> that. Just neede to discuss it over.
> I just used no_truncate in my bakup logs.
> The problem there was that sql was not able to free up the place used
> as it does in normal case. ( i have though not tried whether it frees
> the space in this case also but i assume it will). The solution u gave
> to me looks better.
> Thanks once again
> Cheers
> RVG
> "Ian Stocks" <nospam@.testbox2.co.uk> wrote in message news:<3f4c7f7a$0$321$bed64819@.pubnews.gradwell.net>...
> > "Rajesh Garg" <raj_chins@.rediffmail.com> wrote in message
> > news:14215add.0308262006.2b60cde@.posting.google.co m...
> > > Hi IAN thanks for prompt help ...
> > > I will make it simpler to look...
> > > > I have DB1 - as backup for day 1
> > > LOg1 as backup of logs
> > > > T1 T2 T3 T4 T5 ...some transaction on day 2
> > > > Now i backup again
> > > DB2
> > > Log2
> > > > I want to restore the database till the point of transaction T3 say. I
> > > know the time or i assume a certain time.
> > > Is this possible ....i tried several options but hand in between for
> > > some reason or the other. How can i achieve my solution. Is there some
> > > extra parameter i will require or what...i am wondering now that it
> > > is not at all possible. Please help.
> > This is definately possible, try this for yourself :-
> > create database restore_test
> > create table changes (col1 varchar(128))
> > backup database restore_test to disk = 'c:\restore_test_1.bck'
> > backup log restore_test to disk = 'c:\restore_test_t1.bck'
> > insert into changes (col1) values ('insert 1')
> > select getdate()
> > waitfor delay '00:00:05'
> > insert into changes (col1) values ('insert 2')
> > select getdate() -- take a note of this time
> > waitfor delay '00:00:05'
> > insert into changes (col1) values ('insert 3')
> > select getdate()
> > select * from changes
> > backup database restore_test to disk = 'c:\restore_test_2.bck'
> > backup log restore_test to disk = 'c:\restore_test_t2.bck'
> > -- now restore to point in time
> > use master
> > restore database restore_test from disk = 'c:\restore_test_1.bck' with
> > norecovery
> > restore log restore_test from disk = 'c:\restore_test_t1.bck' with
> > norecovery
> > restore log restore_test from disk = 'c:\restore_test_t2.bck' with stopat =
> > '2003-08-27 10:43:20' -- this is the time just after 'insert 2'
> > select * from restore_test..changes -- 'insert 3' has not been included
> > Ian.|||"Rajesh Garg" <raj_chins@.rediffmail.com> wrote in message
news:14215add.0308280155.4f14318d@.posting.google.c om...
> Now i would lime to extend my requirement a little more. ...
> I am able to restore to a certain point of time with the three
> restores as explained by you. Now is there anyway where in i can do
> something like
> Restore DB1
> Restore Log1
> Restore Log2 at (say) 13.00.00.000
> To restore to 13.01.01.011
> i will need to
> Restore DB1
> Restore Log1
> Restore Log2 at (say) 13.01.01.011
> Is there anyway i can skip the first two restores.

I dont believe this is possble, as it is not possible to use the 'STOPAT'
clause along with the the 'STANDBY' clause. So once you have specified a
'STOPAT' time, the database is fully recovered, and you can not restore any
other transaction logs.

The only sensible way it to use something like log explorer from
www.lumigent.com, if you really dont know when a database change happened.

Ian.

Friday, March 9, 2012

Expression Too Complex error - mdb

DataAdapter.update(dataSet) exception Error:
"Changes not saved to database. Expression Too Complex"
Using: Visual Studio, C#, ADO.Net interface and MS-Access (OLE DB Jet)
Without diving into the details on the one-to-many 99 column Access (Main)
table , can someone tell me the reason for the error? Is it really the
complexity of the SQL statement? Would SQL server help me? Does SQL Server
allow update() of a queries. StevePlease send us the text of the query you are trying. Based on the little
data we have here, UPDATE() is likely not usable in your situation, since
this is only for use in triggers.
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Steve B." <SteveB@.discussions.microsoft.com> wrote in message
news:6284FB15-F8CE-4BDA-9060-B4B09428F4B6@.microsoft.com...
> DataAdapter.update(dataSet) exception Error:
> "Changes not saved to database. Expression Too Complex"
> Using: Visual Studio, C#, ADO.Net interface and MS-Access (OLE DB Jet)
> Without diving into the details on the one-to-many 99 column Access (Main)
> table , can someone tell me the reason for the error? Is it really the
> complexity of the SQL statement? Would SQL server help me? Does SQL
> Server
> allow update() of a queries. Steve|||hi steve
SQL Server allows updates. there might be an error in the sql string that u
were trying to pass.
please check the query and revert back.
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"Steve B." wrote:

> DataAdapter.update(dataSet) exception Error:
> "Changes not saved to database. Expression Too Complex"
> Using: Visual Studio, C#, ADO.Net interface and MS-Access (OLE DB Jet)
> Without diving into the details on the one-to-many 99 column Access (Main)
> table , can someone tell me the reason for the error? Is it really the
> complexity of the SQL statement? Would SQL server help me? Does SQL Serve
r
> allow update() of a queries. Steve|||> DataAdapter.update(dataSet) exception Error:
> "Changes not saved to database. Expression Too Complex"
> Using: Visual Studio, C#, ADO.Net interface and MS-Access (OLE DB Jet)
> Without diving into the details on the one-to-many 99 column Access (Main)
> table , can someone tell me the reason for the error? Is it really the
> complexity of the SQL statement? Would SQL server help me? Does SQL
> Server
> allow update() of a queries.
Just off the top of my head, each version of Access has a different maximum
limit on how long an SQL statement is allowed to be. I have actually gotten
that error. That's all I can think of though.
Peace & happy computing,
Mike Labosh, MCSD
"Musha ring dum a doo dum a da!" -- James Hetfield|||I hope this is what your looking for (see below). In the mean time, I found
this (please see first few paragraphs):
http://support.microsoft.com/defaul...kb;en-us;192716
I have 99 columns and I'm using a Jet 4.0 OLE DB for Access. I'm now
thinking of dividing my Main table into 4 or 5 tables indexed on part number
(part data table, Chara. 1-10 table, chara. 11-20 data table, etc) as a
workaround. What a mess..
The CharacteristicCodes, ProcessCodes and LocationCodes fields are indexed
(dropdown) from their own table in the "Main" table but, every Characteristi
c
field is different (blueprint dimensions, note number, etc) . I really nee
d
30 characteristics not 21. Can't get there from here.
I don't know if a commercial database program like SQL server will help me.
Thats why I'm asking. Comments?
(copied from VS Dataadapter wizard)
SELECT
MainID,
PartNumber,
Nomenclature,
PartStatus,
CoverageBy,
CoverageByDate,
Engine,
Service,
Originator,
RequirementSourceCodes,
PartPointOfContact,
VerificationDate,
CharacteristicCodes1,
ProcessCodes1,
LocationCodes1,
Characteristic1,
CharacteristicCodes2,
LocationCodes2,
ProcessCodes2,
Characteristic2,
CharacteristicCodes3,
LocationCodes3,
ProcessCodes3,
Characteristic3,
CharacteristicCodes4,
LocationCodes4,
ProcessCodes4,
Characteristic4,
CharacteristicCodes5,
LocationCodes5,
ProcessCodes5,
Characteristic5,
CharacteristicCodes6,
LocationCodes6,
ProcessCodes6,
Characteristic6,
CharacteristicCodes7,
LocationCodes7,
ProcessCodes7,
Characteristic7,
CharacteristicCodes8,
LocationCodes8,
ProcessCodes8,
Characteristic8,
CharacteristicCodes9,
LocationCodes9,
ProcessCodes9,
Characteristic9,
CharacteristicCodes10,
LocationCodes10,
ProcessCodes10,
Characteristic10,
CharacteristicCodes11,
LocationCodes11,
ProcessCodes11,
Characteristic11,
CharacteristicCodes12,
LocationCodes12,
ProcessCodes12,
Characteristic12,
CharacteristicCodes13,
LocationCodes13,
ProcessCodes13,
Characteristic13,
CharacteristicCodes14,
LocationCodes14,
ProcessCodes14,
Characteristic14,
CharacteristicCodes15,
LocationCodes15,
ProcessCodes15,
Characteristic15,
CharacteristicCodes16,
LocationCodes16,
ProcessCodes16,
Characteristic16,
CharacteristicCodes17,
LocationCodes17,
ProcessCodes17,
Characteristic17,
CharacteristicCodes18,
LocationCodes18,
ProcessCodes18,
Characteristic18,
CharacteristicCodes19,
LocationCodes19,
ProcessCodes19,
Characteristic19,
CharacteristicCodes20,
LocationCodes20,
ProcessCodes20,
Characteristic20,
CharacteristicCodes21,
LocationCodes21,
ProcessCodes21,
Characteristic21,
Comments,
AnnualCSIConfirmation,
DataRowState
FROM
Main
WHERE
(AnnualCSIConfirmation = 'Yes') AND
(PartStatus = 'Active (buy part)') OR (PartStatus = 'Active (make
part)') OR (PartStatus = 'Active (buy/make part)') OR (PartStatus = 'None On
Order (Inactive)') ORDER BY MainID
"Chandra" wrote:
> hi steve
> SQL Server allows updates. there might be an error in the sql string that
u
> were trying to pass.
> please check the query and revert back.
> --
> best Regards,
> Chandra
> http://chanduas.blogspot.com/
> http://www.SQLResource.com/
> ---
>
> "Steve B." wrote:
>|||Yes!
i agree with you. The message mentions that, the query must be optimized.
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"Mike Labosh" wrote:

> Just off the top of my head, each version of Access has a different maximu
m
> limit on how long an SQL statement is allowed to be. I have actually gott
en
> that error. That's all I can think of though.
> --
> Peace & happy computing,
> Mike Labosh, MCSD
> "Musha ring dum a doo dum a da!" -- James Hetfield
>
>|||hi
looks like u need to normalize your table:
something like:
MainID,
Charid,
CharacteristicCodes,
ProcessCodes,
LocationCodes,
Characteristic,
but, this is out of scope now:
just try to remove "ORDER BY MainID" and check, it might speed up the
process and u can escape from the error.
or
where part:
AnnualCSIConfirmation = 'Yes' AND
PartStatus IN ( 'Active (buy part)', 'Active (make part)', 'Active
(buy/make part)', 'None On Order (Inactive)' )
please revert back with the results
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.SQLResource.com/
---
"Steve B." wrote:
> I hope this is what your looking for (see below). In the mean time, I fou
nd
> this (please see first few paragraphs):
> http://support.microsoft.com/defaul...kb;en-us;192716
> I have 99 columns and I'm using a Jet 4.0 OLE DB for Access. I'm now
> thinking of dividing my Main table into 4 or 5 tables indexed on part numb
er
> (part data table, Chara. 1-10 table, chara. 11-20 data table, etc) as a
> workaround. What a mess..
> The CharacteristicCodes, ProcessCodes and LocationCodes fields are indexe
d
> (dropdown) from their own table in the "Main" table but, every Characteris
tic
> field is different (blueprint dimensions, note number, etc) . I really n
eed
> 30 characteristics not 21. Can't get there from here.
> I don't know if a commercial database program like SQL server will help me
.
> Thats why I'm asking. Comments?
> (copied from VS Dataadapter wizard)
> SELECT
> MainID,
> PartNumber,
> Nomenclature,
> PartStatus,
> CoverageBy,
> CoverageByDate,
> Engine,
> Service,
> Originator,
> RequirementSourceCodes,
> PartPointOfContact,
> VerificationDate,
> CharacteristicCodes1,
> ProcessCodes1,
> LocationCodes1,
> Characteristic1,
> CharacteristicCodes2,
> LocationCodes2,
> ProcessCodes2,
> Characteristic2,
> CharacteristicCodes3,
> LocationCodes3,
> ProcessCodes3,
> Characteristic3,
> CharacteristicCodes4,
> LocationCodes4,
> ProcessCodes4,
> Characteristic4,
> CharacteristicCodes5,
> LocationCodes5,
> ProcessCodes5,
> Characteristic5,
> CharacteristicCodes6,
> LocationCodes6,
> ProcessCodes6,
> Characteristic6,
> CharacteristicCodes7,
> LocationCodes7,
> ProcessCodes7,
> Characteristic7,
> CharacteristicCodes8,
> LocationCodes8,
> ProcessCodes8,
> Characteristic8,
> CharacteristicCodes9,
> LocationCodes9,
> ProcessCodes9,
> Characteristic9,
> CharacteristicCodes10,
> LocationCodes10,
> ProcessCodes10,
> Characteristic10,
> CharacteristicCodes11,
> LocationCodes11,
> ProcessCodes11,
> Characteristic11,
> CharacteristicCodes12,
> LocationCodes12,
> ProcessCodes12,
> Characteristic12,
> CharacteristicCodes13,
> LocationCodes13,
> ProcessCodes13,
> Characteristic13,
> CharacteristicCodes14,
> LocationCodes14,
> ProcessCodes14,
> Characteristic14,
> CharacteristicCodes15,
> LocationCodes15,
> ProcessCodes15,
> Characteristic15,
> CharacteristicCodes16,
> LocationCodes16,
> ProcessCodes16,
> Characteristic16,
> CharacteristicCodes17,
> LocationCodes17,
> ProcessCodes17,
> Characteristic17,
> CharacteristicCodes18,
> LocationCodes18,
> ProcessCodes18,
> Characteristic18,
> CharacteristicCodes19,
> LocationCodes19,
> ProcessCodes19,
> Characteristic19,
> CharacteristicCodes20,
> LocationCodes20,
> ProcessCodes20,
> Characteristic20,
> CharacteristicCodes21,
> LocationCodes21,
> ProcessCodes21,
> Characteristic21,
> Comments,
> AnnualCSIConfirmation,
> DataRowState
> FROM
> Main
> WHERE
> (AnnualCSIConfirmation = 'Yes') AND
> (PartStatus = 'Active (buy part)') OR (PartStatus = 'Active (make
> part)') OR (PartStatus = 'Active (buy/make part)') OR (PartStatus = 'None
On
> Order (Inactive)') ORDER BY MainID
>
> "Chandra" wrote:
>|||>> I have 99 columns and I'm using a Jet 4.0 OLE DB for Access. I'm now
You have a poorly designed table. Any shuffling you do without a thorough
analysis of your business model and logic rules, might still leave the
schema unmaintainable and make the queries complex.
Instead of splitting up a single set of attribute into groups of {1st set of
cols}, {2nd of cols}, ... {n-th set of cols}, consider redesigning the table
better. Understand and analyze the entities in question and identify each of
the attributes explicitly. Identify the dependencies among these attributes
and consider decomposing them into multiple tables appropriately, if
required.
Even, without considering any ill-effects of under normalized schemas, with
certain assumptions based on the query you posted, you might benefit from
having your table structured like:
CREATE TABLE Parts (
Part_nbr INT NOT NULL PRIMARY KEY,
.. ) ;
CREATE TABLE Characteristics (
Character_id INT NOT NULL ,
Part_nbr INT NOT NULL
REFERENCES Parts ( Part_nbr ) ON UPDATE...ON DELETE...
Code ...
Characteristic...
PRIMARY KEY ( Character_id, Part_nbr ) );
CREATE TABLE Processes (
Process_id INT NOT NULL,
Part_nbr INT NOT NULL
REFERENCES Parts ( Part_nbr ) ON UPDATE...ON DELETE...
Process_code ...
PRIMARY KEY ( Process_id, Part_nbr ) );
CREATE TABLE Locations (
Location_id INT NOT NULL,
Part_nbr INT NOT NULL
REFERENCES Parts ( Part_nbr ) ON UPDATE...ON DELETE...
Location_code ...
PRIMARY KEY ( Location_id, Part_nbr );
Now the query is as simple as:
SELECT p1.Part_nbr,...
c1.code, ...
p2.process_code,...
l1.location_code...
FROM Parts p1
INNER JOIN Characteristics c1 ON p1.Part_nbr = c1.Part_nbr
INNER JOIN Processes p2 ON p1.Part_nbr = p2.Part_nbr
INNER JOIN Locations l1 ON p1.Part_nbr = l1.Part_nbr
...
This could be your comparable resultset which you might consider using for a
variety of purposes. For the specific case you mentioned in your post, you
can simply pivot this data, either using your client programming language or
if done within the server, using the popular pivoting technique detailed in
MSKB ( support.microsoft.com ) : 175574
Anith|||Thank You Chandra. That was an easy fix but I regret it didn't work. It wa
s
definitly worth a try in order to escape. I agree. Thanks Steve
"Chandra" wrote:
> hi
> looks like u need to normalize your table:
> something like:
> MainID,
> Charid,
> CharacteristicCodes,
> ProcessCodes,
> LocationCodes,
> Characteristic,
> but, this is out of scope now:
> just try to remove "ORDER BY MainID" and check, it might speed up the
> process and u can escape from the error.
> or
> where part:
> AnnualCSIConfirmation = 'Yes' AND
> PartStatus IN ( 'Active (buy part)', 'Active (make part)', 'Active
> (buy/make part)', 'None On Order (Inactive)' )
> please revert back with the results
>
> --
> best Regards,
> Chandra
> http://chanduas.blogspot.com/
> http://www.SQLResource.com/
> ---
>
> "Steve B." wrote:
>|||Anith,
Thank You for your input. I've sent a copy of your post to a coworker who
understands database design more then I - such is the problem with using
wizards. A few questions so I (we) can better understand the design/context
.
Assumptions:
1. You appear to be dividing the fields into 4 tables – Parts,
CharacteristicsCode (identified in post as Characteristics), Process and
Locations. There is an additional field Characteristic that varies with eac
h
of the other three fields. So for each of the [possible] 30 Characteristic’s
each of them have an associated CharacteristicsCode , Process and Location.
I guess the structure of all 4 tables (except Parts) are exactly the same an
d
doesn’t matter. With that said, the CharacteristicsCode, Process, Locatio
ns
and Characteristic tables will have the exact same table structure and kind
of relationship.
2. It’s assumed the Parts table will contain the part numbers and
associated part data fields like t nomenclatures, etc
3. Does PRIMARY KEY (…) mean you somehow combine the both fields? Is thi
s
the actual relationship, for example, the join from Process_id to Part_nbr ?
4. SQL statement: what’s p1, c1, etc. and/or what’s p1.Part_nbr, c1.cod
e, etc
I think I’m going to have to create it this before I fully understand it.
However, I’m not sure the Visual Studio (VS) Query Builder inside the VS
environment will allow me to create such an Access SQL statement as
described. The DataAdapter might just expand the SQL statement again in the
DataSet so, I might be right back to the beginning again. I can’t use
external Access queries for SELECT, UPDATE, DELETE etc. Please keep the
post open. Thank You.
Steve
"Anith Sen" wrote:

> You have a poorly designed table. Any shuffling you do without a thorough
> analysis of your business model and logic rules, might still leave the
> schema unmaintainable and make the queries complex.
> Instead of splitting up a single set of attribute into groups of {1st set
of
> cols}, {2nd of cols}, ... {n-th set of cols}, consider redesigning the tab
le
> better. Understand and analyze the entities in question and identify each
of
> the attributes explicitly. Identify the dependencies among these attribute
s
> and consider decomposing them into multiple tables appropriately, if
> required.
> Even, without considering any ill-effects of under normalized schemas, wit
h
> certain assumptions based on the query you posted, you might benefit from
> having your table structured like:
> CREATE TABLE Parts (
> Part_nbr INT NOT NULL PRIMARY KEY,
> ... ) ;
> CREATE TABLE Characteristics (
> Character_id INT NOT NULL ,
> Part_nbr INT NOT NULL
> REFERENCES Parts ( Part_nbr ) ON UPDATE...ON DELETE...
> Code ...
> Characteristic...
> PRIMARY KEY ( Character_id, Part_nbr ) );
> CREATE TABLE Processes (
> Process_id INT NOT NULL,
> Part_nbr INT NOT NULL
> REFERENCES Parts ( Part_nbr ) ON UPDATE...ON DELETE...
> Process_code ...
> PRIMARY KEY ( Process_id, Part_nbr ) );
> CREATE TABLE Locations (
> Location_id INT NOT NULL,
> Part_nbr INT NOT NULL
> REFERENCES Parts ( Part_nbr ) ON UPDATE...ON DELETE...
> Location_code ...
> PRIMARY KEY ( Location_id, Part_nbr );
> Now the query is as simple as:
> SELECT p1.Part_nbr,...
> c1.code, ...
> p2.process_code,...
> l1.location_code...
> FROM Parts p1
> INNER JOIN Characteristics c1 ON p1.Part_nbr = c1.Part_nbr
> INNER JOIN Processes p2 ON p1.Part_nbr = p2.Part_nbr
> INNER JOIN Locations l1 ON p1.Part_nbr = l1.Part_nbr
> ...
> This could be your comparable resultset which you might consider using for
a
> variety of purposes. For the specific case you mentioned in your post, you
> can simply pivot this data, either using your client programming language
or
> if done within the server, using the popular pivoting technique detailed i
n
> MSKB ( support.microsoft.com ) : 175574
> --
> Anith
>
>

Sunday, February 26, 2012

Express Edition SP2 - How long to wait for complete installation?

Just curious if there's a reason why everytime I try to apply the Microsoft SQL Server 2005 Express Edition Service Pack 2 from Windows Update that it will sit at "Installing" and appear to do nothing (no hard drive activity, but the MSI and setup processes are chewing a little bit of CPU time). How long should I give this update to complete? I am running a 2-CPU dual-core Xeon 3.0GHz w/ 2GB of RAM setup, so I would have thought it would be completed very quickly. :(

Edit:

Disregard; I had to wait for a full 15 minutes! :OFifteen minutes isn't a 'unusual' amount of time. Depends upon what activity is occuring on the computer.|||I was surprised because nothing else was chewing CPU and Firefox was the only other application open besides IE7 running the Microsoft Update.