vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| "fireball" <fireball@onet.kropka.eu> wrote in message news:emdkdr$7ro$1@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 > |
| |||
| fireball (fireball@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, esquel@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 |
| |||
| 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 |
| |||
| 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 <condition> Return If you want a return code then you need to use a stored proc and inside the procedure you can write: If <condition> return 100 In your application you can check for status of the called procedure and take action based on that. |
| ||||
| fireball (fireball@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, esquel@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 |