Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 insert statements

Author  Topic 

nheijmink
Starting Member

8 Posts

Posted - 2007-11-13 : 09:03:37
i'm quite new with sql and i have an question about het insert statements.
Is the order of the insert statements from any importance?
and why is/isn't it?

Greetz


harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-11-13 : 09:05:36
What do you mean by order? order in which insert statements executed?
It is important in case of parent child relationship.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

nheijmink
Starting Member

8 Posts

Posted - 2007-11-13 : 11:39:51
What i actualy meant was: that when i carry out a couple of statements, is the oder in wich they are carry'd out from any importance?

greetz
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-13 : 11:45:10
Yes. It is important. as harsh said. if you have 2 table with parent - child relationship (foreign key), you must insert to the parent table first follow by child table.

If the tables you are inserted into has no relationship at all, than the order or sequence might not be important.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

nheijmink
Starting Member

8 Posts

Posted - 2007-11-13 : 11:50:30
tnks guys your the best
Go to Top of Page

nheijmink
Starting Member

8 Posts

Posted - 2007-11-15 : 08:51:48
i have only one question left it is not quite important but wat actualy happens when i do not put the insert statements in the right order ( in case of an partent child relationship)?

greetz
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-15 : 08:57:46
try that yourself to find out what kind of error it returns


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -