Click here to Skip to main content
15,888,600 members
Home / Discussions / Database
   

Database

 
QuestionUpdate a date/time field through VB. net Pin
Johnkokk8-Mar-10 23:57
Johnkokk8-Mar-10 23:57 
AnswerRe: Update a date/time field through VB. net Pin
Johnkokk9-Mar-10 0:11
Johnkokk9-Mar-10 0:11 
QuestionHelp with access query Pin
sarang_k8-Mar-10 18:18
sarang_k8-Mar-10 18:18 
AnswerRe: Help with access query Pin
Mycroft Holmes8-Mar-10 18:53
professionalMycroft Holmes8-Mar-10 18:53 
GeneralRe: Help with access query Pin
_Damian S_8-Mar-10 18:55
professional_Damian S_8-Mar-10 18:55 
AnswerRe: Help with access query Pin
_Damian S_8-Mar-10 18:54
professional_Damian S_8-Mar-10 18:54 
AnswerRe: Help with access query Pin
riced8-Mar-10 22:43
riced8-Mar-10 22:43 
QuestionCreating multiple sql stored procedures from vb .net Pin
iramirezp8-Mar-10 5:54
iramirezp8-Mar-10 5:54 
Hi everyone,

I'm creating a database installer where I have some code to create database, tables, stored procedures, etc.

I don't have problems when creating the database, tables and inserting required data. My problem is when my code gets to the stored procedures section.

Here is what I do:

I have different text files (database.txt, tables.txt, insertdata.txt, storeprocedures.txt) where my sql syntax is located.

I execute every process/text file using the following:

ExecuteSql("master", GetSql("database.txt")) ' Creating 1 database.
ExecuteSql("mynewdatabase", GetSql("tables.txt")) ' Creating 15 tables.
ExecuteSql("mynewdatabase", GetSql("insertdata.txt")) ' Inserting data to many tables.
ExecuteSql("mynewdatabase", GetSql("storeprocedures.txt")) ' Creating 6 stored procedures.

Here is part of the error:

In exception handler: Incorrect syntax near the keyword 'PROCEDURE'. "This is the second stored procedure because the variables I get below belong to the second one"

Must declare the scalar variable "@intVariable1".
Must declare the scalar variable "@intVariable1".
Must declare the scalar variable "@intVariable1".
Must declare the scalar variable "@intVariable1".

When trying to create 6 or even 2 stored procedures using the same file ‘storeprocedures.txt' is not possible. If I leave just 1 it works but I really want to keep them together.

Creating 15 tables using the same file 'tables.txt' works, inserting data in different tables using the same file 'insertdata.txt' works.

This is the general syntax I use:

Create Procedure sp_stored1

@intVariablex int
As
Begin
Code
End


Create Procedure sp_stored2

intVariabley int
As
Begin
Code
End

..........

..........

..........


Is is possible to create more than 1 stored procedure the way I'm trying to?

Do I need to end every stored procedure with specific sql syntax, other than the 'end'?

I appreciate your response!!!

Thanks,

Israel
AnswerRe: Creating multiple sql stored procedures from vb .net Pin
Not Active8-Mar-10 6:19
mentorNot Active8-Mar-10 6:19 
GeneralRe: Creating multiple sql stored procedures from vb .net Pin
iramirezp8-Mar-10 6:50
iramirezp8-Mar-10 6:50 
AnswerRe: Creating multiple sql stored procedures from vb .net Pin
RCoate8-Mar-10 13:28
RCoate8-Mar-10 13:28 
GeneralRe: Creating multiple sql stored procedures from vb .net Pin
iramirezp9-Mar-10 7:50
iramirezp9-Mar-10 7:50 
QuestionHelp with access Query Pin
Gali19788-Mar-10 0:40
Gali19788-Mar-10 0:40 
AnswerRe: Help with access Query Pin
Chris Meech8-Mar-10 4:25
Chris Meech8-Mar-10 4:25 
GeneralRe: Help with access Query Pin
masoumeh20108-Mar-10 8:28
masoumeh20108-Mar-10 8:28 
GeneralRe: Help with access Query Pin
Chris Meech8-Mar-10 8:46
Chris Meech8-Mar-10 8:46 
AnswerRe: Help with access Query Pin
Luc Pattyn8-Mar-10 5:25
sitebuilderLuc Pattyn8-Mar-10 5:25 
Questionmultiple tables in datagridview Pin
Enobong Adahada7-Mar-10 20:50
Enobong Adahada7-Mar-10 20:50 
AnswerRe: multiple tables in datagridview Pin
Mycroft Holmes7-Mar-10 22:34
professionalMycroft Holmes7-Mar-10 22:34 
QuestionDAO 12.0 Big Images in Access Pin
Juan Pablo G.C.7-Mar-10 8:57
Juan Pablo G.C.7-Mar-10 8:57 
AnswerRe: DAO 12.0 Big Images in Access Pin
RCoate8-Mar-10 13:35
RCoate8-Mar-10 13:35 
GeneralRe: DAO 12.0 Big Images in Access Pin
Juan Pablo G.C.8-Mar-10 23:46
Juan Pablo G.C.8-Mar-10 23:46 
QuestionMS SQL: how to reorganize identity column values? Pin
michal.kreslik6-Mar-10 11:52
michal.kreslik6-Mar-10 11:52 
AnswerRe: MS SQL: how to reorganize identity column values? Pin
i.j.russell6-Mar-10 12:47
i.j.russell6-Mar-10 12:47 
AnswerRe: MS SQL: how to reorganize identity column values? Pin
Gerald Schwab6-Mar-10 16:30
Gerald Schwab6-Mar-10 16:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.