Translate

Wednesday, 9 January 2013

Latein General Collation Error in Sql Server


1.    ALTER DATABASE DBName
       SET SINGLE_USER WITH ROLLBACK IMMEDIATE;


2.   ALTER DATABASE DBName
     COLLATE Latin1_General_CI_AI;

3.  ALTER DATABASE DBName
     SET Multi_USER

4. we have used any split function in above DBName, Error will be occur. So we have to drop the split function and exec the above query.


latin collation error when creating or executing stored procedure:


we have create any temp table when creating stored procedure, which column we check to permanent table column, and those collation of column  may be not equal.

check the collation:
SELECT
col.name, col.collation_name
FROM
sys.columns col
WHEREobject_id = OBJECT_ID('TableName')

Modify coolation:

ALTER TABLE TableNameALTER COLUMN ColumnName
VARCHAR(100) COLLATE SQL_Latin1_General_CP1_CI_AI NOT NULL

Solution for following error

Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

Error will be occur when we create Temp Table and match some column or update column from temp table. so we create temp table from source table

EX:


Select EmpNo ,Empname ,Age Into #Temp_EMP
 From tbl_Employee Where 1 = 2

http://www.mssqltips.com/sqlservertip/2440/create-sql-server-temporary-tables-with-the-correct-collation/





Tuesday, 25 December 2012

CLR integration in sqlserver

http://www.codeproject.com/Articles/19502/A-T-SQL-Regular-Expression-Library-for-SQL-Server:

Step 1

--Enable CLR Integration
exec sp_configure 'clr enabled', 1
GO
RECONFIGURE
GO


Step 2:

CREATE ASSEMBLY [SqlRegEx] FROM 'C:\Project\SqlRegEx.dll' WITH PERMISSION_SET = SAFE

Step 3:

CREATE FUNCTION [dbo].[ufn_RegExIsMatch]
(@Input NVARCHAR(MAX), @Pattern NVARCHAR(MAX), @IgnoreCase BIT)
RETURNS BIT
AS EXTERNAL NAME SqlRegEx.[SqlClrTools.SqlRegEx].RegExIsMatch

Note:


SELECT dbo.ufn_RegExIsMatch('Hello World', 'w', 1) --Ignores Case
SELECT dbo.ufn_RegExIsMatch('Hello World', 'w', 0) --Case Sensitive


Example:
Find if Extended Acsii value
select * from TableName where dbo.ufn_RegExIsMatch(ColumnName,'[^\u0000-\u007F]',0 )=1

-------------------------------------------------------------------------------------------------------


Remove HTML tags from strings using the SQL Server CLR








Thursday, 6 December 2012

SQL Server


ALTER DATABASE Compatibility Level (Transact-SQL) (Ex: Enable pivot table)

ALTER DATABASE database_name 
SET COMPATIBILITY_LEVEL = 100

Note: 
        80 = SQL Server 2000 
        90 = SQL Server 2005 
        100 = SQL Server 2008 and SQL Server 2008 R2
        110 = SQL Server 2012

Wednesday, 5 December 2012

XCode for MAC

The Xcode developer tools package provides everything you need to create great applications for Mac, iPhone, and iPad.

The Xcode toolset includes the amazing Xcode IDE, with the Interface Builder design tool and Apple LLVM compiler fully integrated. 




Xcode IDE:


Designed from the ground up to take advantage of the newest Apple technologies, Xcode integrates all the tools you need. The unified interface smoothly transitions from composing source code, to debugging, and even to designing your next stunning user interface, all within the same window.

The Xcode workspace is all about keeping you focused. As you type, Live Issues will immediately alert you to coding mistakes, displaying a message bubble beside your code for more detail. Hit the Run button to launch your Mac app, or upload the app to your test device, and immediately start debugging. Hover the mouse pointer above a variable to inspect its value at runtime, never having lost your place in the editor.

Apple LLVM Compiler

Apple’s next generation compiler technology, the Apple LLVM compiler, does more than build your app. Apple LLVM technology is integrated into the entire development experience. The same parser used to build C/C++ and Objective-C powers Xcode’s indexing engine, providing incredibly accurate code completions. As you work, Apple LLVM is constantly evaluating what you type, identifying coding mistakes that Xcode shows as Live Issues, and thinking ahead for ways to Fix-it for you. Other compilers can tell you what is wrong — Apple LLVM can make it right.

That s all....

-> it' s user friendly for mac OS. 
-> Easy to development and so on.....

Saturday, 17 November 2012

Useful blog spot link

Update Panel and Callback Panel


AJAX Page - UpdatePanel


CallbackPanel has 2 elements:
  • content element can contain contain html, js, css and other server controls - like Obout Calendar, Obout EasyMenu, ASP.NET controls (ASP Textbox, ASP DropDownList, etc.).
  • loading element is optional and it can include the html to display while the panel is loading.
    If ommited, a default "Loading..." text is shown and all styles from content element are applied to theloading element.
    It is visible only when the callback panel is updated using client-side UpdatePanel method.
Both content and loading elements can contain style definitions. 


<oajax:CallbackPanel runat="server" ID="callbackPanel1">

<content style="border:1px solid gray;width:400px;height:200px">

some content

</content>

<loading style="border:1px solid red;width:400px;height:200px">

Loading...please wait

</loading>

</oajax:CallbackPanel>

---------------------------------------------
It is very useful to load dynamic scripts, dynamic stylesheets, dynamic controls, etc. 

The update of the panel is done without reloading the page. 

Client-side update 
ob_post.UpdatePanel("callbackPanel1"); 
ob_post.UpdatePanelInContainer("callbackPanel1", "container"); 
ob_post.UpdatePanelFromPage("callbackPanel1", "container", "callbackPanels.aspx"); 
ob_post.UpdateAllPanels(); 

Server-side update 
UpdatePanel("callbackPanel1"); 
UpdatePanel("callbackPanel1", "container"); 
UpdateAllPanels(); 
--------------------------------------------------------------------
Update Callback Panel specified by id. 

For example, you can use the next lines: 

Client-side update
        ob_post.UpdatePanel("callbackPanel1"); 
  

Server-side update
        UpdatePanel("callbackPanel1"); 
  

Example 1 - Callback Panel contain html, css and ASP DataList control.
<%@ Register TagPrefix="oajax" Namespace="OboutInc" Assembly="obout_AJAXPage" %>

        <oajax:CallbackPanel runat="server" ID="callbackPanel1">
            <content style="border: gray 1px solid;">
                <style>
                .divItem
                {
                    border-bottom:1px solid gray;
                    font-size:9px;
                    width:130px;
                    padding-top:4px;
                    padding-bottom:4px;
                }
                </style>
                <b>My List</b>
                <asp:DataList id="dataList1" runat="server">
                    <ItemTemplate>
                        <div class="divItem">
                            some item content
                        </div>
                    </ItemTemplate>
                </asp:DataList>
            <content>
            <loading style="border: gray 1px solid;">
                Loading...please wait
            </loading>
        </oajax:CallbackPanel>
    

See also live UpdatePanel Example


Example 2 - Callback Panel contain ASP Literal control.
<%@ Register TagPrefix="oajax" Namespace="OboutInc" Assembly="obout_AJAXPage" %>

        <oajax:CallbackPanel runat="server" ID="callbackPanel1">
            <content style="border: gray 1px solid;">
                <asp:Literal id="serverTime" Runat="server"></asp:Literal>
            </content>
            <loading style="border: gray 1px solid;">
                Loading...please wait
            </loading>
        </oajax:CallbackPanel>
   

Example 3 - multiple Callback panel.
Client-side update
        ob_post.UpdateAllPanels(); 
  

Server-side update
        UpdateAllPanels(); 

public void UpdateAllPanels()
        UpdatePanel("CallBackPanel1");
        UpdatePanel("CallBackPanel2");
}

<%@ Register TagPrefix="oajax" Namespace="OboutInc" Assembly="obout_AJAXPage" %>
        <!-- CallbackPanel1-->
        <oajax:CallbackPanel runat="server" ID="callbackPanel1">
            <content style="border: gray 1px solid;">
                <span style="color:red">
                    <asp:Literal id="serverMillisecond" Runat="server"></asp:Literal>
                </span>
            </content>
        </oajax:CallbackPanel>

        <!-- CallbackPanel2-->
        <oajax:CallbackPanel runat="server" ID="callbackpanel2">
            <content style="border: gray 1px solid;">
                <asp:Literal id="serverTime" Runat="server"></asp:Literal>
            </content>
        </oajax:CallbackPanel>


Example 4- Callback Panel inside Update panel.
<%@ Register TagPrefix="oajax" Namespace="OboutInc" Assembly="obout_AJAXPage" %>
 <tr>
    <td>
         <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
           <oajax:CallbackPanel ID="CallBackPanel1" runat="server">
             <Content>
                 <table border="0" width="100%">
                  <tr>
                     <td>
 age ID="imgIndication" runat="server" Height="15px" ImageUrl="~/images/icon-delete.gif" Width="15px" />
                     </td>
                  </tr>
                </table>
              </Content>
      </oajax:CallbackPanel>
    </ContentTemplate>
   </asp:UpdatePanel>
  </td>
 </tr>

Server-Side Update
    UpdatePanel("callbackPanel1");