Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

Drop create table - check if it is used.

$
0
0
Hi.
I need to create a table but first i need to check if it is already there and drop it, if it is not used.
This will be on vb.net so the code for drop and create will be in vb.net.
I have 2 questions here.
1)Will the table give out an exception if it is is use and I try to drop it? Meaning if i have a Begin transaction, will the table be dropped anyhow, while in use?
If not and it will give an error that is fine, I can catch that and do something.
2)Will writing vb statement understand the GO command? Drop and create must not be in the same batch so I need to use GO on drop and then re-create.
There is something bothering me here but I can't recall. Had something to do with .net not understanding the GO commands on SqlCommands? I may be mistaken though.

Thanks

Edit. I think I was right about the GO. I read that I must use a semicolon instead. Is that the case?

Viewing all articles
Browse latest Browse all 2918


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>