Results 1 to 4 of 4

Thread: MS SQL error: There is insufficient system memory

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    MS SQL error: There is insufficient system memory

    Getting this error message on an MS SQL DB that I am just cobbling together - running on a GoDaddy server.

    Msg 701, Level 17, State 123, Line 1
    There is insufficient system memory in resource pool 'internal' to run this query.

    Trying to run this Scalar Function:

    Select dbo.GetName_F ('Smith, John',2)

    The error is hiding something else. Any thoughts on where I can start looking?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: MS SQL error: There is insufficient system memory

    I've got 8 GB of installed RAM...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: MS SQL error: There is insufficient system memory

    You don't specify server and db size.
    But what I would personal be doing initial would be checking the autogrow of tempdb, checking the Maximum server memory property and trying to see if the query would run on a similar non function Tsql.
    Also db size? Is it high, maybe that would be an issue but not sure on that.
    Secondly, I know nothing about GoDaddy server but maybe the allocation of system memory to applications memory becomes and issue?
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  4. #4

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: MS SQL error: There is insufficient system memory

    MS SQL Server 2019...and all DB's and Log's are looking pretty small to me

    The guts of the function runs outside the function - just in query window.

    It's cutting the first name off - really silly simple stuff.

    Something is way off here on some server setting.

    I've been running the BIDS database for almost a year with no problems from those users.

    I'm setting up a personal use DB (the ACS one) for myself and can't get something simple to run.

    Code:
    Use ACS
    Go
    DROP Function dbo.GetName_F
    Go
    
    SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GO
    
    CREATE FUNCTION dbo.GetName_F (@Name as varchar(50),@Opt as tinyint)
    RETURNS varchar(50) AS  
    BEGIN 
    	Declare @WN as varchar(50)
    
    	Declare @FN as varchar(50)
    	Declare @LN as varchar(50)
    	Declare @SN as varchar(50)
    
    	Declare @C1 as int
    	Declare @C2 as int
    
    	Set @WN=@Name
    
    	Set @C1=CharIndex(',',@WN)
    
    	If @Opt=0
    	Begin
    		Set @C1=CharIndex(',',@WN)
    		If @C1 = 0 Set @C1=Len(@WN)+1
    		Set @C2=CharIndex(',',@WN,@C1+1)
    		If @C2=0
    		Begin
    			If @C1>Len(@WN)
    				Set @FN=''
    			Else	Set @FN=LTrim(Right(@WN,Len(@WN)-@C1))
    			Set @SN=''
    		End
    		Else
    		Begin
    			Set @FN=RTrim(LTrim(SubString(@WN,@C1+1,@C2-@C1-1)))
    			Set @SN=LTrim(Right(@WN,Len(@WN)-@C2+1))
    		End
    		Set @LN=RTrim(Left(@WN,@C1-1))
    		Set @WN=LTrim(@FN+' '+@LN+@SN)
    	End
    	Else
    	Begin
    		If @Opt=1
    		Begin
    			If @C1<>0 Set @WN=Left(@WN,@C1-1)
    		End
    	
    		If @Opt=2
    		Begin
    			If @C1=0
    				Set @WN=''
    			Else	Set @WN=LTrim(Right(@WN,Len(@WN)-@C1))
    		
    			Set @C1=CharIndex(',',@WN)
    			If @C1<>0 Set @WN=Left(@WN,@C1-1)
    		
    			Set @C1=CharIndex(' ',@WN)
    			If @C1<>0 Set @WN=Left(@WN,@C1-1)
    		End
    	
    		If @Opt=3
    		Begin
    			If @C1=0
    				Set @WN=''
    			Else	Set @WN=LTrim(Right(@WN,Len(@WN)-@C1))
    		
    			Set @C1=CharIndex(',',@WN)
    			If @C1<>0 Set @WN=Left(@WN,@C1-1)
    		
    			Set @C1=CharIndex(' ',@WN)
    			If @C1<>0
    				Set @WN=Right(@WN,Len(@WN)-@C1)
    			Else	Set @WN=''
    	
    			Set @C1=CharIndex(' ',@WN)
    			If @C1<>0 Set @WN=Left(@WN,@C1-1)
    		End
    	
    		If @Opt=4
    		Begin
    			If @C1<>0 Set @C1=CharIndex(',',@WN,@C1+1)
    			If @C1<>0
    				Set @WN=Right(@WN,Len(@WN)-@C1-1)
    			Else	Set @WN=''
    		End
    	End
    
    	RETURN @WN
    END
    GO
    
    --GRANT EXECUTE ON GetName_F TO CustomerUser
    GO
    
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO
    Attached Images Attached Images  

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width