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 |
|
rajender
Starting Member
13 Posts |
Posted - 2005-05-05 : 03:04:19
|
| Hi SQL TeamI am developing a SQL-DMO application, and i need to verify/validate the syntax of the DDL Query entered as text, much like the way SQL Enterprise Manager do while creating/altering a stored procedure. for example i want to execute following statement using SQL-DMO's ExecuteImmediate Method Alter Table Test Add Test_id intNow before calling the following function, i want to validate the syntax of above statement.Call xObject.Databases.Item(i).ExecuteImmediate(Text1.Text), where xObject is a instance of SQL-DMO.SqlServer2 and text1.text contains the above mentioned statementI don't find any method/function to do that. Can any body help me how can i do that using SQL-DMO.Thanks in advance. |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2005-05-05 : 09:28:06
|
| If you run profiler while checking syntax in query analyzer, you'll see that before running the batch, Query Analyzer issues a SET PARSEONLY ON statement and SET PARSEONLY OFF when it's done.You could do the same in your DMO app.DamianIta erat quando hic adveni. |
 |
|
|
rajender
Starting Member
13 Posts |
Posted - 2005-05-06 : 03:11:17
|
| Thanks Damian. It worked fine. |
 |
|
|
|
|
|