Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 23rd, 2007, 10:53 AM
Registered User
 
Join Date: May 2007
Location: Toronto, On, Canada.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating Index on View - SQL

Hi,

I am trying to create in dexes on view but it need to bound with Schema bound (which is false on view).
Colud you please advise
a) how can I change Schema bound to True (if we can do by GUI)
b) Or we can create index without that

thaks


AA
Reply With Quote
  #2 (permalink)  
Old May 23rd, 2007, 11:43 AM
Authorized User
 
Join Date: Oct 2005
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

a. To make your schema bound, in Enterprise Manager right-click on your view and select "Design View". Right-click on the window again and select Properties from the context menu. Then put a check mark in the "Bind to Schema" option.

b. You cannot create an indexed view without schema binding.

SQL Server Helper
How well do you know SQL? Find out with the free test assessment from SQL Server Helper!!!
http://www.sql-server-helper.com/free-test/default.aspx

Got a SQL Server Question? Ask us here: http://www.sql-server-helper.com/forums/default.asp
Reply With Quote
  #3 (permalink)  
Old May 23rd, 2007, 12:02 PM
Registered User
 
Join Date: May 2007
Location: Toronto, On, Canada.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using SQL 2005 :

On my view I did right-click but I don't see "Design View" but there is anotner option "New View" should I select this?

I am not sure if I am doing something wrong??
Thanks


AA
Reply With Quote
  #4 (permalink)  
Old May 24th, 2007, 01:44 AM
Authorized User
 
Join Date: Jun 2005
Location: , , Philippines.
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to aldwinenriquez
Default

Right click on the view and Script View as Alter to a new query window. then add this line of code

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[VW_ViewName] with schemabinding
AS

Make sure SET QUOTED_IDENTIFIER is ON


"Dont you ever give up!"
Reply With Quote
  #5 (permalink)  
Old May 24th, 2007, 06:53 AM
Registered User
 
Join Date: May 2007
Location: Toronto, On, Canada.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for advise - it worked :)

AA
Reply With Quote
  #6 (permalink)  
Old September 7th, 2011, 07:35 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I couldn't understand properly. My view code is as shown below:

Code:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER VIEW [dbo].[B2]
AS
 
"SQL QUERY"

GO

SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
Shall I only change "ALTER VIEW [dbo].[B2]" section with "ALTER VIEW [dbo].[B2] with schemabinding"??


Many thanks
telmessos
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Index carumuga SQL Server 2000 1 September 26th, 2008 04:10 PM
Cannot index the view '. It contains one or more d RehanHussain SQL Server 2000 2 April 12th, 2008 03:57 PM
SQL view creating Cute Designer SQL Server ASP 1 September 21st, 2005 03:00 PM
Index View Asish SQL Server 2000 1 November 7th, 2003 01:12 PM
View dynamic content with MS Index Server? shogunmike Classic ASP Basics 0 June 26th, 2003 12:39 PM



All times are GMT -4. The time now is 08:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.