Showing posts with label Interview Tips. Show all posts
Showing posts with label Interview Tips. Show all posts

SQL Server Interview Questions

(1) How To Update Description Value for a Column in Table using SQL Command?
We can Update Description to Column using sp_updateextendedproperty System Store Procedure.
Sample Command to Update Description for Column in a Table:
EXEC sys.sp_updateextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName',       @level2type=N'COLUMN',@level2name=N'ColumnName'

(2) How To Delete Description Value for a Column in Table using SQL Command?
We can Delete Description from Column using sp_dropextendedproperty System Store Procedure.
Sample Command to Delete Description from Column in a Table:
EXEC sys.sp_dropextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName',       @level2type=N'COLUMN',@level2name=N'ColumnName'

(3) How we can add Description to the Column using Sql Command?
We can Add Description to Column using sp_addextendedproperty System Store Procedure.
Sample Command to Insert Description for Column in a Table:
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'My Description for Column Here' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MyTableName',       @level2type=N'COLUMN',@level2name=N'ColumnName'

(4) How To Get Description Value for all Column in Table using SQL Command?
To Get Description of Columns we need to use system function sys.fn_listextendedproperty.
Command To Get Description Data for all Columns:
SELECT * FROM   fn_listextendedproperty(NULL, 'SCHEMA',
 'dbo', 'TABLE', 'YourTable Name Here', 'COLUMN', NULL)

(5) How To Get Description Value for Single Column in Table using SQL Command?
To Get Description of Single Column we need to use system function sys.fn_listextendedproperty. we need to pass the column Name is this case.
Command To Get Description Data for Single Columns:
SELECT * FROM   fn_listextendedproperty(NULL, 'SCHEMA',
 'dbo', 'TABLE', 'Table Name Here', 'COLUMN', 'Column Name Here')

(6) How We can get the DB name using SQL Command?
Following is the Command to get the DB name using Command analyzer
SELECT DB_NAME()

(7) What is the use of Set NOCOUNT ON;?
By Default When we execute any command it return us the number of record affected. if we don't want to return the number of records affected then we can use
SET NOCOUNT ON;

JavaScript Interview Questions

(1) Default setting for the expires attribute of the document.cookie property?
Ans: The duration of the browser session.

(2) Which JavaScript feature uses JAR files?
Ans: Object signing

(3) If onKeyDown event returns false, the key-press event is cancelled.

(4) File is a Server-side JavaScript Object.

(5) FileUpload is a Client-side JavaScript Object.

Dot Net Interview Tips

  1. Data that can be stored in a cookie? 4 KB/2096 Bytes
  2. Most Browsers provides a limit of storing cookies is 20. If new cookie came, it will discard the old one but some of browser support up to 300 cookies.
  3. Persistent Cookies can be called as permanent cookie. Which is stored in client hard drive until it expires. While non persistent cookies can be called as temporary cookies, if there is no expire time defined then the cookie is stored in the browser’s memory.
  4. Difference in persistence and non persistence cookies is persistence cookies should have an expiration time defined within it.
  5. Where does cookies are stored in local hard drive? C:\Documents and Settings\{Current Login User}\Cookies
  6. To expire the persistent cookies before its expiration time the expiration time as the Now.DateTime.AddDays(-1);
  7. Cookie Munging’ is a concept of ASP.Net which lets users to manage session variables if their browsers do not support cookies. By default, ASP.Net uses cookies to store session ID’s. But, as we all know that some browsers do not support cookies. To overcome from this ASP.Net uses ‘Cookie Munging’ to manage session variables without cookies.
    How Cookie Munging works?
    When user requests page from server ASP.Net adds encoded session ID to every href in page. When user clicks a link ASP.Net decodes that encoded session ID and passes it back to the page the user is requesting. Now, the requesting page can use that ID to set or retrieve any session variables. This all happens automatically, if asp.net detects that the users browser do not support cookies.