Software / Technology Tips

SET and SELECT in SQL Server

3. Third difference can be found when the query returns more than one value. In this case , SET would return an error. For instance,the following code: Declare  @Year_of_PassOut int SET @Year_of_PassOut= (SELECT Year_of_PassOut FROM ..) Would return the error- Msg 512, Level 16, State 1, Line 2 Subquery returned more than 1 value. This is not permitted…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

How to read data from text file and search for a word in the file in iPhone

// get text file path from application bundle. _string_filePath =  pathForResource:@”fileName” ofType:@”txt”];  // get the contents of file. _string_myFileText = ;  // pass the range of text within which the search has to be done. Here it is from the start of file to the end of file. NSRange range = NSMakeRange(0, _string_myFileText.length);  //pass the word to search as…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

Dynamic Where Clause

Some times we may encounter situations like getting the data from data base with numerous parameters which become optional based on the conditions. For example , Case 1. Get All The Employees in a specific department. Case 2. Get All The Employees in a specific department and whose salary is >= 30,000 $. Case 3.…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

Access an Web Service from a SSL enabled Website

If you want to access an web service from a website which is SSL enabled (used HTTPS), you have to download SSL certificate from the SSL enabled website and install that on the application server. Here I have written procedure to download the SSL certificate from Mozilla Firefox and Internet Explorer and Google Chrome. N.B:You…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

Using Yield Keyword in C#

 Yield is a keyword which is used to get list of  items from a loop. The method implementing yield keyword returns an enumerable object.Yield retains the state of the method during the multiple calls. That means yield returns a single element to the calling function and pause the execution of the current function. Next time…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

Avoiding the use of Triggers in SQL Server

Sometimes we need to audit all DML operations for tables in a MSSQL database. There are many methods for achieving this, one of the most common approaches is using  DML Triggers . But DML triggers can be expensive so we can make use of  the OUTPUT clause which is a new TSQL feature available in SQL…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

Hide/Show columns

CFgrid is the one of the most coolest ajax feature provided by coldfusion. Here i have used a static Cfgrid to explain how we can hide and show the cfgrid columns. comments are self explainatory //Declare and define the Sql query VARIABLES.myQuery = "SELECT FIRSTNAME,LASTNAME,ADDRESS,CITY FROM ARTISTS"; //Store the Query Result into a variable VARIABLES.result…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

CFQUERY bug on using different datasources within a single query

Recently, I encountered an interesting bug in CFQUERY. Here is an example with detailed explanation. SELECT parkname, region, state FROM Parks ORDER BY parkname, state If we call an UDF named countRecord() from within a CFQUERY, and that query uses a different datasource, it RESETS the datasource of the outer CFQUERY.  If this still sounds a…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

Renaming Database Objects

A lot of times we need a change . While working on an existing database,  we may need to change the database name and in some cases want to rename existing database objects. This can be done in a few seconds. In SQL Server this can be done in this manner : 1. Renaming a…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!

GO (Transact-SQL)

GO is the default batch separator keyword for T-SQL. It signals the end of a batch of Transact-SQL statements to the SQL Server utilities. Actually, GO is not a Transact-SQL statement. It is a command recognized by the sqlcmd and osql utilities and SQL Server Management Studio Code editor. The SQL Server utilities interpret GO…

read more
150 150 Burnignorance | Where Minds Meet And Sparks Fly!