开发者

Force CREATE PROC when table in the SQL does not exist yet (VB.NET)

I am converting a lot of projects from VB6 to VB.NET. Many of these projects use the DAO method CreateQueryDef, something ADO.NET does not. I know there is a way to replicate this method in ADOX using Catalogs, but I wanted to stay with pure ADO.NET. I have b开发者_开发问答een using CREATE PROC to do this, but some of the query def's in the VB6 version mention tables/queries that are not created until later. For example,

CreateQueryDef(a, "SELECT ... FROM b")
...
CreateQueryDef(b, "SELECT ...")

The way the projects are, it is not possible to simply flip these two lines. I was wondering if there is a way to force CREATE PROC a AS SELECT ... FROM b even though b does not exist yet, or if there is a different option in ADO.NET to replicate the CreateQueryDef functionality.

Thanks!


MS SQL Server allows you to define procedures that use tables that have not yet been created. As long as they are present when the procedure is executed, it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜