weblogs.com.pk

Proud To Be Pakistanis!
Welcome to weblogs.com.pk Sign in | Join | Help
in Search

Browse by Tags

All Tags » SQL Server
  • Knowing the counts of table entries in SQL Server

    Here's the query to know the counts of the table entries in SQL Server select object_name(object_id), row_countfrom sys.dm_db_partition_statswhere index_id < 2order by row_count desc
    Posted to Khurram Aziz (Weblog) by khurram on February 28, 2013
  • Sharepoint and SQL Server Reporting Services

    SQL Server 2005 Reporting Services SP2 or later can be integrated with Sharepoint. Setting it up is bit tricky. http://msdn.microsoft.com/en-us/library/ee384252.aspx URL is must read to troubleshoot the issues. For me following worked Ensure only Windows Integrated Authentication is checked on http://server/ReportServer DisableLoopBackCheck ...
    Posted to Khurram Aziz (Weblog) by khurram on January 2, 2010
  • Disallowing Running the Stored Procedure in Parallel

    I wrote a stored procedure a while back; it manipulates the database of a legacy and proprietary application. Few assumptions were taken like the stored procedure will always get invoked by the job and job doesn't run in parallel. Few weeks back there was a requirement to let the user do that operation from the web on demand; which triggered the ...
    Posted to Khurram Aziz (Weblog) by khurram on October 20, 2009
  • Tsql : Update From / Self Join

    The other day I received a query on how to update rows in a table having from clause and self join needs to be used…I thought its interesting scenario and should document it for future references… Let me explain the problem with a scenario…Lets consider a table in which hierarchy is implemented using Parent / Child to self; something like create ...
    Posted to Khurram Aziz (Weblog) by khurram on October 8, 2009
  • Date Calculations in TSQL

    Sometime while implementing some date/time specific business logic; we need to do some processing on datetime data; e-g trimming away the time, knowing the start of month datetime value. Instead of converting the datetime data to string and then doing some string processing; we can use the SQL Server’ built in functions like dateadd and datediff ...
    Posted to Khurram Aziz (Weblog) by khurram on September 30, 2009
  • If-Else Like Behavior in Where Clause

    .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, ''Courier New'', courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: ...
    Posted to Khurram Aziz (Weblog) by khurram on September 28, 2009
  • Microsoft Dynamics GP

    Is anyone around has worked with Microsoft Dynamics GP product? (v10) I have an integration project and some basic training work to accountants / data entry operators and management folk for adoption (migrating from another such accounting/financial/mini-ERP product). Please contact me at khurram AT sharpcoders DOT net
    Posted to Khurram Aziz (Weblog) by khurram on September 25, 2009
  • (Almost) Free Microsoft Products through WebsiteSpark

    Program Site: http://www.microsoft.com/web/websitespark What you get The right to use the following products for three years For Development Use Visual Studio Professional Expression Studio 2 or Expression Studio 3 (1 User) Expression Web 2 or Expression Web 3 (2 User) Windows Web Server 2008 or R2 SQL Server ...
    Posted to Khurram Aziz (Weblog) by khurram on September 25, 2009
  • CRUD Procedure Script / SQL Server

    I was just googling around to find the quickest way of generating CRUD sps for SQL Server Tables and found two worth sharing One is T-SQL Script and other is SSMS add-in   enjoy ! Nasir Ali Khan 
    Posted to Nasir Ali Khan (Weblog) by nasir on May 21, 2008
  • Knowing current SPROC name

    Instrumentation though usually a ''non-functional requirement''; but its considered to be critical especially in ''enterprise class application''. For this we usually need to know what is the current part of code being executing; against which we can log some info. Same applies to data-tier; thankfully TSQL has required functionaliy. This is ...
    Posted to Khurram Aziz (Weblog) by khurram on November 2, 2006
  • TSQL :: Comparing multiple fields

    Sometimes you want to select from one list the items that exist (or don’t exist) in the second row; and for the comparison you want to use multiple rows. This is common in scenarios where you want to remove duplicate values. You might wish to write something like this in TSQL (This is just an example; not very practical one; but I guess it will ...
    Posted to Khurram Aziz (Weblog) by khurram on June 18, 2006
  • Tsql :: Checksum

    Comparing Checksum is one of the straight forward techniques to know if two things are different or not, especially when you are comparing some vector quantities. SQL Server 2005’s TSQL has two new relevant functions in this regard, checksum() and checksum_agg() Consider a test table having some values. Using checksum() you can have a computed ...
    Posted to Khurram Aziz (Weblog) by khurram on May 16, 2006
  • Can we use stored procedures in View?

    Well I have not gone through all the options yet; but I was able to did something that solved the problem at hand. The database at hand was exposed only through stored procedures; but one developer wanted to have a view; being new to Perl on Unix; he hasn’t yet explored how to execute stored procedures. He asked me to setup few views for him ...
    Posted to Khurram Aziz (Weblog) by khurram on March 21, 2006
  • Sharepoint / ASP.NET v2 / Smart Part :: Required permissions cannot be acquired

    Today I updated few internal Sharepoint based applications to ASP.NET v2. Before using ASP.NET v2 with Sharepoint; you need to install Service Pack 2 of Windows Sharepoint Services (WSS). I was using SmartPart to use ASCX based user controls in Sharepoint. You need to use “Son of SmartPart” if you are using ASP.NET v2. It took considerable time to ...
    Posted to Khurram Aziz (Weblog) by khurram on March 17, 2006
  • Passing Array To Stored Procedures

    There are some scenarios; where you want to pass array to stored procedure. In SQL 2000; it was not possible. Different work-around was presented; like passing values as string and then parsing them out; passing data as XML and then using MSXML OLE automation object in SQL Server (sp_OACreate/sp_OADestroy). Both have the pit falls; parsing ...
    Posted to Khurram Aziz (Weblog) by khurram on March 8, 2006
  • {BA126AD1-2166-11D1-B1D0-00805FC1270E}

    I have a Windows 2003 Sp1 box running SQL Server 2005; the box also has Windows Firewall turned on. I was going through Windows Event Logs; and found out that NETMAN service has some issues. NETMAN (Network Connections Manager) service is used by Windows Firewall; and my initial findings are that the problem had some connection between SQL Server, ...
    Posted to Khurram Aziz (Weblog) by khurram on March 3, 2006
  • Uninstalling SQL Server 2005

    If you tried uninstalling SQL Server 2005; and still see its traces in the system (Services or files); try doing following From its installation source; issue, start /wait Setup.exe /qb REMOVE=ALL INSTANCENAME=<InstanceName>, Use MSSQLSERVER as instance name for default start /wait msiexec.exe /qb /X setup\sqlncli.msi Uninstall ...
    Posted to Khurram Aziz (Weblog) by khurram on February 18, 2006
  • sysxlogins

    SQL Server 2000 had certain system tables; using them was not encouraged and neither were they documented publicly. However no one was stopping you to use it and people have used it to do different things. I myself have used few of them; and today I discovered a “breaking change” between SQL 2000 and SQL 2005 regarding sysxlogin. Technically ...
    Posted to Khurram Aziz (Weblog) by khurram on February 7, 2006
  • XACT_ABORT

    Using transactions in SQL Server is sometimes tricky. Here is today’s learned lesson. If you set xact_abort to on; you don’t need to rollback the transaction; it gets automatically rolled back in case of any error. One thing that can lead you to problems is; that transactions get rolled back when you close the connection. If you want to perform ...
    Posted to Khurram Aziz (Weblog) by khurram on January 23, 2006
  • Reporting Services :: ReportServerUrl

    If you have configured SQL Services Reporting Services, and specifically has set ReportServerUrl in Report Manager’s configuration, you might get the following exception. The configuration file contains an element that is not valid. The ReportServerUrl element is not a configuration file element If this is the case; erase the value being set ...
    Posted to Khurram Aziz (Weblog) by khurram on January 3, 2006
  • Attaching/Detaching SQL database :: sp_ChangeObjectOwner

    If you detach your database and attach it to another SQL Server instance; chances are that same logins doesn’t exists. If there are some database objects in a database which are not owned by dbo but by some login which might not exists in the second server, you should change owner of such objects to dbo sp_changeobjectowner @objname = ...
    Posted to Khurram Aziz (Weblog) by khurram on January 2, 2006
  • To Indexed View Or Not?

    This year; we computerized the attendance system of our company. And as the year is ending; everyone is expecting a yearly attendance report. When system was made; it was not stressed test; and today; when I evaluated the report to see it will work when people will view it tomorrow; it didn’t work (as expected </smile>) The report is based ...
    Posted to Khurram Aziz (Weblog) by khurram on December 31, 2005
  • SQL Server 2005 :: The First Impression

    I strongly recommend not configuring SQL Server 2005 Developer Edition and SQL Server 2005 Express on your development machine, unless you have lot of memory and system resources. Don’t install SQL Server 2005 Management Studio and SQL Server management Studio Express CTP on a single machine; you will get weird exception in SQL Server 2005 ...
    Posted to Khurram Aziz (Weblog) by khurram on December 29, 2005
  • SQL Server 2005 Express :: Remote Desktop

    In last few posts, here and here; I had been complaining that I am not able to configure the SQL Server 2005 Express Edition on machines which are part of the active directory. Well; there was one stupid reason; I was doing that experiment in afternoon from my home machine. VWD/SQL Express were working fine on my home PC; because I was ...
    Posted to Khurram Aziz (Weblog) by khurram on November 30, 2005
  • Ready To Rock?

    So finally Visual Studio 2005; SQL Server 2005 and BizTalk Server 2006 are out; let’s see when they will be available in local markets </smile> BTW; their theme is cool; Ready to Rock? Till we get our hands on Visual Studio and SQL Server 2005; we can try their Express versions; the Visual Studio lineup (Visual C# 2005 Express, Visual C++ ...
    Posted to Khurram Aziz (Weblog) by khurram on November 8, 2005
  • SQL Server:: Corrupt sysdepends can create problem in DTS

    SQL Server internally keeps tracks of database objects and their inter-dependencies. In routine operations; I guess this information is not being used; however if you Script your database (SQL-DMO API) this information is used to order the DML queries. The information of the database objects and their inter-decencies are stored in two special ...
    Posted to Khurram Aziz (Weblog) by khurram on September 9, 2005
  • SQL Server Reporting Services :: Security Settings Not Working

    I love SQL Server Reporting Services. It’s very fine platform; has number of options for accessing reports; like web based portal; Sharepoint webparts; URLs and web services. Above this all; it provides extendibility at multiple points; like data providers; data rendering; report designing; report delivery and so forth.   Few weeks back; I ...
    Posted to Khurram Aziz (Weblog) by khurram on July 22, 2005
  • Reporting Services :: Report Manager giving 401 after installing Service Pack 1 on Windows 2003

    Installing Service Pack 1 on the Windows 2003 box resulted problem in accessing Report Manager web site of SQL Server Reporting Services. We were having “The request failed with HTTP status 401: Unauthorized”   I checked logs of IIS, Report Manager and system’s event logs, but no use. Reporting Server web service was accessible just fine; ...
    Posted to Khurram Aziz (Weblog) by khurram on June 2, 2005
  • NAT :: SQL :: Sharepoint

    Last evening, I wanted to configure a box for multi-purpose. I am writing down the problems and their work-around that I faced J   Networking :: NAT   Network Address Translation (NAT) is useful to let people on private subnet to access the other subnets. It can be configured on Windows 2003 box easily. However if you have multiple ...
    Posted to Khurram Aziz (Weblog) by khurram on January 28, 2005
  • SQL Server Disaster Recovery

    For those who work as a DBA or has to manage a SQL Server, sql-server-performance has a great link to an article from Brian Knight that discusses Disaster recovery and is “A Survival Toolkit for the DBA“.  It even comes with a bunch of scripts already written.  Here is the link
    Posted to Perceptions (Weblog) by kaasu on December 22, 2004
  • SQL Server UDF for converting columns recordset to list (2)

    This is a continuation of my previous post about converting a recordset to a csv string. Here is the code for the udf. CREATE FUNCTION dbo.toList(@wClause varchar(1000),@addQuote bit = 0)  RETURNS varchar(2000) AS  BEGIN declare @currentCol varchar(255)declare @returnList varchar(8000) declare SysCols cursorfor select country from ...
    Posted to Perceptions (Weblog) by kaasu on September 7, 2004
  • SQL Server UDF for converting columns recordset to list

    Recently while working on an application, I developed a useful User Defined Function (UDF) for SQL server which I though I would share. Various users of the application set up their preferences for kind of people they are looking for dating and frienship. One of the item in their preference is location of the other person which is stored as a ...
    Posted to Perceptions (Weblog) by kaasu on September 5, 2004
Powered by Community Server (Personal Edition), by Telligent Systems