[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SINTAX ERROR IN SP

Posted on 2011-10-14
7
Medium Priority
?
196 Views
Last Modified: 2012-05-12
HELLO EXPORTS. ATTACHED IS THE SP I'M HAVING TROUBLE WITH.
THANKS  
SP.txt
0
Comment
Question by:lancerxe
  • 4
  • 3
7 Comments
 
LVL 11

Expert Comment

by:rajvja
ID: 36968419
Hi,

   Which line you are getting error. I guess, the syntax for identity column is Id INT IDENTITY(1,1) NOT NULL PRIMARY KEY

If not, post the line
0
 

Author Comment

by:lancerxe
ID: 36968434
IF (@Project  = 'SmartCare')
0
 
LVL 11

Expert Comment

by:rajvja
ID: 36968457
Where is the END statement for WHILE loop
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 

Author Comment

by:lancerxe
ID: 36968458
error mesaage
Msg 156, Level 15, State 1, Procedure usp_QA_Defects_1_Business_Area, Line 80
Incorrect syntax near the keyword 'IF'.
Msg 156, Level 15, State 1, Procedure usp_QA_Defects_1_Business_Area, Line 110
Incorrect syntax near the keyword 'AND'.
0
 
LVL 11

Expert Comment

by:rajvja
ID: 36968497
Hi,

      INSERT STATEMENT should be inside IF STATEMENT

Otherwise it is assuming that VALUES caluse but fount IF statement
0
 
LVL 11

Accepted Solution

by:
rajvja earned 2000 total points
ID: 36968511

SELECT @Month = Month FROM dbo.QA_MonthIDLookup
            WHERE MonthID = @MonthID
       
          
       
--Calculate bugs
IF (@Project  = 'SmartCare')
        INSERT INTO tmpQA_Defects1BusinessArea(MonthYear, BusinessArea, NumOfDefects)
            SELECT
            @Month AS MonthYear, i.Project As BusinessArea, COUNT(*) AS BugNum
            FROM dbo.Bug b  
            INNER JOIN dbo.Iteration i ON i.IterationID = b.IterationID          
               
            WHERE(b.Latest = 1)
            AND b.Deleted = 0
            AND b.CollectionID = 2
            AND i.Project = @Project
            AND RTRIM(convert(char(2),DATEPART(M,DateCreated))) + '/' + convert(char(4),DATEPART(YEAR,DateCreated)) = @Month
         
            AND ((b.State = 'Active' AND  b.Triage = 'Triaged') OR b.State = 'Closed')
            GROUP BY i.Project

ELSE IF(...)
0
 

Author Comment

by:lancerxe
ID: 36968588
i will try that. thanks rajvja.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question