Skip to main content

Posts

Command to reindiex,update statistics, database tables in sql through query analyzer

Write this command in query editor then run the command to reindex database use yourdatabase dbcc dbreindex('DBNM') Then use this command to update statistics of database update statistics 'DBNM' Command to reindex table DBCC DBREINDEX(YourTableName, '', 80) or DBCC DBREINDEX(YourTableName, '', 70)

NGOs in Mumbai

List of the names of the NGOs in Mumbai Helpage India is a NGO working for the betterment of the elderly. http://www.helpageindia.org/ Childline India is a NGO working for child protection and rights. http://www.childlineindia.org.in/ Dignity Foundation is a NGO which works for the betterment of the elderly. http://www.dignityfoundation.com/ National Society for Equal Opportunities for the Handicapped (NASEOH) is a NGO working for the betterment of handicapped people. http://www.naseoh.org/ Humsafar Trust is a NGO working for spreading AIDS awareness. http://www.humsafar.org/ Bombay Leprosy Project is a NGO working for leprosy eradication. http://www.bombayleprosy.org Youth for Equality http://www.youthforequality.com Construct Life's Building Blocks For Poor Children. Contribute Now! India based NGO dedicated to Cancer Patients Care, Cancer Patients & Cancer ... King George V Memorial, Dr. E. Moses Road, Mahalakshmi, Mumbai - 400 011 w

Stored procedure to Insert, Update and delete records

You can write Stored procedure following  to Insert, Update and delete records from tables in sql. 1. Stored procedure to Insert records in table. set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO Create PROCEDURE [dbo].[SP_ITEM_Insert] @CD char(7), @ITEM_DESC CHAR(60) AS INSERT [dbo].[ITEM] ( [CD], [ITEM_DESC] ) VALUES ( @CD, @ITEM_DESC ) 2. Example of Stored procedure to Update data in to table . set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO Create PROCEDURE [dbo].[SP_ITEM_Update] @CD char(7), @ITEM_DESC char(60) AS UPDATE [dbo].[ITEM] SET [ITEM_DESC] = @ITEM_DESC WHERE [CD] = @ CD 3. Example of Stored procedure to Update data in to table set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO Create PROCEDURE [dbo].[SP_ITEM_ Delete] @ CD char(7) AS DELETE FROM [dbo].[ITEM] WHERE [CD] = @CD You can set more conditions and columns as per requirement .

Example of group by, having,min, max,convert method,get top 5 record etc in sql select query

Example of group by, having,min, max in sql select query select id, min(no) , max(no) id from mytable group by id having min(no) <> 12 order by id; I hope you will get Idea to use group by, having and aggregate function. Select first five record from table in sql To get first 5 records from table you need to use rownum column in select query. Here testtable is table and rownum is column which is physically not visible to it remain in all sql table. select *from testtable where rownum<=5 Select Query to Get Total Experience of All Employee in Sql  This is a Select Query to Get Total Experience of All Employee in Sql . Here Employee is a table name where all master data of Employee exists. SELECT E_ID, E_Name , E_Date_of_Joining, DateDiff('Year', E_Date_of_Joining, GetDate()) As Experience, E_salary FROM Employee  Select query that separate particular part that is separated by special character in sql select query that separate particular part th

Function to check key validation using asp.net

Function to check key validation using asp. net ublic Function KeyValid(ByVal keyChar As Char, ByVal strType As KeyType) As Boolean Dim blnRetVal As Boolean Dim strNumStr As String = "0123456789" Dim strDecStr As String = "0123456789." Dim strAlpha As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" Dim strDate As String = "0123456789/" Dim strPhone As String = "0123456789-()," Dim strTime As String = "01234567890:" Dim strEqn As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./*+-()|" Dim strAlphaNum As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" Try blnRetVal = False If Asc(keyChar) < 32 Then KeyValid = False Exit Function End If Select Case strType Case KeyType.KeyAlpha If strAlpha.IndexOf(keyChar) < 0 Then blnRetVal = Not blnRetVal Case KeyType.KeyAlphaNum If strAlphaNum.IndexOf(keyChar) &

How to get Long running queries from sql database

How to get Long running queries from sql database Just open query analyzer and then use current database then run the following query to get desired result. SELECT creation_time ,last_execution_time ,total_physical_reads ,total_logical_reads ,total_logical_writes , execution_count , total_worker_time , total_elapsed_time , total_elapsed_time / execution_count avg_elapsed_time ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1, ((CASE statement_end_offset WHEN -1 THEN DATALENGTH(st.text) ELSE qs.statement_end_offset END - qs.statement_start_offset)/2) + 1) AS statement_text FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st where total_elapsed_time >= 300000000 --5 min ORDER BY total_elapsed_time / execution_count DESC;

ITIL Foundation v.3 Certification

Exam : EXIN EX0-101 Title : ITIL Foundation v.3 Certification Version : V3.88 1. What are the three types of metrics that an organization should collect to support Continual Service Improvement (CSI)? A. Return On Investment (ROI), Value On Investment (VOI), quality B. Strategic, tactical and operational C. Critical Success Factors (CSFs), Key Performance Indicators (KPIs), activities D. Technology, process and service Answer: D 2. Event Management, Problem Management, Access Management and Request Fulfilment are part of which stage of the Service Lifecycle? A. Service Strategy B. Service Transition C. Service Operation D. Continual Service Improvement Answer: C 3. Reliability is a measure of: A. The availability of a service or component B. The level of risk that could impact a service or process C. How long a service or component can perform its function without failing D. A measure of how quickly a service or component can be restored to normal working Answer

Calling a macro from a macro that displays a chart.

Calling a macro from a macro that displays a chart. Once the chart is created, should the user click on the chart it will execute a macro. Sub TestAssignMacro() ' Reference ChartObject by Name ActiveSheet.ChartObjects("Chart 1").OnAction = _ "CopyChartWithRatio" ' ... or reference ChartObject by Index (it's the same) ActiveSheet.ChartObjects(1).OnAction = _ "CopyChartWithRatio" End Sub Sub CopyChartWithRatio() ' When you click Chart, this macro will run MsgBox "Hi from Chart" End Sub

Highlighti​ng Duplicates Based On Two Columns in Excel

When your requirements were simply to detect repeated occurrences of the value in Column C, I suggested using conditional formatting with the formula: =MATCH(C1,C:C,0)<>ROW(C1) Now you have extended the requirements to detect only those cases where the description (in Column D) is different. That simply means extending the formula to something like: =AND(MATCH(C1,C:C,0)<>ROW(C1),OFFSET($D $1,MATCH(C1,C:C,0)-1,0)<>D1) The point is that you can achieve the desired results entirely with nothing more than a conditional format.

Compare Values in the Same Column in sql

Need to locate customers who has placed their orders twice in a certain period. Now, the order might not be exactly the same, thus  cant use a normal query finding duplications, but rather compare the order values of a customer and indicate the orders whose values differ with about 20%.. the simplest would be select t1.customerid,t1.orderid,t1.ordervalue ,t2.ordervalue from Table1 as T1 join Table1 as T2 on t1.orderid <> t1.orderid and t1.customerid = t2.customerid and t1.ordervalue < t2.ordervalue * 1.2 and t1.ordervalue > t2.ordervalue * .8

Insert Names Across Rows Using Macro,Open Sheet is in the Home Position,Export Camera Picture,Convert Dates- excel Tips

Insert Names Across Rows Using Macro in excel  standard module Sub Test() Dim x As Worksheet Application.DisplayAlerts = False On Error Resume Next Sheets("DataSheet").Delete Names("Data").Delete Application.DisplayAlerts = True On Error GoTo 0 Sheets.Add().Name = "Datasheet" Dim nm As Name Dim i As Long Dim avarSplit As Variant Dim noPage As Variant i = 1 Application.ScreenUpdating = False With Sheets("DataSheet") For Each nm In Names .Cells(1, i) = nm.Name .Cells(2, i) = "'" & nm.RefersTo .Cells(3, i) = nm.Value 'noPage = Split( ????? i = i + 1 Next nm End With Columns("A").Resize(, i).AutoFit End Sub '- ' in workbook module edd: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Call Test End Sub '--   Code to The W

Insert a Chart Built in a Workbook Into Another Workbook

Insert a Chart Built in a Workbook Into Another Workbook Insert into allocated Cells region in a workbook resulted charts built in a different workbook, Can this be done? How would you integrate that chart into some kind of place holder in the workbook that is expecting to get that chart Sub CopyChart() ' Copy Chart 'Chart 1' from ThisWorkbook Worksheet 'Sheet1' ' to Workbook 'BookB.xlsm' Worksheet 'Sheet1', ' at specified position. '-- Dim wbkSource As Workbook ' Source Workbook Dim wksSource As Worksheet ' Source Worksheet ' Top-Left cell where Chart is going to be pasted Dim cSourceTopLeft As Range Dim sTargetTopLeft As String ' Chart Top-Left cell address '-- Dim wbkTarget As Workbook ' Target Workbook Dim wksTarget As Worksheet ' Target Worksheet ' Top-Left cell where Chart is going to be pasted Dim cTargetTopLeft As Range Dim sFil

Kanyakumari Tamilnadu, nature ,beauty of place

Bird Sanctuary Kumarakom

Bird Sanctuary Kumarakom

Beautiful Kerala with backwater

Beautiful Kerala with backwater