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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Print vs Select

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :Sql Server
 

Hello,

I have a script (that will be put into a nightly JOB) that does inserts and updates on tables and rollbacks if there is an error. I do not understand the difference between Print and Select. When I run the script with Print, it shows my error. When I run the script with Select, it does not show anything. Can someone tell me what I should be using so the nightly job will record any errors?

Example:

Insert into TABLE1 VALUES(1,2,3)

SELECT @errsaved = @@error

If @errorsaved <> 0 begin

Print 'Error - Transaction will be rolled back' , @errsaved

OR

SELECT 'Error - Transaction will be rolled back', @errsaved

THANKS! Linda

 




View Complete Post


More Related Resource Links

PRINT vs SELECT of a real type in SQL Management Studio

  

Hi

I know real approximate the value etc. The question from the sample below is why a select in the mangement studio dont use the "nice"/"correct" value like the print function. I tested and for example Reporting Services is clever enouth to use the "correct value".

The problem is that sometimes one want to write a quick manual query and move the output to xls etc.

Thanks

DECLARE @ConversionFactor decimal(18,10)
DECLARE @Limit real
DECLARE @Report_Meas_Result real
DECLARE @BLDVALUE varchar(50)

SET @ConversionFactor = 1000
SET @BLDVALUE = '<0.0002'
SET @Limit = cast(RIGHT(@BLDVALUE, LEN(@BLDVALUE) - 1) as real)
SET @Report_Meas_Result = @Limit/2 


AJAX GridView Checkbox Select All in ASP.Net

  
In the previous article GridView Select Multiple Rows you learnt the multiple row selection in GridView control. Here you will get the C# code sample to select all the gridview rows using single checkbox server control. You can highlight the selected rows with different color and Font state Bold. If you want to use the selection values on different ASP.Net

PrintPocketCE Print Pocket Excel, Pocket Word and email files

  
Version 3.560 (May 15, 2009):
bullet

Important bug fix: a slight difference in how some devices create fonts was causing a few devices to have significantly longer print times for large print jobs.
bullet

Adjusted PocketJet printer paper feed commands
bullet

Other minor fixes and enhancements.

Version 3.559 (Mar 5, 2009):
bullet

Added support for Martel MCP78xx printers

Version 3.558 (Aug 20, 2008):
bullet

Added support for Martel MCP78xx printers

Version 3.557 (June 27, 2008):
bullet

Fixed error in Canon printer support
bullet

Fixed COM0 port selection

Version 3.556 (June 15, 2008):
bullet

Added support for Brother MW-260
bullet

Added support for Sato MB400

Version 3.555 (Aug 8, 2007):
bullet

Added support for Pentax RuggedJet 3 and RuggedJet 4 printers
bullet

Changed Epson TM-P60 support to maximum page width of 1200 dots

Version 3.551 (Aug 1, 2006):
bullet

Added Peripheral Nomad printer support

Version 3.550 (Mar 23, 2006):
bullet

Added Panasonic JT-H200PR printer support
bullet

Added Pocket Spectrum printer support
bullet

Fixed problem with WM5.0 "inverted image" problem

bluetooth print via serial port PDA

  
Print via BlueTooth using PDA

Select value in gridview

  

Hi, I am new to gridview. I want to make a gridview. Its row when selected should direct me to a specific .aspx page.Each row should direct to a different page. Should I use querystrings for this? Please suggest. Regards, ap.


how to take print out in asp.net

  

 i want to take print out of asp.net page..

Firstly i want to transfer this content in MsWord file in same format that is on browser screen

then i want to take automatic print out....

how can i do this

Please reply

 


Print command

  

 

Is there a way of setting up a print area for a part of my webpage, I only want to print a certain part of the page, when I select print at the moment it will print the whole page and the layout is rubbish!!
 
Thanks
 
Richard

Print row count on Label

  

Hi,

I have an SP that simply performs a COUNT(*) from a table. I'm am trying to print that number in an ASP Label. It works in Query analyzer but I cant wrap my head around how to display it in a label. Any guidance much appreciated. 

Thank you. 


Upload a Print Screen?

  

Is it possible to Print Screen and then immediately Paste into a .NET app and upload to a server?  I'd like to skip the step of the user having to first paste the screen into an image program and save as a jpg, gif, etc.  Thanks!


Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page

  

how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services

 

Thanks in advance


print of crystal report

  

hi all

my crystal report works well but when  i want press button print instead of print ,export it to a file

what should i do for paper print?

thanks in advance  


The XML Files: XSLT Keys, Select vs. Match, Conflict Resolution, and More

  

This month Aaron Skonnard covers how keys work in XSLT, XSLT match and select attributes, SelectNodes order, finding