dbTalk Databases Forums  

print or select limits

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss print or select limits in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marc
 
Posts: n/a

Default print or select limits - 02-18-2008 , 11:12 PM






I was wandering if I could put a print inside a select or a select in a
print.

I know I can put a select inside another select which correlated subquires,
but is it possible to put a print inside another print, and if there are any
rules associated with this.

Any help would be appreciated.

Marc



--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem

Reply With Quote
  #2  
Old   
Anith Sen
 
Posts: n/a

Default Re: print or select limits - 02-19-2008 , 12:24 PM






It makes no sense to "put a print inside another print". PRINT is not an SQL
statement. It is not used to query the database; instead it simply returns a
message, usually a user-defined string, to the client. Most developers use
the PRINT statement for testing/ debugging.

--
Anith



Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: print or select limits - 02-19-2008 , 04:25 PM



Marc (mnoon (AT) simtest (DOT) net) writes:
Quote:
I was wandering if I could put a print inside a select
Have you the faintest idea of how that would look like? I haven't.
I just can't get it together. PRINT is a procedural statement, can have
that in anything else.

Quote:
or a select in a print.
Why not try it?

PRINT (SELECT 123)

gives me:

Msg 1046, Level 15, State 1, Line 1
Subqueries are not allowed in this context. Only scalar expressions are
allowed.

Looks like the answer is no.

Quote:
but is it possible to put a print inside another print,
Again, how would that look like?


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.