This one does not work....
SET @NewPODB_NAME = 'IF EXISTS (SELECT * FROM PO0007 WHERE CODPROD = char(44) AC700MC0 char(44)) BEGIN SET @Check = 1 END'
It tells me:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'AC700MC0'
When I take out the Where clause it works.
SET @NewPODB_NAME = 'IF EXISTS (SELECT * FROM PO0007) BEGIN SET @Check = 1 END'
What am I doing wrong?
SET @NewPODB_NAME = 'IF EXISTS (SELECT * FROM PO0007 WHERE CODPROD = char(44) AC700MC0 char(44)) BEGIN SET @Check = 1 END'
It tells me:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'AC700MC0'
When I take out the Where clause it works.
SET @NewPODB_NAME = 'IF EXISTS (SELECT * FROM PO0007) BEGIN SET @Check = 1 END'
What am I doing wrong?