Skip to main content

Posts

Showing posts from 2010

Login failed for user 'sa'. Reason: The account is disabled. SQL Server

As the error says the particular login is Disabled. Thus, we need to enable the user. Follow these steps to enable the user. Go to start -> programs. Open Sql server management studio Login to the SQL server (using windows authentication). Expand the security tab. Expand the Login folder. Select the user for which you got this error. In this case 'sa'. Right click and select properties. Enable the user. Save settings. Now it should work fine. Hope this will help.

A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 2 - Connection was terminated)

I told you about the problem faced by my friend while trying to install DotNetNuke for Windows Web App Gallery. He got Login Failed For User 'sa' error. For resolution check here . After resolving the error he tried again to install DotNetNuke and this time he got the error -   A connection was  successfully established with the server, but then an error occurred  during the login process. (provider: Shared Memory Provider, error: 2 -  Connection was terminated) The reason for this was that he forgot to restart the SQL server service after he changed the configurations as explained in my last post.  I am posting it separately as I have seen many of us searching for this kind of error. Hope this will help.

Login Failed For User 'sa'. SQL Server

One of my friend was trying to install DotNetNuke from Windows Web App Gallery. While installing he was prompted for SQL server administrator user ('sa') credentials. He was clueless about this as he never gave a password for it. He tried using his system password (he was working on his personal system) and got the famous  error - Login failed for user 'sa'. Reason: Actually while installing SQL server he had used windows authentication and now he was trying to use SQL Server authentication. To resolve this -  Go to Start-> Programs  and open SQL server management studio. Connect to the SQL Server you want to change user authentication for (using windows authentication). Right click on the SQL Server and select properties. Now select "Security"and select SQL Server authentication Save settings. Now go to Administrative tools and restart the SQL Server service to let the change take effect. Hope this will help yo

TSQL queries-Look into SQL Server Db!!! sysobjects,syscomments,information_schema,sysjobs,sysjobsteps

When I need to change anything in my database or I need to analyze something in it I generally try to play safe and I hope we all try to do so :) !!! I mean, I research on the flow and dependencies and then will jump on any conclusion/solution. Here I just want to share few T-SQL queries which I use for this purpose. These queries also helps in regression. First Query to find presence of particular text in any SQL object. Text can be a table name (in order to find out where all this table is getting used), it can be a procedure or view's name. SQL objects can be procedures, views etc.. SELECT NAME FROM SYSOBJECTS WHERE ID IN ( SELECT ID FROM SYSCOMMENTS WHERE TEXT LIKE '%TEXT GOES HERE%' ) Second Query to find out the dependencies between SQL objects. e.g Table A is getting used in View B. Then the below mentioned query will give you Table A's name as output as View B has dependecy on Table A. Note : if View B is further used in View C and we use V

Check SQL Server Job status (State) using sp_help_job and xp_sqlagent_enum_jobs

This article is about checking the status of a SQL job. In our work place we have lot of SQL jobs. These jobs will run whole day and are business critical. They will load the data and generate extracts which will be used by business people. Thus, it becomes quite essential to support the system efficiently so that the job finishes in time and as desired. Also, while designing a new system sometimes we need to check the dependency of one job over another. In such scenario we need to check whether a particular job has finished or not. All this can be achieved in SQL Server by using the procedures:- sp_help_job xp_sqlagent_enum_jobs Note: xp_sqlagent_enum_jobs is an undocumented proc inside of sp_help_job and is used extensively to get SQL agent job information. sp_help_job: This procedure gives some insight into the status, and information, about a job. This stored procedure provides information such as last start time, job status etc. Syntax sp_help_job { [ @job_id= ] jo

PHP text file handling (Read and Write)

This article is about Text File Handling in PHP. Though now a days we generally use database and XML files for storage but there are still some scenarios in which we need file handling. Well, here are a couple of reasons why you might need to work with files: To move binary data (such as image files) into a database as BLOBs (Binary Large Objects) To import data (such as email addresses) that has been exported from a legacy database or application. To export data out of a database into a text file so that it can be processed offline Rest I am sure you will think of yourself :)!!! File functions in PHP are very similar to those found in the C++ fstream library. Like C++ we first open the file in Read/Write mode and then will actually Read/Write it. Opening a text file We open a file using fopen function. fopen stands for "file open", and is used to create a pointer to the file which we want to open for read/write access. It accepts 2 requir

Running IIS and Apache on same system

Few days back I installed XAMPP. But when I tried to start the Apache service it did not start. The MySql and FileZilla services started without any problem. But the Apache service did not start. It returned a message saying Apache service not started.  The reason for this was that I had IIS installed on the same machine. We can not have two services offered on the same ip and port numbers. On the same server, different services (IIS and Apache) need a unique IP/Port combination. Thus there are two ways to solve this problem:- Using two different IPs  You need two LAN adapters for that. 1. Start > Run> cmd.exe (open command prompt) 2. Type on command prompt C:\Documents and Settings\Administrator> httpcfg  set  iplisten  - i  XXX.XX.XXX.X Note :-  XXX.XX.XXX.X is the IP address on which you want IIS to listen. 2. If the message “’ httpcfg ‘ is not recognized as an internal or external command, operable program or batch file.” appears that means Window