-5
update [Netlication].[dbo].[SISStockTransaction]
set [Netlication].[dbo].[SISStockTransaction].[atCreateDate]=[test4].[dbo].[SISStockTransaction].[atCreateDate]
from [Netlication].[dbo].[SISStockTransaction],[test4].[dbo].[SISStockTransaction]
where [Netlication].[dbo].[SISStockTransaction].[z1SISStockTransactionId]=[test4].[dbo].[SISStockTransaction].[z1SISStockTransactionId]

whats the wrong in this statement?

PM 77-1
  • 12,254
  • 20
  • 64
  • 106
  • Welcome to Stack Overflow , please take a moment to read [how to ask a good question](https://stackoverflow.com/help/how-to-ask) – Neji Soltani Jan 08 '18 at 16:56
  • 2
    [Bad habits to kick : using old-style JOINs](http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/08/bad-habits-to-kick-using-old-style-joins.aspx) - that old-style *comma-separated list of tables* style was replaced with the *proper* ANSI `JOIN` syntax in the ANSI-**92** SQL Standard (**25 years** ago) and its use is discouraged – marc_s Jan 08 '18 at 16:58
  • There are numerous things wrong with that query. – Sean Lange Jan 08 '18 at 17:19

1 Answers1

0

Try below .you are missing join

UPDATE [Netlication].[dbo].[SISStockTransaction]
SET [Netlication].[dbo].[SISStockTransaction].[atCreateDate] = [test4].[dbo].[SISStockTransaction].[atCreateDate]
FROM [Netlication].[dbo].[SISStockTransaction] INNER Join
     [test4].[dbo].[SISStockTransaction] ON [Netlication].[dbo].[SISStockTransaction].[z1SISStockTransactionId] = [test4].[dbo].[SISStockTransaction].[z1SISStockTransactionId]
WHERE [Netlication].[dbo].[SISStockTransaction].[z1SISStockTransactionId] = [test4].[dbo].[SISStockTransaction].[z1SISStockTransactionId];
Anwar Ul-Haq
  • 1,786
  • 1
  • 13
  • 26
  • The objects "test4.dbo.SISStockTransaction" and "Netlication.dbo.SISStockTransaction" in the FROM clause have the same exposed names. Use correlation names to distinguish them whats mean this error – mohammad hamdan Jan 08 '18 at 17:17