in

code for eternity !!!

community website for .net freaks ;-)

Browse by Tags

  • MSDTC on server '[SERVER NAME]' is unavailable

    If your code uses distributed transactions and you get the " MSDTC on server '[SERVER NAME]' is unavailable " error, all you have to do to fix it is go to the Services console on your server and start the Distributed Transaction Coordinator service. On Vista, you can click on Start...
    Posted to Technology (Weblog) by raj on 12-05-2008
  • T-SQL Function to Get Int From Varchar

    I recently had to write a T-SQL function which cleans up all non numeric characters from a varchar variable and returns the int value of the remaining numeric characters. If no numeric characters exist, the function should return zero. I thought it would be nice to share this with you and I hope you...
    Posted to Technology (Weblog) by raj on 05-20-2008
  • T-SQL Query to Find the Second Lowest Column Value in a Table

    After reading my earlier post T-SQL Query to Find the Second Highest Column Value in a Table a lot of users asked me to also help them with writing a query to find the second lowest column value in a table. So here it is: If we had a table named Employee which had a column named Salary and we had to...
    Posted to Technology (Weblog) by raj on 04-30-2008
  • Using sp_depends to find all Stored Procedures which reference / use a Table

    We can use the sp_depends system stored procedure to find all stored procedures which reference / use a particular table. The following T-SQL command will return a list of all database objects which are referencing / using the Products table: EXEC sp_depends Products Since the result set(s) returned...
    Posted to Technology (Weblog) by raj on 01-20-2008
  • Using sp_fkeys to find all Foreign Keys pointing to a Table

    We can use the sp_fkeys system stored procedure to find all foreign keys which point to a particular table. The following T-SQL command will return a list of all tables which are referencing the primary key of the Products table: EXEC sp_fkeys Products The sp_fkeys system stored procedure comes very...
    Posted to Technology (Weblog) by raj on 01-20-2008
  • T-SQL Query to Find the Second Highest Column Value in a Table

    One of my favorite technical interview question on SQL Server is "What query would you write to find the second highest column value in a table?" The question seems easy, however most developers fail to answer to this. If we had a table named Employee which had a column named Salary and we...
    Posted to Technology (Weblog) by raj on 01-10-2008
  • Finding Database Size using sp_spaceused Stored Procedure

    We can use the sp_spaceused stored procedure to find out exactly how much disk space is currently being used by a database. If we simply execute this stored procedure without passing any parameters, it returns the following 2 result sets: Result Set 1: database_name: Name of the current database. database_size...
    Posted to Technology (Weblog) by raj on 01-02-2008
Page 1 of 1 (7 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems