469,133 Members | 1,417 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,133 developers. It's quick & easy.

[scripts] prompting user

please, how to promt user in mu sql 2005 script? For example, I need user to
confirm some operations.. .

Thx in advance
Dec 21 '06 #1
10 2282

"fireball" <fi******@onet.kropka.euwrote in message
news:em**********@nemesis.news.tpi.pl...
please, how to promt user in mu sql 2005 script? For example, I need user
to confirm some operations.. .
Unless something has changed in T-SQL 2005 that I'm not aware of, you can't.

Thx in advance

Dec 21 '06 #2
that is cruel.
Dec 21 '06 #3
so, I neither I can't call one script from another (from the batch I run),
right?

:(
Dec 21 '06 #4

"fireball" <fi******@onet.kropka.euwrote in message
news:em**********@nemesis.news.tpi.pl...
so, I neither I can't call one script from another (from the batch I run),
right?
No, you can do that.

>
:(

Dec 21 '06 #5
fireball (fi******@onet.kropka.eu) writes:
please, how to promt user in mu sql 2005 script? For example, I need
user to confirm some operations.. .
The answer is you don't. SQL Server is a server application, and
server applications communicate with client applications, not with
end users.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.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
Dec 21 '06 #6
Sql is 4gl and asking it to do 3gl operations like prompts and loops
and if then else logic should be illegal although now allowed.

fireball wrote:
please, how to promt user in mu sql 2005 script? For example, I need user to
confirm some operations.. .

Thx in advance
Dec 22 '06 #7
well,
is that possible at least, to exit script on given condition?
Dec 28 '06 #8
fireball wrote:
well,
is that possible at least, to exit script on given condition?
Do you want a return code or not? If you don't want a return code
then you can wirite:
If <conditionReturn
If you want a return code then you need to use a stored proc and inside
the procedure you can write:
If <conditionreturn 100
In your application you can check for status of the called procedure
and take action based on that.

Dec 28 '06 #9
fireball (fi******@onet.kropka.eu) writes:
is that possible at least, to exit script on given condition?
Depends on how run it. In SQLCMD or OSQL you can exit immediately
by using a RAISERROR with state 127:

RAISERROR('Got a good reson for taking the easy way out now', 16, 127)

This does not work from Query Analyzer or Mgmt Studio.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.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
Dec 28 '06 #10
Uzytkownik "Erland Sommarskog" <es****@sommarskog.senapisal w wiadomosci
RAISERROR('Got a good reson for taking the easy way out now', 16, 127)
Uzytkownik <ot*******@yahoo.comnapisal w wiadomosci
If <conditionReturn

all this hepled.
Dec 29 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jefferson Cowart | last post: by
11 posts views Thread by uoL | last post: by
1 post views Thread by cdm2883 | last post: by
3 posts views Thread by =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post: by
1 post views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.