01-15-2014 03:13 AM
I have a sql-code that works fine in MS SQL server.
It also works in Proc Sql except for creating a variable inside the update script.
I want the code to create a new variable if table a is updated with a variable from table b (=match). The variable should be empty if it is not updated
This is the SQL-code:
update LM as a
set y= b.y,
match = 1 /* creating this variable will not work in proc sql*/
from have b
where a.id = b.id
Can this be done using Proc sql?
01-15-2014 03:31 AM
Adding, modifying or dropping a column is done in SQL via an ALTER TABLE statement. This is done this way not only in the SAS SQL flavour but also in the SQL flavours of all databases I've worked with so far.
I strongly doubt that MS SQL behaves differently because this is the DDL as part of the SQL ANSI standard. SQL - Wikipedia, the free encyclopedia