Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts
Friday, July 30, 2010

Reboot require check fails while installing SQL Server 2008 R2 Express

Before some days i was installing SQL Server 2008 R2 Express edition on my machine and every time when it runs checks for required settings it was failing giving error reboot required. I have rebooted my machine several time and result was same. After that i have search it on internet and found that was due to some registry settings. To pass this check you need to remove following entries.

  1. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
  2. Then find PendingFileRenameOperations and remove all the data related with it

After that just i just run install the SQL Server 2008 R2 on my machine and through my surprise it was working fine. I found great tip from the following URL through it was for SQL Server 2008 but it works fine with SQL Server 2008 R2 also.

http://blog.dragonsoft.us/2008/11/08/tip-installing-sql-server-2008-reboot-required-check-fails/

Hope this will help you..Happing coding

Shout it
kick it on DotNetKicks.com
Share:
Sunday, July 26, 2009

What's new in sql server 2008

Microsoft SQL Server are one of the popular RDBMS(Relational Database Management System) all over world. Before some time Microsoft has launched the new version of SQL Server 2008. SQL Server 2008 provides the highest levels of security, reliability, and scalability for your business-critical applications. . Following are the some of new features of SQL Server 2008.

  1. Policy based management.
  2. Performance Data Collection.
  3. Data compression.
  4. Resource Generator.
  5. Transparent Data Encryption.
  6. External Key Management/Extensible Key Management.
  7. Data Auditing.
  8. Hot-Add CPU and Hot-Add Memory.
  9. Streamlined Installation.
  10. Server Group Management.
  11. Upgrade Advisor.
  12. Partition aligned indexed views.
  13. Backup Compression.
  14. Extended Events.
  15. Grouping Set.
  16. Merge Operator.
  17. Greater Support for LINQ and Entity Framework.
  18. Change Data Capture.
  19. Table Valued Parameters.
  20. Entity data model for entity framework.
  21. Synchronization Server with ADO.NET.
  22. CLR Improvements.
  23. Conflict detection between peer to peer Replication
  24. Service Broker Priorities and Diagnostics.
  25. Spatial Data with Geography and Geometry data types.
  26. Virtual Earth Integration.
  27. Sparse Column.
  28. Filtered Indexes.
  29. Integrated full text search.
  30. File stream data.
  31. Large user defined types.
  32. Large user defined aggregates.
  33. Date/Time Data Types.
  34. Improved XML Support.
  35. ORDPATH.

and many more features are there. It's great rdbms to use in your future projects. Please visit following link to explore above features in great details.

http://www.microsoft.com/sqlserver/2008/en/us/whats-new.aspx

You can download SQL server 2008 Express database for free from following link.

http://www.microsoft.com/express/sql/download/

Share:
Friday, July 17, 2009

Subsonic 3.0 is out now- Next Generation Object Relational Mapper

There lots of ORM(Object Relational Mapper) is available now like entity framework,nhibernate, linq, dlinq but i choose subsonic 3.0 for my next application which will be a question answer site for the following reason

  1. Now subsonic 3.0 is with linq support so you can write your lambda expression and linq queries along with the subsonic
  2. It comes with simple repository.
  3. Built in T4 Templates for 4.0
  4. Linq to subsonic.
  5. Subsonic 3.0 templates.
  6. Can handle thousand of queries at a times.
  7. Full support with asp.net 3.5 features.
  8. Ease of Use.
  9. Great support with asp.net mvc

And another great news is that Rob Conery is hired by the Microsoft and subsonic will official ORM for ASP.net Applications.

You can download subsonic 3.0 from here.

http://www.subsonicproject.com/Download

Happy Coding..

Share:
Thursday, July 31, 2008

What is LINQ? LINQ Developer Resources

LINQ is Language Integrated query. It is a integral part of visual studio 2008 and Microsoft .NET Framework 3.5. It is object to database mapping technology thorough which you can query any type of collections of object,XML of database.

 

Recently I am goggling about the LINQ and I have found following great resources for developers:

LINQ Resources:

Linq for Oracle:
----------------
http://broersa.wordpress.com/2008/05/22/linq-for-oracle-sample/

 

.NET 2.0 Or higher transaction model to use it with linq:
----------------------------------------------------------
http://www.simple-talk.com/dotnet/.net-framework/.net-2.0-transaction-model/

 

How to use transaction with linq:
--------------------------------
http://chiragrdarji.wordpress.com/2007/08/25/how-to-use-transaction-in-linq-using-c/

 

Inside the linq datacontext site to better understanding of linq:
-----------------------------------------------------------------
http://dotnetslackers.com/articles/csharp/InsideTheLINQToSQLDataContextClass.aspx

 

Linq to SQL(part 1 to 7 -Total Understanding of linq):
------------------------------------------------------
http://aspalliance.com/1430_LINQ_to_SQL_Part_6__Retrieving_Data_Using_Stored_Procedures_.1

 

A good article about-LINQ to SQL : Using Transaction:
-----------------------------------------------------
http://blogs.msdn.com/wriju/archive/2007/08/06/linq-to-sql-using-transaction.aspx

 

Using LINQ in ASP.NET (Part 1)- A Four part series from bipin joshi:
--------------------------------------------------------------------
http://www.dotnetbips.com/articles/56f8f29d-2617-4f99-a8b4-977703ebf780.aspx

 

The Linq Project:
----------------
http://msdn.microsoft.com/en-us/vbasic/aa904594.aspx

 

What is linq:
------------
http://en.csharp-online.net/Introducing_LINQ%E2%80%94What_Is_LINQ
http://www.dotnetspider.com/resources/19939-What-LINQ.aspx.aspx

 

Scott gu's Multipart Series about linq:
--------------------------------------
http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

 

Linq to xml:
-------------
http://sandeep-aparajit.blogspot.com/2007/12/what-is-linq.html

Share:
Thursday, January 17, 2008

How to Alter ColumnName in sql server with query..

We are normally using Alter Column Modify command to modify the column defination. But SQL Server does not support it. Rather then then that they are are supporting new syntax Like

"ALTER TABLE ALTER COLUMN"

Here is the syntax for ALTER TABLE command for sql server.

ALTER TABLE table { [ ALTER COLUMN column_name { new_data_type [ ( precision [ , scale ] ) ] [ COLLATE <> ] [ NULL NOT NULL ] {ADD DROP } ROWGUIDCOL } ] ADD { [ <> ] column_name AS computed_column_expression } [ ,...n ] [ WITH CHECK WITH NOCHECK ] ADD { <> } [ ,...n ] DROP { [ CONSTRAINT ] constraint_name COLUMN column } [ ,...n ] { [ WITH CHECK WITH NOCHECK ] CHECK NOCHECK } CONSTRAINT { ALL constraint_name [ ,...n ] } { ENABLE DISABLE } TRIGGER { ALL trigger_name [ ,...n ] } }

If you want more to know about it. Please visit following link at Micorosft sql server developement center.

http://msdn2.microsoft.com/en-us/library/aa275462(SQL.80).aspx
Share:
Thursday, November 15, 2007

CUBE and Roll Up in SQL Server

Some time we need to summarize data very quickly without writing very complex query. CUBE And ROLL UP are great commands that give us very good summary options.

We can summarize the data without writing dirty and complex queries with the help of CUBE and ROLL Up Operators.

I have found a great link for CUBE and ROLL UP to understand it deeply.

Here is the link for that.
http://databases.about.com/od/sql/l/aacuberollup.htm
Share:
Friday, August 3, 2007

SQL Server interview Questions

SQL Server is defacto database standard microsoft .net plateforms. Whenever you go as a .net developer. You have to get knowledge of the sql server.

I have found a very good link of sql server interview quesiton. Which will help you to prepare for interview.

here is the link :

http://blog.sqlauthority.com/2007/04/17/sql-server-interview-questions-part-3/
Share:
Friday, July 27, 2007

Maximum for objects in sql server

Here are some maximum number of different objects in sql server.
  1. maximum number of character in table name-128
  2. maximum number of character in column name-128
  3. maximum number of table columns per select statement -4096
  4. maximum number of table columns per table-1024
  5. maximum number of foreign key reference per table-253
  6. maximum number of column per index-16
  7. maximum number parameters in stored procedure -1024
  8. maximum number of columns in view-128
Share:

Diffrence between Oracle 9i and sql server 2000

Oracle and sql server both are great database management system and have great features. Often developer need to know what type of DBMS he should use for a particular needs.I have found a great comparison articles for oracle 9i and sql server 2000. Which describe all the feature of both DBMS and compare based on features.

here is the link for that article..
http://www.dotnetspider.com/kb/Article3289.aspx
Share:

SQL Server Joins

Sql server joins are used to combine result data from two or more tables. Often we need to display data from two tables. Where sql server joins are very useful.

There are three types of sql server joins.

1) Inner Join
2) Outer Join
3) Cross Join


1. Inner Join:
Inner join will display data based on common columns of two tables. It will find
the data from both tables based on join condition.This join take every records of left table and looks in right table based on join conditions.

2. Outer Joins:

There are there types of outer joins.

2.1 Left Outer Join
2.2 Right Outer Join
2.3 Full Outer Join

2.1 Left Outer Join:

Left outer join will display all the rows from left table of join and display data from right table based on join condition. First it will display every row of left table and looks into the right table to display data based on join condition. If matching records are found then it will display data of right table with left table data otherwise put a null values instead of right table data.


2.2 Right Outer Join:

Right outer join will display all the rows from right table of join and display data from left table based on join condition. First It will display every row of right table and looks into the left table to display data based on join condition. If matching records are found then it will display data of left table with right table data otherwise put a null value instead of left table data.


2.3 Full Outer Join:

This joins are combination of both left outer join and right outer join. First it will put data like left outer join and it will put data like right outer join. If respective records are found in opposite table then it will display data otherwise it will display null values.


3 Cross Join:

Cross join is slightly different then full outer join. It does not have join condition it is not required in cross join. It will display data like Cartesian product of the tables. For example if table 1 have 3 rows and table 2 have 7 rows. Then it will display 21 rows from both tables.

First it will select first row of table 1 and first row of table 2
then it will select first row of table 1 and second row of table 2
then it will select first row of table 1 and third row of table 2


so on it will display data.
Share:
Thursday, July 26, 2007

Diffrenece Between Function and Procedure in SQL Server

Following are the main differences between sql server stored procedure and sql server user defined function.

Stored procedure does not return values but it returns a integer value indicates that stored procedure executed successfully. While user defined function in sql server must return a single value. You can not return more than one value in user defined function.

You can call user defined function in stored procedure while you can not call extended stored procedure in user defined function in sql server.
Share:
Monday, July 23, 2007

Build SQL Server Stored Procedure with C#.NET

Traditionally from many year we have build sql server stored procedure with the transact sql. Microsoft framework 2.0 and sql server 2005 allows us to write stored procedure with other languages like C#.NET,VB.NET etc.

Microsoft sql server 2005 provide integrated support with .net common language run time so we can create stored procedure in C#.NET,VB.NET also. It has several advantages over using transact sql like compiled execution,security and type safety.

I have found a great articles that describes all the way to develop stored procedure with c#.net.

Mr. Bipin joshi describes all the tips and tracks of how to develop stored procedure with c#.net
here is the link for that article.

http://www.dotnetbips.com/articles/70eff218-3da0-4f6f-8f8d-eeea65193f2c.aspx
Share:
Thursday, July 12, 2007

Sql Server 2000,2005 DataType and Ranges

As developer in Microsoft technology we all need to know about data types supported by the sql server 2000 and sql serve 2005. We also have to know what is there ranges and where it should use.

I have found a cool link that describes all the things above.

here is the link for that article...
http://www.teratrax.com/sql_guide/data_types/sql_server_data_types.html
Share:

Transfering data with sql server integration services...

If we want to transfer data from one database table to another database we need to write complex code and queries. But with sql server 2005 integration services you can do it sometimes. You have to use sql server business intelligence studio(bundled with sql server 2005 developer edition).

I have found a great article that descries all the thing that how you can create a package with sql server 2005 and how you can excute this package with sql server 2005 business intelligence studio.

here is the link for that cool article..
http://www.codeguru.com/cpp/data/mfc_database/sqlserver/article.php/c9631__3/
Share:

What is SQL Server Integration Services

The ability to transform corporate data into meaningful and actionable information is the single most important source of competitive advantage in today’s business world. Harnessing the data explosion to better understand the past and get direction for the future has turned out to be one of the most challenging ventures for enterprise Information Technology departments in global organizations. There are three broad categories of issues associated with data integration:


•Technology challenges
•Organizational issues
•Economic challenges

In this paper, we will explore these challenges in detail and discuss how to address them with Microsoft® SQL Server™ 2005 Integration Services (SSIS). First, let’s view them in the context of a real-world scenario.

Microsoft sql server 2005 integration services is just like dts services in sql server 2000 but now it is called integration services with Microsoft sql server 2005

here is the link for more details.

http://www.microsoft.com/technet/prodtechnol/sql/2005/intro2is.mspx

Share:
Friday, July 6, 2007

Except operator SQL Server 2005 -Find Duplicate values in multiple tables.

I have found a great way to find duplicate values with two tables in sql server. Suppose we have two tables t1 and t2 both have same fields like id,name.

And both table have following data.

T1 Data:
ID NAME
1 abc
2 xyz
3 pqr

T2 Data:
ID NAME
2 xyz

We need to find rows from table t1 which is not there in table t2.

Here is the simple way to do it.

select * from t1
except
select * from t2

Except operator return result by comparing two queries. It returns row of left query which are not in right query. So result for above queries will be as following

ID NAME
1 abc
3 pqr




NOTE:
The basic rules for combining the result sets of two queries that use EXCEPT are the following:
The number and the order of the columns must be the same in all queries.
The data types must be compatible.
Share:
Monday, May 21, 2007

What is Linq

Linq is the one of the most hottest release from Microsoft. Still lots of people don't know what linq is. I have found a great articles from Saqib Ullah.

This articles covers all the aspects of Linq in each and every way.

Following is the link for that article...
http://geekswithblogs.net/technetbytes/archive/2007/04/30/112129.aspx
Share:

Micorosft SQL Server Future Version-Katmai

Microsoft is going to launch it's new sql server 2005 future realease code name Katmai. It will be realeased in 2008. It provide better data management and dynamic development for the data management solutions.

SQL Server code name "Katmai" is a complete enterprise-class offering that builds upon the success of SQL Server 2005 and delivers increased functionality to a comprehensive range of applications from the desktop to the data center.

for more details you can visit following links:
http://www.microsoft.com/sql/prodinfo/futureversion/default.mspx

Read the SQL Server code name "Katmai" Press Release

SQL Server code name "Katmai" Datasheet
Share:
Thursday, April 26, 2007

Bulk insert with dynamic primary key -SQL Server 2000/2005

You often need a bulk insert with dynamic primary key where you can define your keys without getting it from the .txt files or .csv files.

here are the stored procedure to bulk insert country with dynamic primary key.

first create temp.txt file in c drive with following data.

Australia
Canada
America
India

then create table with following fields

countryid int 4
countryname varchar(100)

and assign name as tblCountryMaster

now use following stored procedure


SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE sp_BulkInsertCountry
(
@FilePath varchar(1000)
)
AS
BEGIN--PROCEDURE
--variable declaration
declare @SQL varchar(500)
declare @id int
declare @CountryName varchar(30)


--Create temporary table for Country
CREATE TABLE #tmpCountry
(
CountryName varchar(30),
)

---executing bulk insert on temporary table
SET @SQL='BULK INSERT #tmpCountry from ''' + @FilePath + ''' WITH (FIELDTERMINATOR ='','',ROWTERMINATOR=''\n'')'
EXEC(@sql)

DECLARE cursor_Country CURSOR READ_ONLY FOR
select [CountryName] from #tmpCountry

OPEN cursor_Country
FETCH NEXT FROM cursor_Country INTO @CountryName
WHILE @@FETCH_STATUS=0
BEGIN
SELECT @id=isnull(max(Countryid),0) from tblCountryMaster
SET @id=@id+1
INSERT INTO tblCountryMaster values(@Id,@CountryName)
FETCH NEXT FROM cursor_Country INTO @CountryName
END
CLOSE cursor_Country
DEALLOCATE cursor_Country
END--PROCEDURE


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

happy programming
Share:
Thursday, March 8, 2007

TRY-CATCH Block-SQL Server

In SQL server 2000, to handle sql server exception we have to use goto statement while in the sql server 2005 support the try-catch type of exception handling just like vb.net or c#.

here is exmple of it.


set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


CREATE PROCEDURE [dbo].[sp_InsertState]
@StateId int,
@Name varchar(30)
AS
BEGIN
declare @Error Int
declare @TableName sysname
declare @ErrorMessage nvarchar(2000)
BEGIN TRY
BEGIN TRANSACTION
SET NOCOUNT ON;
INSERT INTO tbl_State_Master
(stateid, name, isactive)
VALUES (@StateId,@Name,1)
SET NOCOUNT OFF;
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION
set @ErrorMessage=ERROR_MESSAGE()
RAISERROR('State can not be inserted',16,1)
END CATCH
END
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews