Showing posts with label appears. Show all posts
Showing posts with label appears. Show all posts

Monday, March 12, 2012

Msg 170, Level 15, State 1

This error has been reported in a number of previous occasions. However in my case non of the suggested solutions appears to work

--==================================================
CREATE VIEW dbo.vAllLesions
AS SELECT
dbo.Patients.idP, dbo.Patients.Surname, dbo.Patients.GName, dbo.Patients.Sex,
dbo.Patients.DoB, dbo.Lesions.idL, dbo.Lesions.OriginalIdBase,
dbo.Lesions.OriginalIdL,
dbo.Lesions.Notes,
dbo.Lesions.idBatch,
dbo.UserLesionFlags.value As FlagValue
FROM********
dbo.Lesions INNER JOIN
****************dbo.Patients ON dbo.Lesions.idP = dbo.Patients.idP LEFT OUTER JOIN
****************dbo.UserLesionFlags ON dbo.Lesions.idL = dbo.UserLesionFlags.idL
WHERE**** (dbo.Patients.Exported = 0) AND (dbo.Patients.DeletedDay IS NULL) AND (dbo.Lesions.DeletedDay IS NULL)
GO
--
================================================
Server: Msg 170, Level 15, State 1, Procedure vAllLesions, Line 10
Line 10: Incorrect syntax near '*'.
Acoording to the error report there is a proplem with inner join but just what is the problem.
Regards
Joe

Quote:

Originally Posted by underdown

This error has been reported in a number of previous occasions. However in my case non of the suggested solutions appears to work
Joe


Sorry for the trouble. Turned out to be hidden characters that I removed using (guess what) Edit.
Regards
joe

Friday, March 9, 2012

msg : 2714

II am trying to create table through Query Analyzer. an error message appears
"Server: Msg 2714, Level 16, State 4, Line 1
There is already an object named 'ACTIVITY_TABLE' in the database."
the table does not exists in the DB I used following scripts to create table
create table dbo.ACTIVITY_TABLE (
ACTIVITY_DEPT_CODE numeric(10) not null,
ACTIVITY_CODE numeric(2) not null,
ACTIVITY_LOCAL_CODE numeric(9) null,
ACTIVITY_DESC varchar(200) null,
CORDINATOR_CODE varchar(50) null,
LASTUSERID varchar(8) not null,
LASTDATE datetime not null,
ACTIVITY_IND varchar(1) null,
constraint ACTIVITY_TABLE primary key (ACTIVITY_DEPT_CODE, ACTIVITY_CODE)
)
GoHi
Rename you constraint to something else. Only 1 object in a DB can have a
specific name. Your Table and your Constraint have the same name which is
not allowed
e.g.
constraint cons_ACTIVITY_TABLE primary key (ACTIVITY_DEPT_CODE,
ACTIVITY_CODE)
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Adel" <Adel@.discussions.microsoft.com> wrote in message
news:3FE4F90F-D387-4F81-9576-51C31C9D79C1@.microsoft.com...
> II am trying to create table through Query Analyzer. an error message
appears
> "Server: Msg 2714, Level 16, State 4, Line 1
> There is already an object named 'ACTIVITY_TABLE' in the database."
> the table does not exists in the DB I used following scripts to create
table
> create table dbo.ACTIVITY_TABLE (
> ACTIVITY_DEPT_CODE numeric(10) not null,
> ACTIVITY_CODE numeric(2) not null,
> ACTIVITY_LOCAL_CODE numeric(9) null,
> ACTIVITY_DESC varchar(200) null,
> CORDINATOR_CODE varchar(50) null,
> LASTUSERID varchar(8) not null,
> LASTDATE datetime not null,
> ACTIVITY_IND varchar(1) null,
> constraint ACTIVITY_TABLE primary key (ACTIVITY_DEPT_CODE,
ACTIVITY_CODE)
> )
> Go
>
>|||Many people use a postscript, or prescript kind of name,,, I would use
Activity_table_PK, so when names are sorted all of the activity-table stuff
sorts together..
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Adel" <Adel@.discussions.microsoft.com> wrote in message
news:3FE4F90F-D387-4F81-9576-51C31C9D79C1@.microsoft.com...
> II am trying to create table through Query Analyzer. an error message
> appears
> "Server: Msg 2714, Level 16, State 4, Line 1
> There is already an object named 'ACTIVITY_TABLE' in the database."
> the table does not exists in the DB I used following scripts to create
> table
> create table dbo.ACTIVITY_TABLE (
> ACTIVITY_DEPT_CODE numeric(10) not null,
> ACTIVITY_CODE numeric(2) not null,
> ACTIVITY_LOCAL_CODE numeric(9) null,
> ACTIVITY_DESC varchar(200) null,
> CORDINATOR_CODE varchar(50) null,
> LASTUSERID varchar(8) not null,
> LASTDATE datetime not null,
> ACTIVITY_IND varchar(1) null,
> constraint ACTIVITY_TABLE primary key (ACTIVITY_DEPT_CODE,
> ACTIVITY_CODE)
> )
> Go
>
>