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


Top 5 Contributors of the Month
david stephan

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

How to get @@error and @@rowcount at the same time?

Posted By :Ghanashyam Nayak     Posted Date :December 05, 2010    Points :15   Category :Sql Server 
If @@Rowcount is checked after Error checking statement then it will have 0 as the value of
@@Recordcount as it would have been reset. And if @@Recordcount is checked before the error-checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable.
SELECT @RC = @@ROWCOUNT, @ER = @@ERROR

You can also find related Interview Question to How to get @@error and @@rowcount at the same time?  below: 

How to get @@ERROR and @@ROWCOUNT at the same time?

  
If you check @@Rowcount after Error checking statement it will give the result as 0 and if you check @@Recordcount before the error checking statement then @@Error will not return any value. To get @@error and @@rowcount at the same time, include both in a select query and store it in a local variable in a single query

SELECT @RowCount = @@ROWCOUNT, @ERRROR = @@ERROR 
(More...)

How to get @@error and @@rowcount at the same time?

  
If @@Rowcount is checked after Error checking statement then it will have 0 as the value of @@Recordcount as it would have been reset.
And if @@Recordcount is checked before the error-checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable.
SELECT @RC = @@ROWCOUNT, @ER = @@ERROR (More...)

What is JIT (just in time)? how it works?

  
Before Microsoft intermediate language (MSIL) can be executed, it must be converted by a .NET Framework just-in-time (JIT) compiler to native code, which is CPU-specific code that runs on the same computer architecture as the JIT compiler.
Rather than using time and memory to convert all the MSIL in a portable executable (PE) file to native code, it converts the MSIL as it is needed during execution and stores the resulting native code so that it is accessible for subsequent calls.
The runtime supplies another mode of compilation called install-time code generation. The install-time code generation mode converts MSIL to native code just as the regular JIT compiler does, but it converts larger units of code at a time, storing the resulting native code for use when the assembly is subsequently loaded and executed.
As part of compiling MSIL to native code, code must pass a verification process unless an administrator has established a security policy that allows code to bypass verification. Verification examines MSIL and metadata to find out whether the code can be determined to be type safe, which means that it is known to access only the memory locations it is authorized to access. (More...)

What is Record-at-a-time?

  
The Low level or Procedural DML can specify and retrieve each record from a set of records. This retrieve of a record is said to be Record-at-a-time. (More...)

What is Set-at-a-time or Set-oriented?

  
The High level or Non-procedural DML can specify and retrieve many records in a single DML statement. This retrieve of a record is said to be Set-at-a-time or Set-oriented. (More...)

What does this error mean:
System.ArgumentOutOfRangeException: Index was out of range : Upgrading CRM 3.0

  
Error Message : "System.ArgumentOutOfRangeException: Index was out of range", occurs while upgrading Microsoft Dynamics CRM 3.0 to Microsoft Dynamics CRM 4.0

Solution : The problem occurs if an ampersand is in the subject of an activity that was created in a sales process or in a workflow rule. So, remove the ampersand.

To obtain this fix, use the Update Installation Files option during Microsoft Dynamics CRM 4.0 setup




For more details, visit http://kbalertz.com/Feedback.aspx?kbNumber=948917/ (More...)

Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?

  
AsyncPostBackTimeout Property needs to set which gets or sets a value that indicates the time, in seconds, before asynchronous postback time out if no response is received from the server.




The default value of this property is 90 second. We can also set the user defined error message using asyncpostbackerrormessage property (as shown in above code) for time out. (More...)

Why does my Windows application pop up a console window every time I run it?

  
Make sure that the target type set in the project properties setting is set to Windows Application, and not Console Application. If you're using the command line, compile with /target:winexe, not /target:exe. (More...)

Why do I get an error (CS1006) when trying to declare a method without specifying a return type?

  
If you leave off the return type on a method declaration, the compiler thinks you are trying to declare a constructor. So if you are trying to declare a method that returns nothing, use void. The following is an example: // This results in a CS1006 error public static staticMethod (mainStatic obj) // This will work as wanted public static void staticMethod (mainStatic obj) (More...)

Are the actual permissions for the application defined at run-time or compile-time?

  
The CLR computes actual permissions at runtime based on code group membership and the calling chain of the code. (More...)

How to add a combo box dynamically at run time in Java script?

  
document.forms[0]..options[index] new Option("Add text Value") (More...)

What is the use of SET ROWCOUNT

  
If we require a little number of rows to be retrieved, retrieving entire table data is not necessary we can go for SET ROWCOUNT . (More...)

What is the error in the following command?
DROP TABLE &TABLE_NAME;

  
Variable names should start with an alphabet. Here the table name starts with an '&' symbol. So it will give a compilation error. (More...)

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