Tuesday, 29 May 2012

Access SQL Server using ip address (remote)

  • Make sure the SQL Browser service is nunning...
  • the make sure the IP Address and Instance name (255.255.255.255\SQLSERVER)
  • Turn off your firewall or add exception the mssqlserver
  •  Go to sql server properties -->connections-->make check mark in "Allow remote connections to this server"
  • Go to sql server configuration manager and select sql server network configuration-->Enable the TCP/IP

It will work fine with best of my knowledge....


Monday, 14 May 2012

Get duplicate records

SELECT  S_id , COUNT(*) FROM Table_Name GROUP BY S_id HAVING COUNT(*)>1

Saturday, 5 May 2012

Turn on logging on a Web site in iis

Turn on logging on a Web site

Internet Information Services (IIS) logging is designed to be more detailed than the event-logging or performance-monitoring features of Windows Server 2003. The IIS logs can include information such as who has visited your site, what they viewed, and when the information was viewed last. You can monitor attempts, either successful or unsuccessful, to access your Web sites, virtual folders, or files. This includes events such as reading the file or writing to the file. Events can be logged independently for any site, virtual folder, or file. By regularly reviewing these log files, you can detect areas of your server or your sites that may be subject to attacks or suffer from other security problems.

To turn on logging on a Web site, follow these steps:
  1. Start the Internet Information Services Manager. To do this, click Start, point to Administrative Tools, and then click Internet Information Services.
  2. Double-click your server_name, where server_name is the name of the server.
  3. Expand the Web Site folder.
  4. Right-click the Web site for which you want to turn on logging, and then click Properties.
  5. On the Website tab, select Enable Logging.

    Note Both Enable Logging on the Website tab and Log visits on the Home Directory Tab must be checked for logging to be enabled.
  6. Select a format in the Active log format list.
  7. Click Properties, click the Advanced tab, and then select the items that you want to monitor in the log.

    NOTE: If you select ODBC logging, click Properties, provide the ODBC Data Source Name (DSN), table, user name, and password, and then click OK
  8. On the General tab, select the way that you want to schedule the logging or change the Log file folder. For more information, see the "Configuration options for saving IIS log files" section of this article.
  9. Click OK. 
courtesy : http://support.microsoft.com/kb/324279
C:\WINDOWS\system32\LogFiles\

Friday, 4 May 2012

chumma p e n dr ive







e drive is pen drive , open pen drive in this manner if this pen drive attacked by virus. some times all file are hide by virus. first we need to check the properties of pen drive.

Monday, 30 April 2012

Get the Day Name from Date In SQL SERVER

In SQL
select datename (dw, '4/30/2012') as NameOfDay  --dw is refer as DATEPART
 the result is 'Monday'

 From this we can find the day of Date...
datepart
Is the parameter that specifies the part of the date to return. The following table lists dateparts and abbreviations recognized by Microsoft SQL Server 2005.
Datepart Abbreviations
year
yy, yyyy
quarter
qq, q
month
mm, m
dayofyear
dy, y
day
dd, d
week
wk, ww
weekday
dw
hour
hh
minute
mi, n
second
ss, s
millisecond
ms
The weekday (dw) datepart returns the day of the week, such as Sunday, Monday, and so on.
 http://msdn.microsoft.com/en-us/library/ms174395%28v=sql.90%29.aspx


Friday, 27 April 2012

About subquery in SQL Server

A subquery can be nested inside the WHERE or HAVING clause of an outer SELECT, INSERT, UPDATE, or DELETE statement, or inside another subquery. Up to 32 levels of nesting is possible, although the limit varies based on available memory and the complexity of other expressions in the query. Individual queries may not support nesting up to 32 levels. A subquery can appear anywhere an expression can be used, if it returns a single value.

how to enable 'sa' login in sql server 2005

step 1 , login as windows authenticatin mode, using  'Administrator' login.
step2, Then go to 'Object Explorer'
step 3, Find Security menu from that. Then find Login
step 4,  From Login menu select 'sa' --> properties.
step 5, in left site find the status and make enable in right side. also set the password in General section.

Note:
 it is possible to login failed for windows authentication mode. For this problem there is a possible low disk space in ms sql server installed drive. so make free space then restart computer then attempt to login. it will fine.