Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
neil_akoga
Yak Posting Veteran
56 Posts |
Posted - 2011-04-18 : 10:57:34
|
| i'm creating a view and want to setup fulltext indexing. how do i create a unique id for my view. the sql for the view is as followsselect dbo.tscw.webcat_id as firstcatid, dbo.tscw.webcat_category_name as firstcatname, dbo.tscw.webcat_intro_text as firstcatintrotext, dbo.tscw.webcat_materials as firstcatmaterials, dbo.tscw.webcat_capacities as firstcatcapacities, dbo.tscw.webcat_finishes as firstcatfinishes, dbo.tscw.webcat_applications as firstcatapplications, dbo.tscw.webcat_printing_options as firstcatprintopt, dbo.tscw.webcat_group_image as firstcatgroupimage, dbo.tscw.webcat_brief as firstcatbrief, dbo.tscw.webcat_sequence as firstcatsequence, dbo.tscw.webcat_fact_sheet_file as firstcatfactsheetfile, dbo.tscs.webcats_id as secondcatid, dbo.tscs.webcats_category_name as secondcatname, dbo.tscs.webcats_intro_text as secondcatintrotext, dbo.tscs.webcats_group_image as secondcatgroupimage, dbo.tscs.webcats_brief as secondcatbrief, dbo.tscs.webcats_sequence as secondcatsequence, dbo.tscs.webcats_fact_sheet_file as secondcatfactsheetfile, dbo.tsct.webcatt_id as thirdcatid, dbo.tsct.webcatt_category_name as thirdcatname, dbo.tsct.webcatt_intro_text as thirdcatintrotext, dbo.tsct.webcatt_group_image as thirdcatgroupimage, dbo.tsct.webcatt_brief as thirdcatbrief, dbo.tsct.webcatt_sequence as thirdcatsequence, dbo.tsct.webcatt_fact_sheet_file as thirdcatfactsheetfilefrom dbo.tscw inner join dbo.ts_custom_form_link as primseclink on dbo.tscw.webcat_id = primseclink.cfln_parent_form_id and primseclink.cfln_parent_form_type_code = 'cf_webcat' inner join dbo.tscs on primseclink.cfln_child_form_type_code = 'cf_secondcats' and primseclink.cfln_child_form_id = dbo.tscs.webcats_id left outer join dbo.ts_custom_form_link as sectertlink on dbo.tscs.webcats_id = sectertlink.cfln_parent_form_id and sectertlink.cfln_parent_form_type_code = 'cf_secondcats' left outer join dbo.tsct on sectertlink.cfln_child_form_type_code = 'cf_thirdcats' and sectertlink.cfln_child_form_id = dbo.tsct.webcatt_id |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-04-18 : 11:03:43
|
| Do you want full text indexing or an indexed view.Could be looking up the right thing in bol will solve the issue.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
neil_akoga
Yak Posting Veteran
56 Posts |
Posted - 2011-04-18 : 11:11:32
|
| well when i go to use the wizrd to setup the indexing it comes back with an error saying A unique column must be defined on this table/view.so i presume i need a unique index on the view? |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-04-18 : 11:31:52
|
| Have a look at indexed views in bol.To create an indexed view you add a clustered unique index on it which will materialise the view.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-04-18 : 11:59:59
|
do not use wizards, could come back to bite you CREATE VIEW dbo.vw_CategoriesWITH SCHEMABINDINGSELECT dbo.tscw.webcat_id AS firstcatid, dbo.tscw.webcat_category_name AS firstcatname, dbo.tscw.webcat_intro_text AS firstcatintrotext, dbo.tscw.webcat_materials AS firstcatmaterials, dbo.tscw.webcat_capacities AS firstcatcapacities, dbo.tscw.webcat_finishes AS firstcatfinishes, dbo.tscw.webcat_applications AS firstcatapplications, dbo.tscw.webcat_printing_options AS firstcatprintopt, dbo.tscw.webcat_group_image AS firstcatgroupimage, dbo.tscw.webcat_brief AS firstcatbrief, dbo.tscw.webcat_sequence AS firstcatsequence, dbo.tscw.webcat_fact_sheet_file AS firstcatfactsheetfile, dbo.tscs.webcats_id AS secondcatid, dbo.tscs.webcats_category_name AS secondcatname, dbo.tscs.webcats_intro_text AS secondcatintrotext, dbo.tscs.webcats_group_image AS secondcatgroupimage, dbo.tscs.webcats_brief AS secondcatbrief, dbo.tscs.webcats_sequence AS secondcatsequence, dbo.tscs.webcats_fact_sheet_file AS secondcatfactsheetfile, dbo.tsct.webcatt_id AS thirdcatid, dbo.tsct.webcatt_category_name AS thirdcatname, dbo.tsct.webcatt_intro_text AS thirdcatintrotext, dbo.tsct.webcatt_group_image AS thirdcatgroupimage, dbo.tsct.webcatt_brief AS thirdcatbrief, dbo.tsct.webcatt_sequence AS thirdcatsequence, dbo.tsct.webcatt_fact_sheet_file AS thirdcatfactsheetfileFROM dbo.tscwINNER JOIN dbo.ts_custom_form_link AS primseclink ON dbo.tscw.webcat_id = primseclink.cfln_parent_form_id AND primseclink.cfln_parent_form_type_code = 'cf_webcat'INNER JOIN dbo.tscs ON primseclink.cfln_child_form_type_code = 'cf_secondcats' AND primseclink.cfln_child_form_id = dbo.tscs.webcats_idLEFT OUTER JOIN dbo.ts_custom_form_link AS sectertlink ON dbo.tscs.webcats_id = sectertlink.cfln_parent_form_id AND sectertlink.cfln_parent_form_type_code = 'cf_secondcats'LEFT OUTER JOIN dbo.tsct ON sectertlink.cfln_child_form_type_code = 'cf_thirdcats' AND sectertlink.cfln_child_form_id = dbo.tsct.webcatt_id CREATE UNIQUE CLUSTERED INDEX IDX_?? ON vw_Categories (??);GO If you don't have the passion to help people, you have no passion |
 |
|
|
neil_akoga
Yak Posting Veteran
56 Posts |
Posted - 2011-04-19 : 04:03:05
|
| what would replace the ?? in the sql statement |
 |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2011-04-19 : 16:03:29
|
| the unique index you want to useIf you don't have the passion to help people, you have no passion |
 |
|
|
|
|
|
|
|