Similar Threads:
1.CREATE DATABASE inside a transaction with Microsoft SQL 2005
Hi,
Till now I am using SQL server 2000 with Microsoft JDBC SP3 for 2000.
Everything is fine.
But now I moved to SQLServer 2005 with Microsoft JDBC for 2005. But it
throws
an error "CREATE DATABASE statement not allowed within multi-statement
transaction" when our application tries to create a new DB inside a
transaction. All other DDL statements like CREATE TABLE, ALTER etc
works well inside a transaction with JDBC. We found that only CREATE
DATABASE has problem.
This problem is not there with Old JDBC driver with SQL 2000.
I know such a problem is there with SYBASE in which by default sybase
wn't allow DDL statements inside a transaction. But they provide an
option DDL_IN_TRAN or something like that. Enabling this will allow
DDL.
How I can make CREATE DATBASE work inside a transaction. Is there any
options available.
Regards
zunilp
Cordys
2.The sql transaction sample in MSDN is so weird, only one command inside the whole transaction
3.Create online form to feed in SQL DB
Hi:
I have been tasked with creating an online course evaluation form. This form
will be used by our client students to give us feedback on the courses they
take with us.
I have two needs:
ONSITE - I need a good tutorial on how to create a form in Flash that will
populate a SQL DB. Students will complete the form when onsite at our HQ.
This form will be on our intranet and will directly feed the SQL DB.
OFFSITE - OK. This is the more challenging issue. Our trainers tell us that
many of our clients (believe it or not) do not have or allow internet access to
the PCs used for training at their site. So, the students cannot use our
online form (even though we could put it on the internet).
Can I modify the Flash form used for onsite, for the offsite? The trainer
would install the file and the Flash plug-in if needed on the client's PC. The
student would complete the form and the Flash form would store their responses
to their local PC. The trainer would then copy the output file to a jump
drive. When the trainer returns to HQ, he/she would need to be able to import
those responses to the SQL DB.
How can I do this and make it relatively simple for the trainer?
Thanks,
Loren
4.normalization question about 2nd normal form
Chris,
In your design, the following data is allowed:
Insert into Drivers values (1, 'Bill', 'Clinton', '000-000-0000')
Insert into Drivers values (2, 'Hillary', 'Clinton', '000-000-0000')
Insert into DriversDependants values (1,1,'Clinton', 'Chelsea', 27, 'F')
Insert into DriversDependants values (2,1,'Clinton', 'Chelsea', 27, 'F')
So is the following:
Insert into Drivers values (1, 'Bill', 'Clinton', '000-000-0000')
Insert into Drivers values (2, 'Hillary', 'Clinton', '000-000-0000')
Insert into DriversDependants values (1,1,'Clinton', 'Chelsea', 27, 'F')
Insert into DriversDependants values (2,1,'Clifton', 'Chelcee', 127, 'F')
Whether your model is 2NF depends on whether you want
to allow the second situation, and whether the two Chelsea Clintons
in the first group of inserts are different people (or should be considered
different in your business).
If DependantID values can be repeated so long as they
are repeated for distinct DriverID values, and if you don't
care about the possibility of two drivers having the same
dependent (you consider them different regardless), you model
is ok. (DependantID 1 means "first for this driver", for example).
If you want to be able to refer to a dependent independently
of a driver, then this model won't work for you. Either it duplicates
facts (as in the first group of inserts), threatening data integrity,
or it creates ambiguous situations (who is DependantID = 1 ?)
By the way, if all the dependent information depends on the
DependantID value, 2NF requires moving last name and first
name to the table of dependents also, not just age and sex.
-- Steve Kass
-- Drew University
-- Ref: A68CFE10-6F8A-48F3-8E0F-8BA1142735B5
chris wrote:
>Im reading an old book I have about DB desgin and it
>brought up a good point. Take these tables:
>
>Drivers
>------------
>DriverID(PK)
>FName
>LName
>SSN
>
>
>DriversDependants
>----------------------
>DriverID(FK)(PK)
>DependantID(PK)
>DependantLName
>DependantFName
>DependantAge
>DependantSex
>
>
>The book says that to be in 2NF you should split the
>DriversDependants table into 2 tables. The end result
>should be:
>
>
>
>Drivers
>------------
>DriverID(PK)
>FName
>LName
>SSN
>
>
>Dependants
>----------------------
>DriverID(FK)
>DependantID(FK)
>DependantLName
>DependantFName
>
>
>DriversDependants
>--------------------
>DependantID(PK)
>DependantAge
>DependantSex
>
>
>I understand that from a purely relational point of view
>this is how it should be. But from a more down to earth
>point of view Im trying to figure out how this would be of
>any possible value? It seems to me that Age and Sex would
>always be required so to put them in there own table would
>only slow things down. I am far from a relational expert
>so I thought I would see what you guys think. Would there
>be some benifit here that Im not seeing? Would you do it
>the way the book says?
>
>Any input would be great.
>Chris
>
>
5.Create a job to check db transaction log size
I would like to create a tsql script that would check the
database transaction log file size hourly.(xp_cmdshell)
If the log file size is greater than 500 MB then run the
script listed below to truncate the log.
Please help me with this script.
Thank You,
Mike
USE DATABASE
GO
DBCC SHRINKFILE(starterdb_log, 100)
USE DATABASE
GO
BACKUP LOG DATABASE WITH TRUNCATE_ONLY
USE DATABASE
GO
DBCC SHRINKFILE(starterdb_log, 100)
6. Optimizations Job and Shrink DB creating HUGE transaction log file
7. Optimizations Job and Shrink DB creating HUGE transaction log
8. child form inside the page