Wednesday, 24 September 2014

RDP Copy Paste is not Working

Below Solution Comes when User is not able to Copy Paste data from Desktop to RDP
 
If any time we come in this kind of scenario below is the solution
 
1) Load Up Task Manager
2) Go to Process TAB
3) Select rdpclip.exe
4) Click End Process
5) Click on Application Tab
6) Click on New process and Type rdpclip
 
Developer Problem is solved...................


Happy Reading
Sanjay
mesanjaybakshi@gmail.com


 

Saturday, 23 August 2014

ACID


In computer science ACID is a set of properties which make sure that database transactions are processed reliably. In the context of database a single logical operation called Transaction.

 Atomicity


Atomicity means “All or Nothing”. If one part of transaction fails whole transaction will get into failed state and database status left unchanged. This concepts works in real time environment when database will suffer auto shut down, electricity failure, error and crashes.

Consistency


Consistency property ensures that whatever value database will store will pass all the validation and that is a correct value.

This will make sure that data will be valid according to defined rules, not limited to constraints, cascades and triggers

Isolation


Isolation property ensures that the concurrent execution of transactions results in a system state that would be obtained if transactions were executed serially. i.e one after another.

No transaction sees the intermediate effects another transaction. If we have two transaction doing same things isolation will ensure that both will run seprately

Durability


Durability means that once a transaction has been committed, it will remain so even in the power loss also. In relational database once a group of SQL statement runs the results will be stored permanently even if the database crashes immediately there after. 


Happy Reading
Sanjay
mesanjaybakshi@gmail.com

Saturday, 12 July 2014

Accent-Sensitivity in SQL Server

Accent-Sensitivity in SQL Server

Accent comes in picture where an application runs most the queries with first name and last name.

Some application which frequently include the functionality to support database queries based on first name and last name, which is a problematic when names contain accent character and the database is accent – sensitivity

For Example we have a table Emp_Master where we want to check all the names start with TEST, the result should be include

   TEST
   TEST1
   TEST123
   TEST1234
   ´TEST12345
   TEST´4567

But when database collation is accent sensitive the result include only

  TEST
  TEST1
  TEST123
  TEST1234

If you noticed above queries has left out all the name which are related with accent which is not a desire result.

To get a desire result we can provide two solutions to above

1)       Configure the database so that it is not accent sensitive, change the collation to SQL_LATIN1_GENERAL_CP1_CI_AI
2)       Select * from Emp_Master where fname like ‘TEST%’ collation SQL_LATIN1_GENERAL_CP1_CI_AI

Option 1 is a permanent solution and the so that when you install any new instance change the collation second option is based on requirement so that you do not have to change any database settings

Change the SQL Server Collation

Please remember it is a complex operation and can perform with below three steps

1)       Create the scripts that need to re create the database

2)       Export all your data

3)       Drop all the user database

4)       Rebuild master database new SQL Collation Property by using below command

 

Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName 
/SQLSYSADMINACCOUNTS=accounts /[ SAPWD= StrongPassword ] 
/SQLCOLLATION=CollationName

 

 Keep Reading!!!!!!!!! (Sanjay) (mesanjaybakshi@gmail.com)







Friday, 11 July 2014

(SQL Server )Output Clause $action Function

In SQL Server 2005 and above there is a feature of displaying an output result by output clause.The clause returns a copy of the data which user has inserted or deleted.

User can return the data into a table variable, temporary or parmanent table or to the processing application that's call the DML statements. We can use this as a archieving,confirmation message or other application requirements.

SQL 2005 allows user to add on output clause to insert,update and delete statement.Sql 2008 make us eligible to use output clause with Merge statement also.

In this blog we will learn how to use output clause with these statements.

Using with Insert Statement
*****************************************************
--Created Main Table which is actual table
Create Table TEST_INSERTED
(
EMP_NAME VARCHAR(100)
)
--Created Recorded Table where data needs to be inserted 
Create Table TEST_INSERTED_RECORDED_Example1
(
EMP_NAME VARCHAR(100)
)
--Inserted record into Actual Table
Insert into TEST_INSERTED
Output
INSERTED.*
INTO TEST_INSERTED_RECORDED_Example1
values('ABC')

--Get Record into Actual Table
 Select * from TEST_INSERTED

--Get Record into Recorded Table
Select * from TEST_INSERTED_RECORDED_Example1

User can see same record in both the table
******************************************************
Using with Update Statement
********************************************************We will use same actual table for update statement but we will create new recorded table, as we will store old value and new value both.

--Created Recorded Table where data needs to be inserted
Create Table TEST_INSERTED_RECORDED_Example2
(
NEW_EMP_NAME VARCHAR(100),
OLD_EMP_NAME VARCHAR(100)
)

--Write Update Statement
Update TEST_INSERTED
SET EMP_NAME='ABC_NEW_NAME'
output
Deleted.Emp_Name,
Inserted.Emp_Name
into
TEST_INSERTED_RECORDED_Example2
WHERE EMP_NAME='ABC'

--Get Record into Actual Table
Select * from TEST_INSERTED

--Get Record into Recorded Table
Select * from TEST_INSERTED_RECORDED_Example2

******************************************************

Using with Delete Statement
********************************************************We will use same actual table for delete statement but we will create new deleted table

--Created Recorded Table where data needs to be inserted 
Create Table TEST_INSERTED_RECORDED_Example3
(
Deleted_EMP_NAME VARCHAR(100)
)

--Write Update Statement
Delete from 
TEST_INSERTED
Output Deleted.* Into TEST_INSERTED_RECORDED_Example3


--Get Record into Actual Table
Select * from TEST_INSERTED

--Get Record into Recorded Table
Select * from 
TEST_INSERTED_RECORDED_Example3

******************************************************

Happy Reading.......
Sanjay
mesanjaybakshi@gmail.com

Saturday, 5 July 2014

SQL Server (CTE)

 
 
 
 
What is CTE
 
CTE stands with Common Table Expression. CTE can be thought as a temporary result set that defined within the execution scope of Single Select/Update/Delete/Create View.
 
This worked like derived table which does not store data as an object and last only till the duration of query.
 
Where Developer can use CTE
 
1) When Developer wants to use Recursive Query
2) Substitute of View when you want to run the View and do not want to store the definition
3) Refrence as a table which developer uses very often
 
 
Disadvantage of CTE
 
CTE can not be nested like Sub Query
 
How to use
 
USE <DB NAME>
GO
 
With TEST_CTE (Emp_Id,Emp_Name,DOJ)
as
--Define the Query
(
 
Select Emp_Id,Emp_Name,DOJ  from <Table Name>
 
)
 
--Define the Query Result
 
 
Select Emp_Id,Emp_Name,DOJ from Test_CTE
 
 
 
Happy Reading!!!!!!!!!!!!!!

 

Friday, 27 June 2014

Assign Vb Macro (Message Box) msgbox

The MsgBox is a dialog box in Excel VBA we can use to inform the users of your program. There are 5 arguments which we can use with MsgBox function.



 
1) Prompt - This is  required argument where user writes the Text / Warning to display

2) buttons - Optional Argument - User can select Ok/Cancel etc buttons from this argument

3) title - Optional Argument - String Expression displayed in the title bar of message

4)helpfile - Optional Argument - User can attach the help file

5)context - Optional Argument - Require Numeric Expression to assing context in Help file. If context is provided then helpfile must also be provided
 
 
We can achieve above task by following steps

1) Open Excel
2) Select Developer Tab
3) Select Button Under Insert Link (Control Tab)
4) Drag Button on Excel Sheet
5) Right Click on Button
6) Select Assign Macro





MsgBox "Welcome to Learn IT with Sanjay"






Message with Cell Value

MsgBox "Welcome to Learn IT with Sanjay, you have Entered " & Range("I8").Value



New Line Message

MsgBox Range("I8").Value & vbNewLine & Range("I9").Value



See you with next LEARNING

Sanjay
You can contact me  @ mesanjaybakshi@gmail.com for Queries


Assign VBA Macro (Running Business Validation Check Length of Excel Cell)

Yesterday one person asked that how can we run a business validation in Excel? I have given below example and same I sharing with you all.

In last post of VBA we have learnt "How to add two numbers via VBA" now what if I change the situation and mention that if Excel Cell values are empty system should run the business validation and display an error message if user is not passing any values in Cell.

We will follow below steps to check whether user is passing the values or not.

Sub Button1_Click()
If Len(Range("I7").Value) = "0" Then //Check the length of Cell I7
MsgBox ("Please Enter Value in Cell I7") //Display warning message to User
Exit Sub//Block the statement until above condition does not pass the validation
End If

If Len(Range("I8").Value) = "0" Then//Check the length of Cell I8
MsgBox ("Please Enter Value in Cell I8")//Display warning message to User
Exit Sub//Block the statement until above condition does not pass the validation
End If


Range("I9").Value = Range("I7").Value + Range("I8").Value

Len - Function return the length of specified string.
MsgBox - Displays a message in dialog box, wait for user to click the button

As a basic concept we are checking the length of particular cell and making an If condition.





Now this helps user to run the basic validations in Excel.

Keep Learning
Sanjay
mesanjaybakshi@gmail.com