472,373 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,373 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 2511

"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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.