Suvendu's profileSuvendu's spacePhotosBlogListsMore ![]() | Help |
|
June 08 Update TriggerLets assume if you want to check whether any of the columns 2,3,4 or all the columns have been updated or not. Then use the following IF condition IF (COLUMNS_UPDATED() & 14) > 0 14 is the bitmask for all three columns. for col 2, (this is col id you can see in syscolumns table) bitmask is power(2,(2-1))=2 for col 3, bitmask is power(2,(3-1))=4 for col 4, bitmask is power(2,(4-1))=8 In above ex, since your checking all there columns bitmask is the sum of all. That comes to 14. June 07 FreeSpace Alert in SQL Server 2000/2005
March 12 Useful links for CSSI just started to create my CSS file for my project, and just want to check out if there are any recommended ways of doing this right. I just did a simple search in code project site, and found a lot of related articles which are useful. (Well, more to read now....) I'll add more to the list when I've found more information here. 1. Internet Explorer & CSS issues 2. Ten ways to speed up the download time of your web pages (some key points here, a must read article.) 3. Ten CSS tricks you may not know (There are some tricks here that you shouldn't miss too) 4. CSS Help Pile - A huge pile of CSS-related tips, tricks & resources. 5. 53 CSS-Techniques You Couldn't Live Without (Here, you can learn the specific technique that you want to use in your web site. Another Must Read article.) 6. Layout Gala: a collection of 40 CSS layouts - Here you'll get some reference CSS layout sites. 7. MaxDesign - Sample CSS Page Layouts (with step by step layout tutorial too) 8. CSSplay - There are some demos, menus, layouts, boxes examples. February 25 Internet Explorer 8 soon available?
The next release of IE will be called — wait for it — “Internet Explorer 8.” That’s it. More info to come — at least by Mix ‘08. Which is in March 2008. Sigh. See some Screenshots December 12 bypass the Open/Save/Cancel dialog while file downloadIf you want to bypass the Open/Save/Cancel dialog you just need to write below code Response.AddHeader("Content-Disposition", "inline; filename=" + file.Name); Read and write to XML file from ASP C#using System; public partial class _Default : System.Web.UI.Page } XmlTextWriter textWritter = new XmlTextWriter("F:/Account.xml", null); textWritter.Close(); XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("F:/Account.xml"); XmlElement subRoot = xmlDoc.CreateElement("User"); XmlElement appendedElementEmail = xmlDoc.CreateElement("Email"); xmlDoc.Save("F:/Account.xml"); for (int i = 0; i < xmlnode.Count; i++) //Last Child of the XML file - Catalog.xml - returned Response.Write(xmlnode[i].LastChild.Name); } October 24 Create Simple Job with Query Analyser(every day 5 min duration schedule)USE msdb October 13 Disable DatagridView Column Sorting in C#dataGridView1.Columns[j].SortMode = DataGridViewColumnSortMode.NotSortable; October 04 NEWID vs NEWSEQUENTIALID
Fun With SQL ServerSet nocount on Insert into @TblLayout Select Replicate (Convert(Varchar, 0x7E), 75) --- Vz employees House ... Update @TblLayout Set Canvas = Stuff(Canvas, 42, 24 , Convert(Varchar, 0x7C2020205B20205D20205B20205D207C20202020207C)) Where ID = 4 Update @TblLayout Set Canvas = Stuff(Canvas, 42, 24 , Convert(Varchar, 0x2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F5C5C5C5C5C5C)) Where ID = 3 Update @TblLayout Set Canvas = Stuff(Canvas, 43, 23 , Convert(Varchar, 0x2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F2F5C5C5C5C)) Where ID = 2 Update @TblLayout Set Canvas = Stuff(Canvas, 44, 21, Convert(Varchar, 0x5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F)) Where ID = 1 -- Picture of a Guy ... Update @TblLayout Set Canvas = Stuff(Canvas, 11,8, Convert(Varchar, 0x7C5F5F7C5F5F7C)) Where ID = 26 Update @TblLayout Set Canvas = Stuff(Canvas, 11,8, Convert(Varchar, 0x7C20207C20207C)) Where ID = 25 Update @TblLayout Set Canvas = Stuff(Canvas, 11,8, Convert(Varchar, 0x7C20207C20207C)) Where ID = 24 Update @TblLayout Set Canvas = Stuff(Canvas, 10,9, Convert(Varchar, 0x5C7C5F5F5F5F2F202F)) Where ID = 23 Update @TblLayout Set Canvas = Stuff(Canvas, 9,11, Convert(Varchar, 0x5C207C20416553202F202F)) Where ID = 22 Update @TblLayout Set Canvas = Stuff(Canvas, 9,11, Convert(Varchar, 0x2F5F2F20415453205C5F5C)) Where ID = 21 Update @TblLayout Set Canvas = Stuff(Canvas, 10,9, Convert(Varchar, 0x2F202060606020205C)) Where ID = 20 Update @TblLayout Set Canvas = Stuff(Canvas, 11,7, Convert(Varchar, 0x5F5C5F755F2F5F)) Where ID = 19 Update @TblLayout Set Canvas = Stuff(Canvas, 11,7, Convert(Varchar, 0x5C20302030202F)) Where ID = 18 Update @TblLayout Set Canvas = Stuff(Canvas, 11,7, Convert(Varchar, 0x2F2F2F2F2F2F2F)) Where ID = 17 --Time to travel Update @TblLayout Set Canvas = Stuff(Canvas, 10,3, Convert(Varchar, 0x282029)) Where ID = 7 Update @TblLayout Set Canvas = Stuff(Canvas, 7,27, Convert(Varchar, 0x5F5F2F202F5F5F5F5F5F20202020205F5F5F5F5F5F5F5F5F)) Where ID = 8 Update @TblLayout Set Canvas = Stuff(Canvas, 5,27, Convert(Varchar, 0x287C202020202020202020207C2020207C2020202020202020207C)) Where ID = 9 Update @TblLayout Set Canvas = Stuff(Canvas, 6,26, Convert(Varchar, 0x7C205B5D205B5D205B5D207C292D287C205B5D205B5D205B5D7C)) Where ID = 10 Update @TblLayout Set Canvas = Stuff(Canvas, 6,27, Convert(Varchar, Update @TblLayout Set Canvas = Stuff(Canvas, 7,24, Convert(Varchar, 0x303030303030303030302020202020303030303030303030)) Where ID = 12 Select Canvas [ ] FROM @TblLayout October 03 Enable/Disable Trigger
--DISABLE TRIGGER-------- ALTER TABLE Table_Name --ENABLE TRIGGER-------- ALTER TABLE Table_Name
--Geting Status of Trigger SELECT September 28 Export DatagridView to MSExcel with out using COM object from C# 2005public static void exportToExcel(DataTable source, string fileName) System.IO.StreamWriter excelDoc; excelDoc = new System.IO.StreamWriter(fileName); int rowCount = 0; September 26 Javascript Debugging with Visual Studio 2008blog post on debugging Javascript in Visual Studio 2008 here: http://blogs.msdn.com/kaevans/archive/2007/08/10/javascript-debugging-in-visual-studio-2008.aspx Left Right and MID function in C#public static string Left(string param, int length) public static string Mid(string param, int startIndex, int length) public static string Mid(string param, int startIndex) September 25 Get Ascii number from Character using c#public Int32 FindAsciiCode( string str) September 22 SQLite OPENSourceSQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. SQLite is an approriate database engine to use versus situations where a client/server database engine might be a better choice. SQLite does not need to be "installed" before it is used. There is no "setup" procedure. There is no server process that needs to be started, stopped, or configured. There is no need for an administrator to create a new database instance or assign access permissions to users. SQLite uses no configuration files. Nothing needs to be done to tell the system that SQLite is running. No actions are required to recover after a system crash or power failure. There is nothing to troubleshoot.
SQL ServerHow to pass a variable to a linked server query
When you query a linked server, you frequently perform a pass-through query that uses the OPENQUERY, OPENROWSET, or OPENDATASOURCE statement. You can view the examples in SQL Server Books Online to see how to do this by using pre-defined Transact-SQL strings, but there are no examples of how to pass a variable to these functions. This article provides three examples of how to pass a variable to a linked server query. DECLARE @TSQL varchar(8000), @VAR char(2)
SELECT @VAR = 'CA'
SELECT @TSQL = 'SELECT * FROM OPENQUERY(MyLinkedServer,''SELECT * FROM pubs.dbo.authors WHERE state = ''''' + @VAR + ''''''')'
EXEC (@TSQL)
Pass the Whole QueryWhen you have to pass in the whole Transact-SQL query or the name of the linked server (or both), use code that is similar to the following sample:DECLARE @OPENQUERY nvarchar(4000), @TSQL nvarchar(4000), @LinkedServer nvarchar(4000)
SET @LinkedServer = 'MyLinkedServer'
SET @OPENQUERY = 'SELECT * FROM OPENQUERY('+ @LinkedServer + ','''
SET @TSQL = 'SELECT au_lname, au_id FROM pubs..authors'')'
EXEC (@OPENQUERY+@TSQL)
|
|
|