Search This Blog

October 05, 2009

How to conevert Hex value into integer format

Following any of the convertions will work if we want to convert HEX value into Int value in SQL


select
convert(int,CONVERT(binary(4),'0x99CCFF',1)),
convert(int,CONVERT(binary(4),'0x0099CCFF',1)),
convert(int,0x0099CCFF),
convert(int,0x99CCFF)

June 13, 2009

SQL Server Analysis Services Issues and Solutions

While browsing the cube in BIDS the following error message is displayed.

No connection could be made because the target machine actively refused it 127.0.0.1:2383

Solution: Build and Deploy the cube.

June 12, 2009

How to identify SQL Server Database file location

If you want to know where exactly the database files or stored for each database using T-SQL. You can use the following query
This will work on Both SQL Server 2005 and Sql Server 2008


SELECT name AS [Database Name], physical_name AS [File Location]
FROM sys.master_files

June 08, 2009

DBCC commands


  • dbcc useroptions -- This command is used to display the current user settings for that connection

select * from sys.dm_exec_sessions

This displays all the user sessions connected to the sql server and different options made with the session.

May 20, 2009

How to rename all the file extensions in a folder

Open a command/cmd window
navigate to the folder
type the following command
rename *.originalextension *.newextension
Example: To cange all jpg file extensions to gif extensions. You can use the following command.
rename *.jpg *.gif
Modify the values originalextension and newextension as required.
You can save this command in a batch file and execute in the respective folders.