Thursday, May 24, 2007
Codeplex - Microsoft's answer for open source
Wednesday, May 23, 2007
Sql Server 2008 Code named Katmai
If you have been working on Sql Server 2005 you will understand how robust it is and the set of all new features it has compared to 2000, the next release katmai is adding on to sql 2005.
The good news is, it is adding to Sql 2005 and not like totally replacing it. Thank god or we got to learn a whole new set of stuff again :(
"Microsoft officials listed a number of overarching goals for SQL Server "Katmai" such as tighter integration with the 2007 Microsoft Office system. In addition, the release will make good on the parting pledge of Paul Flessner, former Microsoft senior vice president of the Data Storage and Platform Division, to go beyond relational data. SQL Server "Katmai" will enable users to manage any data type, including relational data, documents, geographic information and XML, company officials said.
In addition, the new version of the data management and analysis platform provides an integrated development environment with Microsoft Visual Studio and .NET Framework that will accelerate development of new applications with an increased level of data abstraction as well as permit developers to synchronize data from virtually any device into the central data store, company officials said. "
If you are interested to know more about katmai read about it here,
http://www.microsoft.com/sql/prodinfo/futureversion/default.mspx
Importance is being given to BI and integration with office 2007 and .Net 3.0
May be Microsoft should take it a little bit slower, they are too rapid. We are still riding on top of your car and if you go so fast we may take a deadly fall.
I know a lot of clients still use Sql Server 2000 and are still worried about even upgrading to Sql Server 2005.
Monday, May 21, 2007
Sql Server 2000 - Incorrect syntax near the keyword 'IDENTITY'
Let us say there is a table in sql server 2000 which does not have a identity key, you inspect it manually and find out that there is a column which is unique and you can make it in to an identity column and decide to go and open your Query analyzer and try to do an alter table add identity something like this,
ALTER TABLE [dbo].[projects] ALTER COLUMN [id] IDENTITY(100, 1) Not Null
Here i want the seed to start at 100 and increment by 1 since i got 99 rows already with proper ids.
But this would not run properly, we will get an error something like,
Incorrect syntax near the keyword 'IDENTITY'
There is no problem in the syntax the issue is sql 2000 cannot add an identity just like that to an column since there is lot of other background work that needs to be done.
So it is not possible to do it via single T-Sql statement.
But you can add the entire identity via enterprise manager very easily,
Just right click on the table >> design table >> click on the id column >> make identity = yes in the columns property area below and then set the identity seed (starting value) and the identity increment.
When you do this, this is what enterprise manager does in the background,
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_projects
(
id int NOT NULL IDENTITY (101, 1),
name varchar(50) NULL
) ON [PRIMARY]
GO
SET IDENTITY_INSERT dbo.Tmp_projects ON
GO
IF EXISTS(SELECT * FROM dbo.projects)
EXEC('INSERT INTO dbo.Tmp_projects (id, name)
SELECT id, name FROM dbo.projects TABLOCKX')
GO
SET IDENTITY_INSERT dbo.Tmp_projects OFF
GO
DROP TABLE dbo.projects
GO
EXECUTE sp_rename N'dbo.Tmp_projects', N'projects', 'OBJECT'
GO
ALTER TABLE dbo.projects ADD CONSTRAINT
Myuniqye UNIQUE NONCLUSTERED
(
id
) ON [PRIMARY]
GO
COMMIT
If you look at the above, it is basically creating a temporary table and inserting all the records from the main table and then renaming the temp table to original table name.
The problem is many projects want developers to save the script changes so that they can apply the same on to development / test / production servers, so developers want to save the script.
There is a way to do that too, actually 2 ways,
1) In Enterprise manager when you click design table and after you made the change, there is a small icon at the top which reads,"save changes script" (should be the third icon from the left if you have icons unmodified), so this basically scripts the entire change for you to save it.
2) Start Sql Profiler, perform the operation and then save changes script is the second way to do it.
This link too verifies the same,
http://www.sqlmag.com/Article/ArticleID/22080/sql_server_22080.html
Friday, May 11, 2007
Visual Studio 2005 Tips & Tricks #1 - Automatically format the code
Tale of a .Net Component
It is very rare to find a full fledged project implementation or a book which explains how to code a project, from scratch to rollout and updates.
If we look at real life that is what one expects, the best practices how to seperate layers of code, when to write components vs when to write controls, how to reuse code, but there were few implementations in the past like the pet shop project where an entire project was given as download for enthusiastic developers to learn. That is how i coded my first dot net project not by learning from a book or from msdn but by looking at the code of a sample dot net project provided by microsoft.
Today was the last post of a 5 part series explaining from scratch how to write a dot net component, i liked this article a lot and hence am posting it on my blog.
Tale of a .Net Component - Part 1 (Explains the requirement & the design)
http://www.devsource.com/article2/0,1895,2095440,00.asp
Tale of a .Net Component - Part 2 (Explains the class design)
http://www.devsource.com/article2/0,1895,2097685,00.asp
Tale of a .Net Component - Part 3 (Properties creation)
http://www.devsource.com/article2/0,1895,2099681,00.asp
Tale of a .Net Component - Part 4 (Depth in to code)
http://www.devsource.com/article2/0,1895,2104404,00.asp
Tale of a .Net Component - Part 5 (Testing & Rollout)
http://www.devsource.com/article2/0,1895,2111753,00.asp
The author of this excellent series is Peter Aitken (author of more than 40 books), http://www.pgacon.com/default.htm
I am sure any developer would love to read such articles.
Thursday, May 03, 2007
Sql Server 2005 - How to change sqlserver authentication mode - windows authentication / sql server and windows authentication mode
When we install Sql server 2005 during the installation it would prompt us for what kind of authentication mode to use (windows authentication or mixed mode[both sql and windows]), but at any point of time we can change this (similar to how we do it in sql2000) but with the new sql server management studio, the way we do it has slightly changed, this blog entry explains how to do the same.
1) Launch Sql Server Management Studio (SSMS), usually found in start > program files > Microsoft sql server 2005 > Sql Server Management Studio,
2) SSMS is nothing but a single IDE which combines both sql server 2000 enterprise manager and sql server 2000 query analyzer.
3) Since the mode is right now windows authentication, select the server type as "database engine" and then server name: the name of the sql server 2005 instance you are trying to connect to and authentication as "windows authentication" and click connect,
Note: If sql server 2005 is not yet started you may get an error msg (but in sql 2000 it used to start the sql server if it was not yet started but in 2005 it does not start it automatically).
4) Now the ssms will be connected, start the object explorer, several ways to start it, easiest is to press F8 or click on the icon in the menu which has the tool tip object explorer, (3rd from the right), object explorer is nothing but an tree view of all existing sql server instances, the databases and other agents (similar to sql 2000 enterprise manager left hand tree).
5) Right click on the sql server 2005 instance name and select properties to open the server properties popup window, in this window click on "security page" in the left hand side tree menu, and this page shows the server authentication, change it from windows authentication to sql server and windows authentication.
6) Now we need to perform one more additional step, configuring "sa" login or some other login and enabling it.
7) In the object explorer (F8) expand security, click on logins, the existing logins are shown in the right hand side, right click "sa" the default system administration login and select properties to show the properties window for "sa" login, here change the password of the login.
8) The main step is click on status page in the left hand side and change the status of the login to enabled (if not you will not be able to connect back using sa login)
Thus you can change the authentication modes in sql server 2005, but this may require a restart of the instance.
After restarting sql server 2005 try launching ssms and this time select mode as "sql server authentication" and enter login - "sa" and the password which you had changed in previous step and click "connect" and it should log you in.
Tags: Sql Server 2005, Sql Server,sql-server-2005Friday, March 02, 2007
Sql Server 2005 - A look at Installation : Instances
- More than one Sql Server 2005 can be installed on the same server, each installation is an instance,
- On the same machine you can have both Sql server 2000 and also Sql Server 2005 running side by side (like i do on my laptop),
- When you install Sql Server 2005 you are asked whether you want it to be installed as a default instance (no name for the instance) or you want to give it a name.
- During installation you can look at already existing instances as shown in the figure,
Why we need multiple instances?
- If you are planning to have a test environment and a production environment i would recommend installing Sql Server Developer edition on another pc and use it as a test environment, i do not like having test and production on the same OS box. Then why do we need multiple instance support? which is a great question, my answer is below,
- When you need to have multiple versions of sql server like 2000 & 2005 each run in their own instances,
- When you need to give admin or sa access to two different administrators to maintain their own sql servers,
- When you want to have another instance on the same OS where you can first test the service packs and ensure it works fine on the production OS and then do it to the other live instance,
- When you install other software like Vault or Sharepoint Portal Server 2007 or Visual Studio IDE 2005 they install their own instances of sql server 2005 or Sql Server 2005 Express editions.
SqlServer 2005 - About Sql 2005 & various editions
Microsoft spent 5 years to come up with this next release which has a lot of cool features,
- Improvements in performance,
- More analysis tools,
- Integrated development with cool dot net IDE and management studio,
- CLR capabilities,
- Http end points,
- Support for service broker and SOA,
- Better Sql jobs control with the new Sql Agent,
- Database Snapshots feature,
- Great database mirroring,
- Log shipping feature,
- Replication improvements,
- and lots n lots of T-Sql and Sql improvements.
I have been working with Sql 2000 for the past 5+ years, and it is one of my favourite databases, i had previous experience working with My Sql and i used to wonder why such a robust database like Sql did not have some good features which mysql had at that time. Example: it had paging at the backend level, you can specify in a query itself how many rows you want, even oracle had pagenum but sql lacked it in 2000 sql server.
The new sql 2005 is very promising and has made up for all the lacking features.
Sql Server 2005 is shipped free with VS Dot net IDE as sql express edition, it comes with sharepoint portal server 2007 and a bunch of other dot net applications. Any developer should learn the new features of Sql server 2005 and my entries would be helpful in that regard.
Sql Server comes in 5 editions:
- Sql Server 2005 Enterprise edition,
- Sql Server 2005 Standard edition,
- Sql Server 2005 Work group edition,
- Sql Server 2005 Developer edition (free for development and testing, exactly like EE),
- Sql Server 2005 Express edition (free like former MSDE)
Best ways to learn sql server 2005:
1) Books online free download - http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
2) Free E-learning courses from Microsoft - (for a limited time it is free soon to end)
https://www.microsoftelearning.com/sqlserver2005/
http://www.microsoft.com/events/series/technetsqlserver2005.mspx
3) Official site - http://www.microsoft.com/sql/default.mspx
4) Cost in $$ for Sql server 2005 - http://www.microsoft.com/sql/howtobuy/default.mspx
5) Made up your mind try it for free (180 day evaluation) - http://www.microsoft.com/sql/downloads/trial-software.mspx
6) Edition comparisons - http://www.microsoft.com/sql/editions/enterprise/comparison.mspx
7) Post a comment on my blog, if i know the answer will let you know :)
Wednesday, February 21, 2007
Classic ASP (not ASP.Net) code debugging with VS Dotnet IDE 2005
So i started my googling to find a solution which would make my daily coding life better and i was able to do it.
So here i am sharing my experience, "How to debug classic ASP using VS Dot net IDE 2005"
1) You need not have a sln or a project file, you can even open one single ASP file and debug it from top to bottom,
2) Open your ASP file in VS Dot net IDE 2005, then open IE and browse the page, this is done so that the ASP rendering process (IIS server but not aspnet_wp.exe, not w3wp.exe but dllhost.exe comes in to task manager),
3) Go to your default web site in IIS or your virtual directory >> right click properties >> home directory >> configuration >> Debugging tab >> in the debugging flags section,
check - Enable ASP server-side script debugging
In the script error messages section, check send detailed ASP error messages to client. (as shown in picture below).
4) Now comes the important step, open your vsdotnet ide 2005, and open the single ASP page and click Debug >> Attach to process >> check the check box [ ] show processes from all users, then look for a process called dllhost.exe Type = x86, Script and the username running it is YOURPCNAME\IWAM_YOURPCNAME.
Click Attach and wait for few minutes and click ok, now go back to your ASP page place a break point and then refresh the IE, and you should see it stops at the breakpoint.
Happy Debugging ASP :)
Tuesday, February 20, 2007
VSDotnet IDE 2005 making use of IIS instead of development webserver
So the URL will be something like,
http://localhost:2500 or a dynamic port,
Tuesday, January 30, 2007
Sharepoint enable anonymous access and extranet sites
Unfortunately doing this is not a piece of cake in sharepoint and requires few manual interventions, here is an excellent article with snapshots which explains how to do this.
http://andrewconnell.com/blog/articles/HowToConfigPublishingSiteWithDualAuthProvidersAndAnonAccess.aspx
Wednesday, January 10, 2007
Dot Net 3.0 Question Bank for Interview Preparation / General Knowledge
Main point is it has lot of WCF WPF and Dot Net 3.0 questions.
Full eBook with 4000 .NET 3.0 ,C#, Ajax,JAVA,.NET and SQL ServerInterview questions
http://www.questpond.com/SampleInterviewQuestionBook.zip
Download the JAVA , .NET and SQL Server interview sheet and rateyourself.
This will help you judge yourself are you really worth ofattending interviews. If you own a company best way to judge if thecandidate is worth of it.
http://www.questpond.com/InterviewRatingSheet.zip
2000 Interview questions of .NET , JAVA and SQL Server Interviewquestions (worth downloading it)
http://www.questpond.com/InterviewQuestions.zip
Core Java and OOP's Interview questions
http://www.questpond.com/OOPsAndCoreJava.zip
Servlets / JSP Interview questions
http://www.questpond.com/ServletsJSP.zip
Architecture Interview Question
http://www.questpond.com/ArchitectureInterviewQuestions.zip
Project Management Interview questions must to read for all aspiringproject managers
http://www.questpond.com/ProjectManagementInterviewQuestions.zip
Full Address book application in C# with technical specification ,estimation and test cases
http://www.questpond.com/AddressbookProject.zip
Web services Interview questions
http://www.questpond.com/WebServicesAndRemoting.zip
SQL Server 2005 Database optimization Interview questions
http://www.questpond.com/DatabaseOptimization.zip
SQL Server 2005 DTS Interview questions
http://www.questpond.com/DTSInterviewQuestions.zip
SQL Server datawarehoue and Data mining Interview questions
http://www.questpond.com/DatawareHousingandDataMining.zip
SQLCLR Interview questions
http://www.questpond.com/SQLCLRInterviewquestion.zip
SQL Server XML Interview questions
http://www.questpond.com/SQLServerXML.zip
Basic .NET Framework interview questions
http://www.questpond.com/FrameWorkSampleInterviewQuestions.zip
..NET Interop and COM Interview questions
http://www.questpond.com/InteropdotnetInterviewQuestions.zip
ASP.NET Caching Interview questions
http://www.questpond.com/CachingInterviewQestions.zip
Localization globalization Interview questions
http://www.questpond.com/LocalizationAndGlobalization.zip
Do not know how estimations are done here's a complete book on it
http://www.questpond.com/HowtoPrepareSoftwareQuotations.zip