July 28, 2005 at 9:27 pm
Hi,
sorry if it could be a simple.When 2 statement ( One 1 insert and 1 SELECT) excutes on SQL Server at same time.Which Statement will get 1st preferences.if not how i can set insert should take 1 st preferences.
thanks
July 28, 2005 at 9:36 pm
Arun - not sure if I understand the question correctly - is the insert and select being done on the same database object by the same person; on the same object by different people; on different objects ?! Directly in the database - or through an application GUI ?!
Normally you would just do a "INSERT INTO Table(Col1, Col2 etc..)
SELECT Col1, Col2 FROM otherTable"
If this is not what you want you would have to add conditional logic so that the insert is done before the select - maybe in a stored procedure ?!
**ASCII stupid question, get a stupid ANSI !!!**
July 28, 2005 at 9:48 pm
Are you saying both are executing at the same time? If so, and they're coming from different connections, SQL Server is going to process the one that actually came first, regardless of the operation. If it's from the same connection, put the INSERT before the SELECT statement.
K. Brian Kelley
@kbriankelley
July 28, 2005 at 10:42 pm
Thanks a lot
i think bkelley is comment is fine.
July 29, 2005 at 4:48 am
Hi Arun,
Bkelley comment is fine if u run both the select and insert statement on the same database. but this in second aspect if u are executing insert and select statement on diffrent server will first check the linked server query table.
from
killer
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy