create table with create procedure
create table with create procedure
create table with create procedure
create table with create procedure
create table with create procedure
create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure
create table with create procedure create table with create procedure
create table with create procedure
Go Back  Xtreme Visual Basic Talk > > > create table with create procedure


Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2015, 02:04 PM
pschulz pschulz is offline
Newcomer
 
Join Date: Jul 2015
Posts: 6
Question create table with create procedure


Hi there,

is there no way to create a table with a create procedure command?
(ADO:NET VS 2010 SQL-Server 2008R)
otherwise I have to create a table first and then a stored procedure with an insert, thats possible, for whatever reason

greetings
P.Schulz
Reply With Quote
  #2  
Old 07-28-2015, 05:00 AM
PlausiblyDamp's Avatar
PlausiblyDampcreate table with create procedure PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,055
Default

Are you trying to create a stored procedure that can can create a table or are you trying to create a single script that can do both?

There shouldn't be any problem with creating a procedure to create a table so I am assuming the later.

Certain commands can't be in the same batch, typically these include things like CREATE PROC - you would need to separate them with the GO keyword. e.g.
Code:
CREATE PROC .....

GO

CREATE Table ...
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 08-10-2015, 08:32 PM
pschulz pschulz is offline
Newcomer
 
Join Date: Jul 2015
Posts: 6
Default

but 'GO' doesnt work with executenonquery, or do I miss somtheing?
Reply With Quote
  #4  
Old 08-11-2015, 10:07 AM
PlausiblyDamp's Avatar
PlausiblyDampcreate table with create procedure PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,055
Default

I am afraid not, if you are trying to do this from a stored proc or some dynamic SQL then it will need to be two separate commands.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #5  
Old 08-11-2015, 03:25 PM
pschulz pschulz is offline
Newcomer
 
Join Date: Jul 2015
Posts: 6
Default

its enough to seperate them?
If I have to create two databases within one methode, i get an error, whenver the stored procedure for the second db shall be createtd
Except I let create the databases with a simple statement like:
strSQL = "CREATE DATABASE " + strDBname
instead of
strSQL = "exec ('CREATE DATABASE ' + @databaseName)"

Have expect it runs better with exec, but it does not.

greetings
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
create table with create procedure
create table with create procedure
create table with create procedure create table with create procedure
create table with create procedure
create table with create procedure
create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure create table with create procedure
create table with create procedure
create table with create procedure
 
create table with create procedure
create table with create procedure
 
-->