473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

why do generated script begin with empty transactions ?

Greetings,

I am adding foreign keys to a database and saving the generated scripts.

What I do not understand is that all script begin with empty
transactions. Why ?

Example follows :
/*

vendredi 29 juillet 2005 10:54:36

User:

Server: (LOCAL)

Database: NewsPaper

Application: MS SQLEM - Data Tools

*/

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
ALTER TABLE dbo.Article ADD CONSTRAINT
FK_Article_PublicationLevel FOREIGN KEY
(
PublicationLevelId
) REFERENCES dbo.PublicationLevel
(
PublicationLevelId
) ON UPDATE CASCADE
ON DELETE CASCADE

GO
ALTER TABLE dbo.Article ADD CONSTRAINT
FK_Article_UserInfo FOREIGN KEY
(
CreatorId
) REFERENCES dbo.UserInfo
(
UserId
) ON UPDATE CASCADE
ON DELETE CASCADE

GO
ROLLBACK
Jul 29 '05 #1
2 2576

"gabriel" <sp**@yahoo.fr> wrote in message
news:42**********************@news.free.fr...
Greetings,

I am adding foreign keys to a database and saving the generated scripts.

What I do not understand is that all script begin with empty transactions.
Why ?

Example follows :
/*

vendredi 29 juillet 2005 10:54:36

User:

Server: (LOCAL)

Database: NewsPaper

Application: MS SQLEM - Data Tools

*/

BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
COMMIT
BEGIN TRANSACTION
ALTER TABLE dbo.Article ADD CONSTRAINT
FK_Article_PublicationLevel FOREIGN KEY
(
PublicationLevelId
) REFERENCES dbo.PublicationLevel
(
PublicationLevelId
) ON UPDATE CASCADE
ON DELETE CASCADE

GO
ALTER TABLE dbo.Article ADD CONSTRAINT
FK_Article_UserInfo FOREIGN KEY
(
CreatorId
) REFERENCES dbo.UserInfo
(
UserId
) ON UPDATE CASCADE
ON DELETE CASCADE

GO
ROLLBACK


It looks like you're using the Table Designer in EM? I have no idea why the
script includes those statements, but in general it's much better to make
DDL changes using a script in Query Analyzer - EM is useful for admin tasks,
but it's not very suitable for design and programming tasks (in fact, some
tasks cannot be done at all in EM). This article gives more details:

http://www.aspfaq.com/show.asp?id=2455

Simon
Jul 29 '05 #2
gabriel (sp**@yahoo.fr) writes:
I am adding foreign keys to a database and saving the generated scripts.

What I do not understand is that all script begin with empty
transactions. Why ?


Because the Table Designer is seriously buggy, and has number of
severe design flaws, and the empty transactions you see are a token
of these.

These empty transactions are harmless, however, say that you change a column
to a table that both references other tables, and are referred by other
tables. Now these transactions will no longer be empty, but will
comprise different parts of the table-update when it all should have
been one transaction.

Don't use the Table Designer to modify tables, use T-SQL instead. OK,
so you could generate scripts from the table designer, if you review
them *carefully*.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 29 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David M Loraine | last post by:
I am a sql novice and would appreciate any help with the following problem. In a table I have property addresses stored in 6 fields. Field6 always hold the Post Code. However, fields 4 and 5...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
14
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file...
3
by: muzamil | last post by:
To get rid of redundant data in a table, my cleint will be providing something like this: IDtokeep Ids to delete 34 24,35,49 12 14,178,1457 54 32,65,68 I have to write a...
4
by: Leaf | last post by:
Greetings, I've been reading with interest the threads here on deadlocking, as I'm finding my formerly happy app in a production environment suddenly deadlocking left and right. It started...
7
by: Gertjan van Heijst | last post by:
Hi, I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store...
7
by: | last post by:
I was wondering if anyone can help explain this code for me <table width="<?= $TABLE_WIDTH ?>" border="0" cellspacing="0" cellpadding="0"> <?php for ($x=1; $x<=pow(2, $COLUMNS); $x++) { // open...
4
by: wizard | last post by:
Hello dear friends, I am writing a small program to test transactions in php. But when I try to simulate an error condition during transaction, my php script aborts. It does rollback work, but...
2
by: DVH | last post by:
Hi, I've a script that sends mail from my site. I've included a regexp which should return 403 forbidden if you try to hijack it and send to another address. How can I test to make sure it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.