Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Intresting Question need answer ASAP
47 posts, Page 1 of 5
1
2
3
4
5
»
»»
Intresting Question need answer ASAP
Rate Topic
Display Mode
Topic Options
Author
Message
vax09
vax09
Posted Thursday, September 20, 2012 9:33 AM
Grasshopper
Group: General Forum Members
Last Login: Friday, June 14, 2013 11:35 AM
Points: 24,
Visits: 299
Write the shortest code that produces results as 1 without using any numbers in the select statement. using sql
Post #1362082
vax09
vax09
Posted Thursday, September 20, 2012 9:34 AM
Grasshopper
Group: General Forum Members
Last Login: Friday, June 14, 2013 11:35 AM
Points: 24,
Visits: 299
One more
SELECT CAST(634 AS VARCHAR(2))
why it display * in result
Post #1362083
Andy Hyslop
Andy Hyslop
Posted Thursday, September 20, 2012 9:36 AM
SSChasing Mays
Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 606,
Visits: 2,210
PRINT 1
Doesn't use a SELECT statement
Homework?
Andy
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
Post #1362087
GilaMonster
GilaMonster
Posted Thursday, September 20, 2012 9:38 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 6:22 AM
Points: 38,077,
Visits: 30,372
SELECT LEN('a')
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1362090
davidandrews13
davidandrews13
Posted Thursday, September 20, 2012 9:40 AM
SSC-Addicted
Group: General Forum Members
Last Login: Yesterday @ 10:15 AM
Points: 463,
Visits: 2,714
GilaMonster (9/20/2012)
SELECT LEN('a')
ha, thats what i came up with
Post #1362092
Andy Hyslop
Andy Hyslop
Posted Thursday, September 20, 2012 9:40 AM
SSChasing Mays
Group: General Forum Members
Last Login: Today @ 6:23 AM
Points: 606,
Visits: 2,210
One more
SELECT CAST(634 AS VARCHAR(2))
why it display * in result
Someone else also asked this
http://www.sqlservercentral.com/Forums/Topic1361763-149-1.aspx
==========================================================================================================================
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila. Mitch Ratcliffe
Post #1362093
Lynn Pettis
Lynn Pettis
Posted Thursday, September 20, 2012 9:40 AM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 9:17 PM
Points: 21,832,
Visits: 27,855
vax09 (9/20/2012)
One more
SELECT CAST(634 AS VARCHAR(2))
why it display * in result
Overflow, you are trying to convert the number 634 to a string but only giving the string 2 characters of space where 3 are needed.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1362095
vax09
vax09
Posted Thursday, September 20, 2012 9:41 AM
Grasshopper
Group: General Forum Members
Last Login: Friday, June 14, 2013 11:35 AM
Points: 24,
Visits: 299
For this query
SELECT CAST(634 AS VARCHAR(2))
why it display * in result
Post #1362096
GilaMonster
GilaMonster
Posted Thursday, September 20, 2012 10:27 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 6:22 AM
Points: 38,077,
Visits: 30,372
Andy Hyslop (9/20/2012)
Someone else also asked this
http://www.sqlservercentral.com/Forums/Topic1361763-149-1.aspx
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1362138
GSquared
GSquared
Posted Thursday, September 20, 2012 11:00 AM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:45 PM
Points: 15,442,
Visits: 9,572
vax09 (9/20/2012)
For this query
SELECT CAST(634 AS VARCHAR(2))
why it display * in result
String truncation.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #1362166
« Prev Topic
|
Next Topic »
47 posts, Page 1 of 5
1
2
3
4
5
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.