Thursday, 4 August 2011
Friday, 15 July 2011
Split Function in Sql
CREATE FUNCTION DBO.SPLIT ( @LIST NVARCHAR(2000), @SPLITON NVARCHAR(5) ) RETURNS @RTNVALUE TABLE ( ID INT IDENTITY(1,1), VALUE NVARCHAR(100) ) AS BEGIN WHILE (CHARINDEX(@SPLITON,@LIST)>0) BEGIN INSERT INTO @RTNVALUE (VALUE) SELECT VALUE = LTRIM(RTRIM(SUBSTRING(@LIST,1,CHARINDEX(@SPLITON,@LIST)-1))) SET @LIST = SUBSTRING(@LIST,CHARINDEX(@SPLITON,@LIST)+LEN(@SPLITON),LEN(@LIST)) END INSERT INTO @RTNVALUE (VALUE) SELECT VALUE = LTRIM(RTRIM(@LIST)) RETURN END
Wednesday, 13 July 2011
Pass Eval as Argument Of Javascript Function
<input type="button" id="but1" onclick="myFunction('<%# Eval("id") %>','<%# Eval("name")%>' )" />
Saturday, 11 June 2011
Get or set shortdate format from regional setting in .net
Public regKey As Microsoft.Win32.RegistryKey regKey = My.Computer.Registry.CurrentUser.OpenSubKey("Control Panel\International", True) If regKey.GetValue("sShortDate") = "dd/MM/yyyy" Then Else SetRegionalSetting("dd/MM/yyyy") End If
Friday, 10 June 2011
Enable disable all Trigger In One Query
sp_MSforeachtable "ALTER TABLE ? DISABLE TRIGGER ALL" GO sp_MSforeachtable "ALTER TABLE ? ENABLE TRIGGER ALL"
Thursday, 19 May 2011
Change Collation Of Database
USE [master] ALTER DATABASE [DbName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO GO ALTER DATABASE [DbName] COLLATE SQL_Latin1_General_CP1_CI_AS GO ALTER DATABASE [DbName] SET RECOVERY FULL WITH NO_WAIT GO Go ALTER DATABASE [DbName] SET MULTI_USER GO
Sql X Types
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
FN = Scalar function
IF = Inlined table-function
K = PRIMARY KEY or UNIQUE constraint
L = Log
P = Stored procedure
R = Rule
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
V = View
X = Extended stored procedure
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
FN = Scalar function
IF = Inlined table-function
K = PRIMARY KEY or UNIQUE constraint
L = Log
P = Stored procedure
R = Rule
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
V = View
X = Extended stored procedure
Subscribe to:
Posts (Atom)