Hello,
I have one table in sql server as below.
s_no image_path item_code
1 \\144.44.12.229\Packing List\\RG65083.JPG
here the item_code should be extracted from the image_path(eg: it should be 'RG65083' for the above record.
I'm creating a function to get the above output as below.
USE [design]
GO
/****** Object: UserDefinedFunction [dbo].[GetModelNoFromFilePath] Script Date: 09/11/2017 14:31:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
ALTER FUNCTION [dbo].[GetModelNoFromFilePath]
(
)
RETURNS varchar(50)
AS
BEGIN
Declare @ModelNo varchar(50)
set @ModelNo=(select substring(image_path,30,100) from images)
return @ModelNo
END
But I'm getting error as "The multi-part identifier "dbo.GetModelNoFromFilePath" could not be bound."
Please help.