No data in database view of versioned feature class

81
4
08-29-2019 01:29 PM
New Contributor III

If I have a view of versioned data how do i get the view to return data before the feature class it references is reconciled with the default version of the geodatabase?

Reply
0 Kudos
4 Replies
Esri Frequent Contributor

You need to be set the version that you want to see in the view; Read versioned data in SQL Server using versioned views—Help | ArcGIS Desktop 

That should get you what you want.

--- George T.
Reply
0 Kudos
New Contributor III

I am able to do that in a ssms query window, but the view I created always reads from default.  I would like to be able to specify which version of the geodatabase the view reads from.  Thanks.

Reply
0 Kudos
Esri Frequent Contributor

You need to create a view in SSMS and put that SQL to change the version in the view.

--- George T.
Reply
0 Kudos
New Contributor III

I used this to create the view:

USE [Our Database]
GO

EXEC database.sde.set_current_version 'the version'

/****** view info******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

but when I script out the view to a new query window, the exec is not there:

USE [Our Database]
GO

/****** view info******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

is there something else I need to do?

Thanks.

Reply
0 Kudos