.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

Can you control concatenation of string values with null values?

Posted By :shah268     Posted Date :November 26, 2009    Points :10   Category :Sql Server 
Concatenation of string values with null values results either null value or string value.
We can control that by setting CONCAT_NULL_YIELDS_NULL on or off.
When it is set to ON, the concatenation will result null and when it is set to OFF, it will result the string.
Setting it ON,
print 'testing' + NULL; --results NULL and prints nothing

Setting it OFF,

print 'testing' + NULL; -- results testing and prints the same

You can also find related Interview Question to Can you control concatenation of string values with null values?  below: 

Will COUNT(column) include columns with null values in its count?

Yes, COUNT(column) include columns with null values in its count? (More...)

How do we join the values in an array?

Using the method Join() as follows.

var arr = new Array();
arr = ["one","two","three","four"];
alert(arr.join(",")); (More...)

How do we validate numeric values in javascript?

Using evt.which or event.keyCode

the value will be numeric if it is between 47 and 58 (More...)

how to pass the values across webforms without using State Management Concepts:


public String CurrentCity
return TextBox1.Text;

In Page2.aspx

<%@ PreviousPageType VirtualPath="~/Page1.aspx" %>


Another Method:

In Page2.aspx

TextBox SourceTextBox = (TextBox)PreviousPage.FindControl("TextBox1");

Label1.Text = SourceTextBox.Text;


How to get values across multiple pages using ViewState?

Ans. In page1.aspx

button_1click envent
ViewState["name"] = txtTest.Text;



In page2.aspx

In page_load

Page obj= this.PreviousPage;

TextBox txtNewTest = (TextBox)obj.FindControl("txtTest");

string sDisplay = txtNewTest.Text.ToString();




How will you maintain a Session values in Class Library?

Using HttpContext class

HttpContext.Current.Session["Value"] (More...)

You have a column that will only contain values from 0 to 256. What's the most economical data type to use for the column?


Correct Answer : B
A SMALLINT data type uses only 2 bytes of data and can store value from -32,768 to 32,767. A TINYINT data type cannot be used because the maximum value it can hold is 255. Although an INT data type can be used, SMALLINT will use only 2 bytes compared to INT's 4 bytes. VARCHAR(3) will use 3 bytes while DECIMAL(3) will use 5 bytes.

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend