No Aspnet_regsql.exe in Framework 3.0 or 3.5

by Glenn 18. January 2009 07:51

Trying to buld a ASP.net project, i needed to set up the SQL database with the defualt tables for the providers. 

Normaly you just run the following wizard:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe

 

But there is none for v3.0 or v3.5.  Unknowing if the providers are backward compatible, i found the following MSDN Article.  Stating:

Regardless of what version of the .NET Framework you are working with, the Aspnet_regsql.exe file is located in the following folder on the Web server computer:

[drive:]\%windir%\Microsoft.NET\Framework\v2.0.50727

Currently rated 5.0 by 10 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , , , , , , , , , , ,

Querying a Indexing Service from SQL Using OPENQUERY from a Remote Server

by Glenn 16. September 2008 16:24

  The goal is to be able to use OpenQuery in SQL2005 scripts to be able to query a Windows Indexing Service.  This is an easy way of keeping your existing SQL data layer (assuming you have one) to be able to list/search the files on your system; which will be returned in SQL result set format. Opposed to having to make a whole new data layer to query the file system.  
  Usage:

 Make a simple file management system with - If you want to track files in the database but don’t want to store the actual file in the database and still want to be able to be full text searched.  By executing the file indexing search via OPENQUERY in SQL you can join the Indexing Service results with your table in the database (linking on the filename).
 
  Task 1: Connect to the local Indexing Service on the SQL Server

*To get started, make sure that you have installed and configured Indexing Service on the same machine that you have the SQL Server installed on.
*Make a new catalog in the Indexing Service that you want to be able to query on.
    Step by Step instruction to set up the Indexing Service:
    Microsoft Indexing Service HOW-TO[CodeProject]
*Create a link on your SQL Server to the Indexing Service
sp_addlinkedserver MSIDXS, 'Index Server', 'MSIDXS', 'System'
    This will create a link in SQL called 'MSIDXS' that will access the local Indexing Service
*Write an OpenQuery to test out the linked server
 select * FROM OpenQuery(MSIDXS, 'Select Directory, FileName, Size,Characterization FROM FILECATALOG..SCOPE() WHERE FREETEXT(''blah'')>0'))
Replace FILECATALOG with the name of the catalog you created in the Indexing Service.  You can try SYSTEM which is created by default if you haven't created one yet.
    This is just an example query, take a look at the Indexing Services query definition for a full spec.
    
  Task 2: Be able to query an Indexing Service on a remote server

This is the part that really tripped me up.  The rest of the process is very straight forward, but to find the way to link a remote Indexing Service was very time consuming and in the end is very simple. It's just not documented anywhere.

Set up needed: Indexing Services apparently can only interact with other Indexing Services remotely.  With that said, no matter what your server configuration is, you must have Indexing Service running on the SQL server.  As long as it is running, you can you it as a proxy to connect to any other Indexing Services. And make sure it is set up as a linked server.
Now the really hard part: Do everything we did above to query it, except add the server name in front of the catalog.  Make FILECATALOG now be SERVERNAME.FILECATALOG; where SERVERNAME is the remote server with the Indexing Service and the CATALOGNAME  is the remote catalog name.

select * FROM OpenQuery(MSIDXS, 'Select Directory, FileName, Size,Characterization FROM SERVERNAME.FILECATALOG..SCOPE() WHERE FREETEXT(''blah'')< 0')

    
Now you should be able to query any Indexing Service from your SQL Server.

Currently rated 5.0 by 4 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

The Good Fat of Software Development

by Glenn 16. September 2008 16:22

As any blog starts out you have to make a first entry.  The first entry usually says something like "this is my first entry, hear me roar!" But we'll quickly move past the awkward first words and move into some meat.

Some basic pre-Blog Q & A

What are you going to be blogging about?

The short answer would be to create another repository on the web that answers the indepth questions about software development. When I come across those pesky specific questioned that need to be answered for my daily development tasks (that the man has assigned me to) or just in my fiddlings, I look to our good friend Google who can sometimes find me a good answer (that is after i weed my way through the "intro to ..." links with 3 pages on basic usage or the "tips" pages that really just show us how to use the API). Not that those tutorials aren't helpful, it's after I've mastered the basics I want to know more. I find there are few resources out there that go that next step. We all have gone through the same trials and tribulations to extend that control, or overload that event correctly. But why don't more people document it on the web. Well here is one more resource available, my gift to you.

What kind of things will be discussed?

Well all kinds; Web applications, windows application, all the underlying juiciness. We'll mostly stay with the Micro$oft platforms, but we can still have.

Why this named 'Cado Blogo: The good fat of development'?

Easy answer, I really like avocados, you know they are full of the 'good' fat.  And a little reverse alliteration(if that's a real thing) to make it sound fun.

 

So lets call it a day since no one is reading this yet. And I'll see you back here will some actual content.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

Links