Showing posts with label MSSQL. Show all posts
Showing posts with label MSSQL. Show all posts

Tuesday, March 15, 2016

8+ Interview questions in C#.Net and ASP.NET

Here with i am planning to share the interview questions asked for different company. I hope this will help you for job seekers.


Interview questions
27-02-2016 iBox
1. What is visual studio online
2. What is use of code analyzer
3.NUnit test how to write and every time it will go for database for value check or some other method to use for that.
4.Static class use and where can use
5.Difference between abstract and interface
6.Difference between web service and WCF services
7.What is Cross page/code scripting
8.What is MVC and advantages
9.VS 2015 features
10.what is JSON and what is the use.
11. Difference between JQuery and java script.
12. Method overload and override.
13. Difference between Dataset and DataReader.
14. What is Cross page postback
15. what is Nugat and have you used?
16. What is the use of multi inheritance in c#


31-03-2016 :RRD
Timing : 1 Hr

1.    Tell me about yourself.
2.    Tell me your strength and weakness in Technically
3.    Explain .Net Framework and tell me about CTS,CLS, JIS and MSIL and the flow
4.    Explain your project architecture and data flow.
5.    What is MangoDB and advantage of that. Can I store N number of records?
6.    What is SQLLite and who developed that or who released?
7.    What is the difference between SVN and Perforce source controls.
8.    What is FFMPEG and how fast its convert the video files.
9.    What is the new feature in .NetFramework 3.5 (VS2008)
10.     Have you done any code review?

SQL:
1.    How to do performance tuning  in SQL
2.    Tell me Type of join and difference between INNER JOIN and LEFT OUTER JOIN
3.    What is sql constrain and explain
4.    What are the index are available in SQL and explain
5.    Difference between Inner join and Union
6.    Difference between Temp table and Global temp table and life time of temp table
7.    I have two table in my View and DBA deleted one of the table column in the table, Then what will happen while running select query and how you will prevent to delete column from in table
8.    What is Profiler
9.    Different type of index in SQL and explain.
10.    Difference between temp table and act table. Which one is good?
11.    What is primary key and foreign key
12.    Difference between stored procedure and function
13.    Hoe to capture error in SQL and how to return error log ID
14.    What is DEAD lock and how to prevent that.

C#
1.    What is oops and explain
2.    What is class
3.    What is Polymorphism and explain the Run time and compile time polymorphism , Where can we use this
4.    What is encapsulation
5.    What is the default access modifier of class and what is the default access modifier of Interface.
6.    Difference between Abstract and interface. Where can I use this both?
7.    What is sealed class?
8.    How to achieve multiple inheritance in C#.
9.    What are the design patterns are available. Explain singleton patterns, Iterate pattern (if you using foreach in your patters means you are using Iterate pattern)
10.     Explain SOLID
11.    What is Static class in C#?
12.    What is struct class?
13.    What is Assembly and Type of Assembly? What is private and public assembly?
14.    What is static assembly?
15.    What is DLL and tell me the Difference between EXE and DLL?
16.    How to register the assembly?   

ASP.NET
1.    Tell me Page life cycle.
2.    When I give www.google.com what will happen and explain the flow.
3.    Tell me Client side state management and server side state management.
4.    What is Application Object and what are the types are available. Where the application object available.
5.    Type of session management in Server.
6.    What is authentication and authorization, what are the authorizations are available and how to achieve on that.
7.     What is passport authorization and how to implement?
8.    What is Tracing and how to enable that?
9.    How to Host aps.net application in IIS.
10.    What is application pool, worker process?
11.    What is httpHandler and httpmodule.
12.    Explain the response and request in IIS and how IIS handling this.
13.    What is web service and how to use it?
14.    How to secure the webservice.
15.    What is WSDL?
16.    What is SOAP?
17.    What is Serialization and De-Serialization.
18.    What is JOSON Serialization?
19.    Have you worked any payment gate way, Have you used any Encryption method in your project.
20.    What is query string and how to secure that?
21.    How to get text box value in Javascript.
22.    What are the client side validations are available.
23.    What is JSON?
24.    What is latest IIS version?
25.    Have you worked any cloud server and hosted any website in cloud.

ADO.NET
1.    Difference between Data Adapter and Data Reader
2.    Which one is connected architecture and disconnected architecture
3.    What is Dataset
4.    What is Entity

Tuesday, July 22, 2014

How to get SQL Server IP Address in SQL Query?

Get IP Address of SQL Server using SQL Query:

I have a situation to get the SQL Server IP Address. My SQL Server was in different IP Address and my web application was in different address. Some time we need to get both SQL Client and SQL Server Local IP Address. The below Example will help me to get the both client and sql server IP’s.
@@SPID – This is the session ID of particular connection. Each connection have different session ID.


SELECT   client_net_address,local_net_address, @@SPID as SPID
FROM sys.dm_exec_connections
WHERE Session_id = @@SPID;


I hope the above SQL Query will help you to get the SQL Server IP Address.

If you want to learn more ablut @@SPID Please check the below link

http://sqlserverplanet.com/dba/spid-what-is-it

Wednesday, March 26, 2014

How to Select/Display/List tables from MS SQL Server 2008 R2 ?

Some time we need to select list of user table in the Database to identify the table list. For that we have different SQL querys to get display the Table list. Here I am give some small code to display the user table in different SQL query language.


List out the Data Base Tables detail:

SELECT * FROM sys.Tables

SELECT * FROM INFORMATION_SCHEMA.TABLES


SELECT sc.name +'.'+ ta.name TableName ,SUM(pa.rows) RowCnt
FROM sys.tables ta
INNER JOIN sys.partitions pa  ON pa.OBJECT_ID = ta.OBJECT_ID
INNER JOIN sys.schemas sc ON ta.schema_id = sc.schema_id
WHERE ta.is_ms_shipped = 0 AND pa.index_id IN (1,0)
GROUP BY sc.name,ta.name ORDER BY SUM(pa.rows) DESC



How to Select / Display / List Views in the MS SQL Server 2008 R2:

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE= 'view'



How to Select / Display / List Table Columns in the MS SQL Server 2008 R2:

SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='MyTable'



Thursday, February 13, 2014

How to check if stored procedure exists or Not in SQL server 2008R2 ?

Drop and Create Stored Procedure in SQL before Creating any SP:


In my project I need to give some Stored Procedure to client system to run some bug fixing. The client environment already have the same SP name. So we can give directly ALTER SP query to execute in the SQL server. But that not a good practices. As a good developer need to think future also. What happen if new client dos not have the Stored Procedure in that system? It will give error message. So avoiding the Error Message we need to add little bit code before the SP.

Before creating SP or deleting any Stored Procedure we need to check if that SP already exist or not in the Database. If Exist DROP the procedure and recreate again. If not exist that SP means don’t Drop the SP just create new Stored Procedure. This is the Good way to Creating Script in the SQL server. Below example first I have checked that SP name already Exist in the DB or Not. If exist I will DROP the Procedure and after that I will create New SP. If Not exist that SP name means it will not run the Drop function.

Drop Stored Procedure if exist in SQL Server and Create New one:

--My_SP_Name - Stored Procedure Name


IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[My_SP_Name]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[My_SP_Name]
GO


CREATE PROCEDURE [dbo].[My_SP_Name]
@STARTDATE DATETIME,
@ENDDATE DATETIME
AS

GO





I hope the above code will help you to make good SQL script wit out error free script running. This is not only for SPs, You can use same method for Create Table also.

Saturday, September 28, 2013

Simple string encryption and decryption function in SQL

Simple Password encryption / decryption SQL function:

In the SQL Query we can easily do Encryption and Decryption. Mostly we use to encrypt password column value for the security purpose.  For the SQL Encryption the below function will help you to easy encrypt and decrypt your value.

The below function for Encrypt the user value using SQL Encryption. The ‘Your Key’ value is for the encrypt KEY. The same key you need to use for the decryption also.



CREATE FUNCTION [dbo].[FN_ENCRYPTION]
(
            @INPUT VARCHAR(MAX)
)
            RETURNS VARBINARY(MAX)
            AS BEGIN
            DECLARE @OUTPUT VARBINARY(MAX)
            SELECT @OUTPUT = ENCRYPTBYPASSPHRASE('Your Key',@INPUT)
            RETURN @OUTPUT
END

Example :
SELECT [dbo].[FN_ENCRYPTION] ('vijay')
Result: 0x010000008A2D548FFD5D193EE01FF10DA1356C7D858ADAAA2A014A4F


The below function will decrypt the encrypted binary value to normal string value. The same encryption KEY you need to pass for the decryption.



CREATE FUNCTION [dbo].[FN_DECRYPTION]
(
            @INPUT VARBINARY(MAX)
)
            RETURNS VARCHAR(MAX)
            AS BEGIN
            DECLARE @OUTPUT VARCHAR(MAX)
            SELECT @OUTPUT = DECRYPTBYPASSPHRASE(Your Key ',@INPUT)
            RETURN @OUTPUT
END


Example :
SELECT [dbo].[FN_ENCRYPTION] ('vijay')
Result: 0x010000008A2D548FFD5D193EE01FF10DA1356C7D858ADAAA2A014A4F

SELECT [dbo].[FN_DECRYPTION] (0x010000008A2D548FFD5D193EE01FF10DA1356C7D858ADAAA2A014A4F)
Result: vijay