SQL Assistance

Pho3nix

The Legend
Joined
Jul 31, 2009
Messages
32,829
Reaction score
3,033
Location
On the toilet
Looking to create a stored procedure that will give me a table that already exist's with the database but with a new Identifier. Is this the best way to create a new identifier as the current identifier's as they are already being used in the solution meaning I need a new one that I can parse values too.

Hope this makes sense. This is what I have so far.

Code:
CREATE PROCEDURE usp_FetchPackage
(
	@P_ID GUID = NULL
)
AS 
BEGIN 
SET NOCOUNT ON;
SELECT [TaskUID]
      ,[TaskParentUID]
      ,[ProjectUID] 
      ,[TaskName]
      
  FROM [TEST_Reporting].[dbo].[EpmTask]
    
  WHERE (@P_ID IS NULL OR ProjectUID = @P_ID)
  
  GO

Ok, is something wrong with my syntax?
 
Last edited:
Syntax looks fine - but it would help if you told us what is going wrong in the first place, and what you are trying to achieve? I don't understand from your explanation.
 
Ok, I'm trying to parse the ProjectGUID's info to the P_ID identifier. I need to do this as the SharePoint wont allow me to mapped an already mapped identifier which I need to do to create the association between the two external types.
Link : Explaining the error a little better maybe if your still confused.
 
Code:
CREATE PROCEDURE usp_FetchPackage
(
	@P_ID GUID = NULL
)
AS 
BEGIN 
SET NOCOUNT ON;
SELECT [TaskUID]
      ,[TaskParentUID]
      ,[ProjectUID] 
      ,[TaskName]
      
  FROM [TEST_Reporting].[dbo].[EpmTask]
    --WHERE (@P_ID IS NULL OR ProjectUID = @P_ID)
  WHERE (ProjectUID IS NULL OR ProjectUID = @P_ID)
  
GO
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X