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.
| Author |
Topic |
|
shpinoza1980
Starting Member
17 Posts |
Posted - 2011-01-23 : 02:27:10
|
Hello,How do I implement the 'If Exists' syntax in the following update query, to run the query only if tables exists in the database:update t1 set t1.companyID = t3.companyIDfrom BRM_Events t1join dbo.feeds t2 ON t1.feedID = t2.feedIDjoin dbo.companies t3 ON t2.companyName = t2.feedName I need the if exists condition to check for t1,t2,t3 tables.thanks a lot |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-01-23 : 03:59:15
|
IF OBJECT_ID('BRM_Events') IS NOT NULL AND OBJECT_ID('dbo.feeds') IS NOT NULL AND OBJECT_ID('dbo.companies') IS NOT NULLUPDATE... N 56°04'39.26"E 12°55'05.63" |
 |
|
|
shpinoza1980
Starting Member
17 Posts |
Posted - 2011-01-23 : 04:27:06
|
| works greatthanks a lot |
 |
|
|
|
|
|