1

Topic: Does not materialize a calculated column because of it

Kind time of days!
I try to create  the table with a rated column which should be materialized:

CREATE TABLE Geographical_koordinates (
Id_Geographical_koordinates int NOT NULL IDENTITY (1,1) PRIMARY KEY;
Koordinate geography NOT NULL;
SRID INT NULL;
Radius_action INT;
All_koordinates_area AS Koordinate. STBuffer (Radius_action) PERSISTED;
Koordinate_text AS Koordinate. STAsText () PERSISTED;
All_koordinates_area_txt AS dbo. AreaInText (Koordinate, Radius_action) PERSISTED;
Heigh_sea_level int NULL;
description nvarchar (50) NULL);
GO

Function:

CREATE FUNCTION [dbo]. [AreaInText] (@Koordinate geography, @Radius_action int)
RETURNS nvarchar (max)
AS
BEGIN
DECLARE @area geography;
DECLARE @areaText nvarchar (max);
SET @area = Koordinate. STBuffer (@Radius_action);
SET @areaText = area. STAsText ();
RETURN (@areaText);
END
GO

In 8th line I use function which does not address to the exterior data and uses only functions STAsText () and STBuffer () which did not find in the list determined and not determined. But as for 6 and 7 line where the same functions SQL are used does not swear and accepts them accordingly they should be determined. But for some reason produces an error:

The message 4936, level 16, state 1, line 4
It is impossible to materialize a calculated column "All_koordinates_area_txt" in the table "Geographical_koordinates" as it is not determined.

Why the column all the same turns out not determined?
It can be corrected somehow?

2

Re: Does not materialize a calculated column because of it

Vlad __ i __ mir;
Well to begin with WITH SCHEMABINDING

3

Re: Does not materialize a calculated column because of it

TaPaK wrote:

Vlad __ i __ mir;
Well to begin with WITH SCHEMABINDING

It is possible more in detail, did not understand that means

4

Re: Does not materialize a calculated column because of it

Vlad __ i __ mir;

CREATE FUNCTION [dbo]. [AreaInText] (@Koordinate geography, @Radius_action int)
RETURNS nvarchar (max)
WITH SCHEMABINDING
AS
...

5

Re: Does not materialize a calculated column because of it

TaPaK wrote:

Vlad __ i __ mir;

CREATE FUNCTION [dbo]. [AreaInText] (@Koordinate geography, @Radius_action int)
RETURNS nvarchar (max)
WITH SCHEMABINDING
AS
...

Thanks! I read that SCHEMABINDING is used for representations that it was impossible to change the underlying table in such a way which can affect view definition. And here on what it superimposes restriction?

6

Re: Does not materialize a calculated column because of it

Vlad __ i __ mir wrote:

it is passed...
Thanks! I read that SCHEMABINDING is used for representations that it was impossible to change the underlying table in such a way which can affect view definition. And here on what it superimposes restriction?

That you do not change function, without deleting it beforehand from default

7

Re: Does not materialize a calculated column because of it

msLex wrote:

it is passed...
That you do not change function, without deleting it beforehand from default

Thanks! And what such default?