Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-05-10 : 12:30:00
|
| Nils writes "isql does not allow 'create view' to exist inside ofa conditional Transact-SQL statement:IF conditionBEGINcreate view ...ENDI want to conditionally create a view depending on the valueof the IDENTIFIER_CASE attribute returned by the sp_server_infostored procedure. How can I do that in an isql batch program?I am running on Windows 2000 Professional and SQL Server 2000 SP3.- Nils Brubaker" |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2004-05-10 : 13:11:40
|
| One option is to create multiple batches containing you DDL and conditionally execute the proper batch. |
 |
|
|
Nils
Starting Member
5 Posts |
Posted - 2004-05-10 : 14:18:57
|
| I thought of calling another DDL batch file from inside my original batch file. I can't find anything in the Transact-SQL docs to describe how you do it. Could someone post an example? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-05-10 : 14:27:12
|
| [code]IF condition EXEC master.dbo.xp_cmdshell 'osql -SServer1 -E -iC:\temp\CreateView.sql -oC:\temp\output.txt'[/code]Note the use of osql.exe instead of isql.exe. osql replaces isql. isql is provided for backward compatibility mode only.Tara |
 |
|
|
|
|
|