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 2005 Forums
 Transact-SQL (2005)
 Anything wrong with dash?

Author  Topic 

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2008-08-04 : 14:10:16
Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '-'.


INSERT INTO POSDB-HH.dbo.PCG ([SKU],[OBJ],[DEPT],[CLASS],[LOC],[BEG],[END],[CREATE_TS],[UPD_TS],[TABL_ID])
VALUES
('2692','654100','1','010','0','08/04/2008','08/04/2008','08/04/2008','08/04/2008','08/04/2008')

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-04 : 14:21:24
quote:
Originally posted by zhshqzyc

Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '-'.


INSERT INTO [POSDB-HH].dbo.PCG ([SKU],[OBJ],[DEPT],[CLASS],[LOC],[BEG],[END],[CREATE_TS],[UPD_TS],[TABL_ID])
VALUES
('2692','654100','1','010','0','08/04/2008','08/04/2008','08/04/2008','08/04/2008','08/04/2008')



put it within []
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-05 : 04:58:50
Also, use underscore in place of dash or space for more readability and error free when naming the objects

Madhivanan

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

- Advertisement -