Vote is open at the The Microsoft® Ingenuity Point Contest to select your favorite product out of many innovative software products in Health care, Education , and Clean Technology.
ITWorx (where I work as a Senior Software Engineer), participates with 2 products:
Have a look, and vote !!
Thursday, February 21, 2008
Restart your machine after installing Fulltext service for MS SQL Server Express 2005
I had MS SQL server express 2005 installed without Fulltext index support. When I needed it, I installed it, created a catalog, an index, and started change tracking, then I tried to make simple CONTAINS query, nothing returned.
I worked with FTS many times and for years (mainly with SQL Server 2000). It was hard to retry many times to get any result with not good.
I tried many times to drop the index, start full population, incremental population. Nothing worked.
I looked into the event viewer, I found this error:
I looked in the fulltext log ( located at : installationpath/MSSQL.1\MSSQL\LOG\SQLFTxxxxxxxxxx.LOG.x) , this info existed in error logs:
After searching for such error, I found that after installing fulltext service on MS SQL Express 2005, the machine must be restarted, and that this is mentioned in the ReadMe!!
If only we read the manual !!!!
I worked with FTS many times and for years (mainly with SQL Server 2000). It was hard to retry many times to get any result with not good.
I tried many times to drop the index, start full population, incremental population. Nothing worked.
I looked into the event viewer, I found this error:
Errors were encountered during full-text index population for table or indexed view '[dbname].[dbo].[TableName]', database ''[dbname].[' (table or indexed view ID '1550628567', database ID '7'). Please see full-text crawl logs for details.
I looked in the fulltext log ( located at : installationpath/MSSQL.1\MSSQL\LOG\SQLFTxxxxxxxxxx.LOG.x) , this info existed in error logs:
Error '0x80040e09' occurred during full-text index population for table or indexed view '[dbname].[dbo].[TableName]' (table or indexed view ID '1550628567', database ID '7'), full-text key value 0x00000001. Attempt will be made to reindex it.
The component 'sqlfth90.dll' reported error while indexing. Component path 'C:\Program Files\Microsoft SQL Server\90\COM\sqlfth90.dll'.
After searching for such error, I found that after installing fulltext service on MS SQL Express 2005, the machine must be restarted, and that this is mentioned in the ReadMe!!
If only we read the manual !!!!
Sunday, February 17, 2008
Another reason for “Cannot Generate SSPI Context” error
Today, I had trouble with SharePoint server. Each time I open the main page I get the error page (500-internal server error). This error occurred in an environment that worked fine for months. But suffered an accidental electricity cut off.
When I looked in the event log, I realized that SharePoint cannot connect to SQL Server configuration database (which existed on another server) the error details contained the famous error:
Searching Google led me to a good article: Troubleshooting Cannot Generate SSPI Context Errors , which is really good, but I still did not find the solution.
Finally, after consulting an infrastructure engineer, he suggested to check that the net logon service is running on the domain controller. I checked in and I found that it was paused. After running it, everything went well.
So, the next time you get “Cannot Generate SSPI Context” when connecting to SQL Server, add this check to the list of checks you do, and good luck.
When I looked in the event log, I realized that SharePoint cannot connect to SQL Server configuration database (which existed on another server) the error details contained the famous error:
“Cannot Generate SSPI Context”I tried to ping the server, flush DNS, connected to SQL Server using SQL authentication, restarted some services and machines, just to get the same error.
Searching Google led me to a good article: Troubleshooting Cannot Generate SSPI Context Errors , which is really good, but I still did not find the solution.
Finally, after consulting an infrastructure engineer, he suggested to check that the net logon service is running on the domain controller. I checked in and I found that it was paused. After running it, everything went well.
So, the next time you get “Cannot Generate SSPI Context” when connecting to SQL Server, add this check to the list of checks you do, and good luck.
Friday, February 8, 2008
Visual Studio 2008 Product Comparison
This is a great guide when you decide to buy visual studio:
Visual Studio 2008 Product Comparison
Note that Standard edition differs from Professional edition mainly in office tools, crystal reports, test tools, server explorer. Whether these features worth the price difference (about $440) depends on your needs.
Visual Studio 2008 Product Comparison
Note that Standard edition differs from Professional edition mainly in office tools, crystal reports, test tools, server explorer. Whether these features worth the price difference (about $440) depends on your needs.
Monday, January 28, 2008
Windows forms: Adjust width of combobox drop down according to content
Combobox control has the DropDownWidth property to control the width of the dropped portion that appears when the user clicks the drop down arrow. This property takes the width in pixels.
It's nice to have the width of the drop down set according to the contents. This code does the job:
Assuming the name of the control is cmb:
It's nice to have the width of the drop down set according to the contents. This code does the job:
Assuming the name of the control is cmb:
int ItemMaxWidth = this.cmb.DropDownWidth;
Graphics gx = cmb.CreateGraphics();
for (int i = 0; i < this.cmb.Items.Count; i++)
{
//get the width of item
SizeF s = gx.MeasureString(cmb.Items[i].ToString(), cmb.Font);
if ((int)s.Width > ItemMaxWidth)
{
ItemMaxWidth = (int)s.Width;
}
}
gx.Dispose();
//Set the width :
cmb.DropDownWidth = ItemMaxWidth;
Tuesday, January 1, 2008
List of articles I read on 2007
This is a list of most of the articles I read in year 2007, I wish you find some of them interesting.
- Form with Validators Not Submitting on a Rebuilt ASP.NET 1.1 Box
- RESTful Web Services
- Software Team Turnover: Why Developers Leave
- The C Language is a toy
- Exploring the factory design pattern
- Data on the Outside vs. Data on the Inside
- Exploring the Singleton Design Pattern
- Exploring the Observer Design Pattern
- The Pitfalls of Foreign Keys
- What is the Maximum Page Size in SQL Server 2000?
- Maximum Row Size in SQL Server 2005
- Should You Upgrade Your Current SQL Server Cluster to a SQL Server 2005 Cluster?
- Creating Clean and Simple Pages
- Validating ASP.NET Query Strings
- Top 10 lies told by clients
- The "Double-Checked Locking is Broken" Declaration
- Malicious Code Injection: It's Not Just for SQL Anymore
- Common Table Expressions in SQL Server 2005
- Securing the SA Account in SQL Server 2005
- Troubleshooting Session Related Issues in ASP.NET
- Gotcha! SQL Aggregate Functions and NULL
- New Isolation Levels Available in SQL Server 2005
- What Is Web 2.0
- The Helper Table Workbench
- Going dynamic with PHP
- Picking Service Accounts
- The Fundamentals of the SQL Server 2005 XML Datatype
- Saving a Sales Order Part 1
- Replicating Identity Columns
- Storing IPs in SQL Server
- Keyword Searching in SQL Server
- Future-Proofing Your URIs
- Boost ASP.NET Performance with Precompilation
- Validate Your Refactored SQL Queries with a New SQL Server 2005 Operator
- A Refresher on Joins
- Full Control Over a Randomly Generated Password
- JavaScript: Create Advanced Web Applications With Object-Oriented Techniques
- Dynamic Connection Strings in Reporting Services 2005
- SSIS Control Flow Basics
- Building the Business Logic Layer in Visual Basic 2005
- Object Binding Tips and Tricks
- Are Hash Codes Unique?
- Passing a Table to A Stored Procedure
- Introduction to SQL Server Everywhere
- The OUPUT Command
- Ways to revert a database to pre-Test state after Unit testing
- NULL - The database's black hole
- Performance Impact of Procedure Calls without Owner Qualification -- SQL Server 2000
- SQL Server 2005 Service Accounts
- Removing the Builtin Administrators - Some Pitfalls to Avoid
- Table Partitioning
- .NET 3.5 Language Enhancements
- NULL Versus NULL?
- Think you know how to write UPDATE statement? Think again.
- 13 disasters for production web sites and their solutions
- Collation Error 468
- Survive A SQL Server DBA Technical Interview
- Are key performance indicators a true measure?
- Peeking Further into C++00X
- Two Cool Things in C++00X: Object Initialization and Move Semantics
- Lessons Learned from Five Years of Building More Secure Software
- The Legend of the Single, Multi-Terabyte, Replicating SharePoint Database
- Aggregating Correlated Sub-Queries
- Trigger Trivia
- Fixing Orphaned Users
- Row-By-Row Processing Without Cursor
- Long Time Operations in ASP.NET
- SSMS Tricks
Sunday, December 23, 2007
Are MS SQL Server stored procedures precompiled ?
A common interview question and a common answer:
Q: Why should you use Stored procedures not ad-hoc queries?
A (happily, he's sure that he knows how to answer this question): They perform better because they are precompiled at creation time, also ...(Some, other reasons that I don't really care about now)...
Is that true?
In fact, this is a common misconception that many users of SQL Server 7.0, 2000, and 2005 suffer, may be because this was the case in SQL Server 6.5. Also because inaccurate and not up to date articles, books ,and learning materials.
I quote this from msdn:
This is not the case in for SQL Server 7.0 and higher, again from msdn:
Knowing this, it's common that arguments take place from time to another comparing using Stored procedures vs. ad hoc queries.
Personally, I prefer to use stored procedures because I find this more modular.
My advice is, whether you use Stored procedures or ad hoc queries, always use best coding practices when performing database operations to avoid SQL injection attacks. Be them parameterized queries, prepared statements, or whatever depending on the programming language and framework you use.
Q: Why should you use Stored procedures not ad-hoc queries?
A (happily, he's sure that he knows how to answer this question): They perform better because they are precompiled at creation time, also ...(Some, other reasons that I don't really care about now)...
Is that true?
In fact, this is a common misconception that many users of SQL Server 7.0, 2000, and 2005 suffer, may be because this was the case in SQL Server 6.5. Also because inaccurate and not up to date articles, books ,and learning materials.
I quote this from msdn:
In SQL Server version 6.5 and earlier, stored procedures were a way to partially precompile an execution plan. At the time the stored procedure was created, a partially compiled execution plan was stored in a system table. Executing a stored procedure was more efficient than executing an SQL statement because SQL Server did not have to compile an execution plan completely, it only had to finish optimizing the stored plan for the procedure.
This is not the case in for SQL Server 7.0 and higher, again from msdn:
SQL Server 2000 and SQL Server version 7.0 incorporate a number of changes to statement processing that extend many of the performance benefits of stored procedures to all SQL statements. SQL Server 2000 and SQL Server 7.0 do not save a partially compiled plan for stored procedures when they are created. A stored procedure is compiled at execution time, like any other Transact-SQL statement.
Knowing this, it's common that arguments take place from time to another comparing using Stored procedures vs. ad hoc queries.
Personally, I prefer to use stored procedures because I find this more modular.
My advice is, whether you use Stored procedures or ad hoc queries, always use best coding practices when performing database operations to avoid SQL injection attacks. Be them parameterized queries, prepared statements, or whatever depending on the programming language and framework you use.
Subscribe to:
Posts (Atom)