I have a query thats taking long time to execute. So i have created a Materialized view to refresh it every hour. But when the Materialized view is being refreshed, there is no data in the Materialized view table. I think it truncates the table before every refresh.
Is there any way to keep the old data while its being refreshed.?
User Profile
Collapse
-
Materialized view Refresh
-
Its not an assignment.I have come up with the below solution.
CREATE FUNCTION [dbo].[StringToTable]
(
@inputString nvarchar(max),
@separator char (1),
@tokens int
)
RETURNS nvarchar(4000)--@ResultTable TABLE ( [String] nvarchar(max) )
AS
BEGIN
DECLARE @ResultTable TABLE ( [String] nvarchar(max) )
DECLARE @ResultVar nvarchar(4000)
DECLARE @stringToInsert nvarchar... -
Substring in SQL server
Hi Folks...
I have a string in the format '1.2.3.4.5.6'. I have to write a generic function that will take integer as paramater and will return the string as follows for the above input.
- ParamaterValue : Output.
- 1 : 1
- 2 : 1.2
- 3 : 1.2.3
- 4 : 1.2.3.4
No activity results to display
Show More
Leave a comment: