|
jparker
Posting Yak Master
118 Posts |
Posted - 10/27/2005 : 07:38:19
|
I have the following script
create table tblestimateusage (id_num int IDENTITY(1,1), est_id varchar(50), title varchar(200), flatsize varchar(50), finishedsize varchar(50), pages varchar(50), client_name varchar(150), process varchar(7000) )
insert into tblestimateusage (est_id,title,flatsize,finishedsize,pages, client_name, process) select e.est_id, title, flatsize, finishedsize, pages, client_name, [dbo].[ufn_GetProcesses] ( [est_id] ) from tbltest e join tblcl c on c.client_id = e.client_id where est_datetime > '20050901' select * from tblestimateusage
Which uses the following function
ALTER FUNCTION [dbo].[ufn_GetProcesses] ( @ID INT ) RETURNS VARCHAR(6000) AS BEGIN DECLARE @ProcessValue VARCHAR(6000) SELECT @ProcessValue = ISNULL(@ProcessValue + ', ', '') + [process_name] + ' ' + [process_value] FROM [dbo].[tblmyprocess] WHERE [est_id] = @ID RETURN @ProcessValue
END
This works fine on some occassions but has a problem when either the line hits 8060 bytes then it bombs out or truncating the string via the function.
How do I allow truncation? |
|