Showing posts with label implement. Show all posts
Showing posts with label implement. Show all posts

Tuesday, March 20, 2012

Automatic text completion

I'm not entirely sure this is the place for it but I need to implement an automatic text completion function.

I'd like to know if there is something, such as a built-in function, that could help me.
The best idea I have is to create some sort of node tree and work with that but there has to be a better way.

I need to do it in C# or in MS SQL. Any kind of help is much appreciated!
YOu should either write your request to a platform group, e.g. WIndows Applications with C# or Web.Applications with C#, this mainly has nothing do to with SQL Server, more with the frontend you will create.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||Actually I implemented it with SQL and it works rather well I must admit.
It returns:
"Emma Strandberg"
Since there is a Firstname Emma and her last name is Strandberg

SQL Code

DECLARE @.match varchar(15)

SET @.match = 'Em'

/* SET NOCOUNT ON */

SELECT (Firstname + ' ' + Lastname) AS Wholename
FROM CMR_Arrivals
WHERE SUBSTRING(Lastname, 1, LEN(@.match)) = @.match
OR SUBSTRING(Firstname, 1, LEN(@.match)) = @.match

|||

And it will also return 'Bill Emerson'

However, you asked about

Automatic text completion

. Your 'solution' has absolutely nothing to do with auto-completion.

Yes, your search 'kinda' works to find the data you seek. One consideration is that by wrapping the column with a function, substring(), you guarantee that the process will NOT be able to efficiently use indexing. On a large table, that can be a bit slow.

You may wish to refer to Books Online about the use of Wildcards in search criteria.

See Books Online, Topics:

Wildcards LIKE 'Pattern Matching in Search Conditions'|||

The query will be used with AJAX AutoComplete(Extender Toolkit) and the results will be limited hence the returned value wont be so many.

You are right in that it's not exactly what I was originally looking for!

Peter Ritchie (MVP) suggested:

" Sounds like what you want is AutoComplete, e.g. TextBox.AutoCompleteCustomSource.

Ken Getz has a good overview of the feature here: http://code-magazine.com/Article.aspx?quickid=0509111"

Where I replied:

" Sounds like something I was looking for BUT I was going to use the AutoCompleteExtender in the ASP.NET AJAX Toolkit.

Now I don't mind skipping the AJAX control but when looking at a Textbox the only option I have is AutoCompleteType.

None of the other functions such as AutoCompleteCustomSource are available.

I have .Net 2.0 installed and does say TextBox 2.0.0.0 .Net when holding the mouse over the control in VS2005.

Am I missing something here?
"

|||

Typically, he way 'autocomplete' functionality works is that a set of data has been retrieved from the database, as as the user types into the textbox control, the textchanged event is used to update the filter on the data.

Alternatively, on each keystroke, the textchanged event could be used to re-run the query to the data server.

BUT that is a very bad idea in terms of system performance.

Automatic text completion

I'm not entirely sure this is the place for it but I need to implement an automatic text completion function.

I'd like to know if there is something, such as a built-in function, that could help me.
The best idea I have is to create some sort of node tree and work with that but there has to be a better way.

I need to do it in C# or in MS SQL. Any kind of help is much appreciated!
YOu should either write your request to a platform group, e.g. WIndows Applications with C# or Web.Applications with C#, this mainly has nothing do to with SQL Server, more with the frontend you will create.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||Actually I implemented it with SQL and it works rather well I must admit.
It returns:
"Emma Strandberg"
Since there is a Firstname Emma and her last name is Strandberg

SQL Code

DECLARE @.match varchar(15)

SET @.match = 'Em'

/* SET NOCOUNT ON */

SELECT (Firstname + ' ' + Lastname) AS Wholename
FROM CMR_Arrivals
WHERE SUBSTRING(Lastname, 1, LEN(@.match)) = @.match
OR SUBSTRING(Firstname, 1, LEN(@.match)) = @.match

|||

And it will also return 'Bill Emerson'

However, you asked about

Automatic text completion

. Your 'solution' has absolutely nothing to do with auto-completion.

Yes, your search 'kinda' works to find the data you seek. One consideration is that by wrapping the column with a function, substring(), you guarantee that the process will NOT be able to efficiently use indexing. On a large table, that can be a bit slow.

You may wish to refer to Books Online about the use of Wildcards in search criteria.

See Books Online, Topics:

Wildcards LIKE 'Pattern Matching in Search Conditions'|||

The query will be used with AJAX AutoComplete(Extender Toolkit) and the results will be limited hence the returned value wont be so many.

You are right in that it's not exactly what I was originally looking for!

Peter Ritchie (MVP) suggested:

" Sounds like what you want is AutoComplete, e.g. TextBox.AutoCompleteCustomSource.

Ken Getz has a good overview of the feature here: http://code-magazine.com/Article.aspx?quickid=0509111"

Where I replied:

" Sounds like something I was looking for BUT I was going to use the AutoCompleteExtender in the ASP.NET AJAX Toolkit.

Now I don't mind skipping the AJAX control but when looking at a Textbox the only option I have is AutoCompleteType.

None of the other functions such as AutoCompleteCustomSource are available.

I have .Net 2.0 installed and does say TextBox 2.0.0.0 .Net when holding the mouse over the control in VS2005.

Am I missing something here?
"

|||

Typically, he way 'autocomplete' functionality works is that a set of data has been retrieved from the database, as as the user types into the textbox control, the textchanged event is used to update the filter on the data.

Alternatively, on each keystroke, the textchanged event could be used to re-run the query to the data server.

BUT that is a very bad idea in terms of system performance.

Sunday, March 11, 2012

Automatic failover with SQL Server Standard?

Hi,
We are trying to implement SQL server failover by using
Windows 2003 "Enterprise" clustering and SQL
Server "Standard" to try to save the cost of SQL Server
Etnerprise. From what I understand we cannot have
automatic failover of the SQL server service with this
configuration.
Could someone please explaing to me techinically why we
cannot do this:
- Implement W2003 Enterprise OS clustering.
- Install SQL server "standard" installed on both machines
in the OS cluster.
- Have the SQL server service start on the primary node in
the OS cluster and manage the database. Then ...
as part of the OS cluster confifuration, if the primary
node goes down, request that the SQL server service starts
up on the backup node as part of the OS failover.
Can't the clients continue to talk to the SQL server
database since it is not started up on the backup node and
has the same IP address?
Thanks!
As you rightly said, SQL Server 2000 Failover Clustering is NOT supported with SQL Server 2000 Standard Edition. It is fully supported on SQL Server 2000 Enterprise Edition.
You can install and configure any non-cluster aware application as a generic service on a cluster. You can even make notepad clustered as a generic service in a cluster if you like.
I have not seen anybody doing following this approach (using sql server 2000 std edition as a generic service). I wouldn't recommend it. This will be like a custom solution and if you have any issues with the failover
working properly, the support that you will get will be very limited. If you have to work with SQL Server 2000 Standard Edition then I would recommend exploring SQL Server Replication.
To get an idea of what SQL Server 2000 EE Failover Clustering does please refer to the following whitepaper.
Microsoft Whitepaper - SQL Server 2000 Failover Clustering
http://www.microsoft.com/technet/pro.../failclus.mspx
Cluster Support Policy
Microsoft's Cluster support policy is below
Cluster (General): http://support.microsoft.com/default...b;en-us;309395
Cluster (SQL): http://support.microsoft.com/default...b;en-us;327518
Best Regards,
Uttam Parui
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security vulnerabilities. The easiest way to do this is to visit the following websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx
|||Note that Veritas support clustering SQL2000 Standard. When I've used it,
it's been just using VCS and not involving MCS at all but I believe it can
sit on top if it as well. I think they've rebranded recently so its called
Storage Foundation High Availability rather than Veritas Cluster Server to
reflect its reliance on Veritas Volume Manager (which is now called Storage
Foundation). I actually prefer the Veritas cluster management tools to the
MS tools and it's a lot cheaper than going to Enterprise Edition if the only
reason you need Enterprise is clustering (and not performance/large memory
support etc).
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:2ec3601c46d96$f335fc60$a601280a@.phx.gbl...
> Hi,
> We are trying to implement SQL server failover by using
> Windows 2003 "Enterprise" clustering and SQL
> Server "Standard" to try to save the cost of SQL Server
> Etnerprise. From what I understand we cannot have
> automatic failover of the SQL server service with this
> configuration.
> Could someone please explaing to me techinically why we
> cannot do this:
> - Implement W2003 Enterprise OS clustering.
> - Install SQL server "standard" installed on both machines
> in the OS cluster.
> - Have the SQL server service start on the primary node in
> the OS cluster and manage the database. Then ...
> as part of the OS cluster confifuration, if the primary
> node goes down, request that the SQL server service starts
> up on the backup node as part of the OS failover.
> Can't the clients continue to talk to the SQL server
> database since it is not started up on the backup node and
> has the same IP address?
> Thanks!
>