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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Error: Incorrect syntax near ')'.

Author  Topic 

7siva7
Starting Member

28 Posts

Posted - 2011-11-24 : 07:03:47
i am struggling with this error from 2 days

can any one please help me !!!



nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-11-24 : 07:14:04
FROM
(
SELECT pg.Reactor_Group_Nm AS CatGroup,
MIN(Phase_Order_Num) AS Base_Phase_Order_Num
FROM Phase_Reactor_Group pg
JOIN Phase ph
ON ph.Plant_Cd = pg.Plant_Cd
AND ph.Run_Id = pg.Run_Id
AND ph.Phase_Id = pg.Phase_Id
WHERE pg.Plant_Cd = @proc_vr_plant_cd
AND pg.RUN_ID = @proc_nm_Run_Id
GROUP BY pg.Reactor_Group_Nm
)
) Phase_Group

Aren't there too many close brackets here?
Hate to be the one tying to maintain this system.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

7siva7
Starting Member

28 Posts

Posted - 2011-11-24 : 07:16:50
Brackets CLosed Correctly.....just try to Execute this code in your SSMS..then you will get same error

HI
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-11-24 : 07:21:09
Maybe this then - then derived table will need a name - maybe the second bracket isn't ending the derived table.

FROM
(
SELECT pg.Reactor_Group_Nm AS CatGroup,
MIN(Phase_Order_Num) AS Base_Phase_Order_Num
FROM Phase_Reactor_Group pg
JOIN Phase ph
ON ph.Plant_Cd = pg.Plant_Cd
AND ph.Run_Id = pg.Run_Id
AND ph.Phase_Id = pg.Phase_Id
WHERE pg.Plant_Cd = @proc_vr_plant_cd
AND pg.RUN_ID = @proc_nm_Run_Id
GROUP BY pg.Reactor_Group_Nm
) a
) Phase_Group


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

7siva7
Starting Member

28 Posts

Posted - 2011-11-24 : 07:35:43
Thanks dude..it works....thank you very much

HI
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-11-25 : 04:51:16
quote:
Originally posted by 7siva7

Thanks dude..it works....thank you very much

HI


Ok. Why did you remove your original code?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

akis3110
Starting Member

3 Posts

Posted - 2011-12-18 : 06:38:03
I'm trying to import data from Excel. I have created a linked server with Ace 12.0 provider and I'm execute this code
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; Database=C:\Users\akis\Desktop\Customer.xlsx;HDR=No', 'Select * from [Sheet1$]')

I get back this error message:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ')'

Can anyone help please?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-12-18 : 10:21:23
quote:
Originally posted by akis3110

I'm trying to import data from Excel. I have created a linked server with Ace 12.0 provider and I'm execute this code
INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0; Database=C:\Users\akis\Desktop\Customer.xlsx;HDR=No', 'Select * from [Sheet1$]')

I get back this error message:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ')'

Can anyone help please?


please dont hijack other threads
post your question as a new thread to improve visibility

also your insert is not complete as there's no value or select part

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -