Questions tagged [indexed-view]

142 questions
0
votes
1 answer

Specify decimal precision of column in a SQL Server indexed view

I am wondering if it's possible to override the default column precision of columns within an indexed view. The view seems to always create the columns with the largest possible precision. A complete run-able example is below: -- drop and recreate…
Craig
  • 21
  • 3
0
votes
1 answer

Indexed view and T-sql that give same results as DISTINCT in SQL Server 2008 R2

I want to create indexed view MyView with such t-sql Select o.Theme_ID as Theme_ID, DATEADD(day, DATEDIFF(day, 0, o.Object_CreationDate), 0) as Objext_CreationDate, Count_BIG(*) as ObjectCount, o.Object_Tonality from [dbo].Object…
arena-ru
  • 990
  • 2
  • 12
  • 25
0
votes
2 answers

Can't create indexed view with schemabinding

I'm trying to script a pretty straight-forward indexed view but SQL is simply refusing my efforts. I've tried researching the issue but haven't had any luck, and unfortunately I'm not exactly a SQL expert so I'm not sure if there's something simple…
thanby
  • 323
  • 1
  • 6
  • 22
0
votes
0 answers

I can't create clustered index on view in Microsoft SQL Server 2014 Express

I wanted to create clustered index on view in order to obtain materialized view. Unfortunately the option to create index on view is disabled (faded). Do you know why? I am using Microsoft SQL Server 2014 Express. All the best Bartosz Siemasz
Bartosz Siemasz
  • 296
  • 1
  • 10
0
votes
1 answer

requirements for an Indexed View

I am currently working towards my certification in SQL Server 70-461. I'm working through some practice tests at the moment and have come across a question on requirements for an indexed view. I understand that indexed views must have SCHEMABINDING…
Beau6601
  • 51
  • 1
  • 3
0
votes
1 answer

Is it possible to make an Indexed View for a particular result I want?

Is it possible to create an indexed view which returns the following results :- ID | Location Name | Aliases for that Location 1 | Some Location | Alias 1, Alias 2, Alias 3 2 | Another Location | NULL 3 | Yet Another Location | NULL 4 | Last…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
0
votes
0 answers

Check constraint on partitioned tables in MSSQL

In our MSSQL server 2008 R2 environment, we have a table which we have partitioned based on a yearly partition function. We need to define a view on this table and want to take advantage of table partitioning while running query on this query. …
0
votes
2 answers

What types of aggregates can I use to create indexed view

I have been trying to figure out what kinds of aggregates I can use to create indexed view. FYI: I was I able to create one with SUM(). I also found that I can't create indexed view with MIN, MAX and AVG. How about others? It is possible? I couldn't…
Dilshod
  • 3,189
  • 3
  • 36
  • 67
0
votes
2 answers

iPhone contacts app styled indexed table view implementation

My Requirement: I have this straight forward requirement of listing names of people in alphabetical order in a Indexed table view with index titles being the starting letter of alphabets (additionally a search icon at the top and # to display misc…
0
votes
1 answer

How can I provide an Index Hint to a MS-SQL Server Indexed View?

I have an indexed view FooView. I've created the following indexes against it: CREATE UNIQUE CLUSTERED INDEX IX_Foo1 ON [FooView](SomeId, AnotherId) CREATE NONCLUSTERED INDEX IX_Foo2 ON [FooView](SomeId) Is it possible to use a HINT against…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
0
votes
1 answer

filtered index or indexed view for Soft-delete with deleteAt dateTime column?

We use a deleteAt column to specify whether something is active or (soft) deleted. Which technique is best going forward for querying active contents? Would a filtered index on the actual table better, or an indexed view with deleteAt is NULL? Is…
Henry
  • 32,689
  • 19
  • 120
  • 221
0
votes
1 answer

A better way to get table statistics

I'm developing a SQL Server 2012 Express and developer edition (with latest Service Pack) solution. In my database I have a table CODES with codes. This table has a FLAG column indicating that a code has been printed, read or dropped. Codes are…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
0
votes
2 answers

Unable to Create Indexed View

I am trying to put an index on a view but keep running into the issue where I get an error because the select list of the view contains an expression on result of aggregate function or grouping column. Consider removing expression on result of…
0
votes
1 answer

Full-text index population performance on a SQL 2005 indexed view

I have created an indexed view: CREATE VIEW LogValueTexts WITH SCHEMABINDING AS SELECT ISNULL(LRVS_SLOG_ID*256+LRVS_IDX,0) AS ID,LRVS_VALUE AS Value FROM dbo.LRVS_LogRecordedValues WHERE LEN(LRVS_VALUE)>4 CREATE UNIQUE CLUSTERED INDEX…
Pent Ploompuu
  • 5,364
  • 1
  • 27
  • 47
0
votes
2 answers

Indexed views on SQL Server 2008 R2

I have a SQL Server 2008 R2 database containing a very huge table that we use for reporting. Every night around 40,000 records are inserted into the table. I read in many articles that Indexed views are suitable for OLAP or Warehouse databases, not…
1 2 3
9
10