SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


String length?


String length?

Author
Message
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11166 Visits: 7327
Comments posted to this topic are about the item String length?

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Paul White
Paul White
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20504 Visits: 11359
Very clever question - with some well-thought-out wrong answers :-)

First one to whinge about the explanation being 'incomplete' gets a banana w00t :-P

Well done.



Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Joy Smith San
Joy Smith San
SSCarpal Tunnel
SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)SSCarpal Tunnel (4K reputation)

Group: General Forum Members
Points: 4000 Visits: 3200
haaaa..very good question.. fortunately I got it right.
Wel, I would like to know...

1. When a query will timeout.?
2. When execution of something will run out of memory.?

thanks.
Hugo Kornelis
Hugo Kornelis
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13307 Visits: 12182
Joy Smith San (4/11/2010)
haaaa..very good question.. fortunately I got it right.
Wel, I would like to know...

1. When a query will timeout.?
2. When execution of something will run out of memory.?

thanks.


I can answer the first question. From the server's point of view, queries never timeout. Timeout is a client setting. A client that supports it will send a cancel signal to the server (causng the transaction to be aborted and rolled back) when the set maximum execution time has passed.


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Christian Buettner-167247
Christian Buettner-167247
SSCarpal Tunnel
SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)SSCarpal Tunnel (4.1K reputation)

Group: General Forum Members
Points: 4125 Visits: 3889
Paul White NZ (4/11/2010)
First one to whinge about the explanation being 'incomplete' gets a banana w00t :-P

Me want the banana *whingingabouttheexplanation*! BigGrin

No results returned, as an infinite loop is invoked. But even if there was no infinite loop, no results would be returned, as the variable is not defined as OUTPUT.


But still, good question & explanation. More of that please!

Best Regards,

Chris Büttner
Bob JH Cullen
Bob JH Cullen
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1032 Visits: 786
I had the same initial thought - it cannot RETURN a varchar, as return values are always int. So, that rules out one wrong 'un !!
Paul White
Paul White
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20504 Visits: 11359
Christian Buettner-167247 (4/12/2010)
Paul White NZ (4/11/2010)
First one to whinge about the explanation being 'incomplete' gets a banana w00t :-P

Me want the banana *whingingabouttheexplanation*! BigGrin

No results returned, as an infinite loop is invoked. But even if there was no infinite loop, no results would be returned, as the variable is not defined as OUTPUT.


But still, good question & explanation. More of that please!

Excellent, Christian!





Paul White
SQLPerformance.com
SQLblog.com
@SQL_Kiwi
Attachments
banana.jpg (371 views, 2.00 KB)
ziangij
ziangij
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3278 Visits: 377
thanks, was about to ask why am i not getting any output... luckily i saw the reply...:-)

Christian Buettner-167247 (4/12/2010)
Paul White NZ (4/11/2010)
First one to whinge about the explanation being 'incomplete' gets a banana w00t :-P

Me want the banana *whingingabouttheexplanation*! BigGrin

No results returned, as an infinite loop is invoked. But even if there was no infinite loop, no results would be returned, as the variable is not defined as OUTPUT.


But still, good question & explanation. More of that please!

sjeniferal
sjeniferal
Right there with Babe
Right there with Babe (760 reputation)Right there with Babe (760 reputation)Right there with Babe (760 reputation)Right there with Babe (760 reputation)Right there with Babe (760 reputation)Right there with Babe (760 reputation)Right there with Babe (760 reputation)Right there with Babe (760 reputation)

Group: General Forum Members
Points: 760 Visits: 76
So it will execute this forever? But obviously it won't execute forever, correct? Is there a time limit within SQL Server after which long running queries will be killed? How does that work? I mean some queries will take a long time to run and some others like the one in this example are faulty and will run forever....

So, in this case the app will get a SQLTimeout error? I guess my question is what is the sequence of events internally inside SQL Server and between SQL Server and (a .NET) app that finally result in a SQLTimeout error?
Hugo Kornelis
Hugo Kornelis
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13307 Visits: 12182
sjeniferal (4/12/2010)
So it will execute this forever? But obviously it won't execute forever, correct? Is there a time limit within SQL Server after which long running queries will be killed? How does that work? I mean some queries will take a long time to run and some others like the one in this example are faulty and will run forever....

So, in this case the app will get a SQLTimeout error? I guess my question is what is the sequence of events internally inside SQL Server and between SQL Server and (a .NET) app that finally result in a SQLTimeout error?

Unless some client decides that the query has run long enough, it will continue forever. Or at least until the next server reboot.

If a client (or a human) decides that the query has run long enough, an "Attention" signal will be sent to the server or a DBA will kill the process. That will cause a rollback (which will be pretty fast in this case, since no modifications are made) and a message to be sent to the client.


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search