Click here to Skip to main content
15,918,889 members
Home / Discussions / Database
   

Database

 
GeneralOrdering of rows Pin
16-Oct-01 18:14
suss16-Oct-01 18:14 
GeneralRe: Ordering of rows Pin
Rashid Thadha17-Oct-01 12:29
Rashid Thadha17-Oct-01 12:29 
Generaldb fetch : issue accessing table with more than 255 columns Pin
kshathrya13-Oct-01 8:01
kshathrya13-Oct-01 8:01 
GeneralADO events Pin
11-Oct-01 22:07
suss11-Oct-01 22:07 
GeneralRe: ADO events Pin
Rashid Thadha11-Oct-01 22:42
Rashid Thadha11-Oct-01 22:42 
GeneralOpen Excel file trough ODBC (Microsoft Excel Driver) Pin
10-Oct-01 1:53
suss10-Oct-01 1:53 
GeneralSkipping recordset in DTS Pin
8-Oct-01 16:30
suss8-Oct-01 16:30 
GeneralExecuting SQL scripts from file Pin
JonB5-Oct-01 5:30
JonB5-Oct-01 5:30 
(Beginner to SQL/MSSQL).

I have created some SQL scripts (e.g. for repopulating tables for test), and saved them to external file (e.g. repopulating tables). I want to get SQL server to execute the scripts. I do *not* want to use an interactive utility (e.g. Query Analyzer, though that's where I generated and saved the scripts), nor a command-line utility (e.g. osql, though it does precisely what I'm trying to do). I do not want to store them as stored procs in a db. I want to do it from code (actually C# & ASP.NET application, though that shouldn't matter).

The files are accessible to the SQL server. What I want is a SQL statement like:
EXEC <file-path>
but I can't find anything like this. Yes, I could write code to open the file and append all the text to a string I finally submit to an ExecuteNonQuery(), but this seems brain-damaged to me (is this in fact what osql does?).

*Surely* there's something for this?

TIA
GeneralUpdating dBase files with ADO Pin
3-Oct-01 23:34
suss3-Oct-01 23:34 
GeneralRe: Updating dBase files with ADO Pin
17-Oct-01 2:37
suss17-Oct-01 2:37 
Generaldeprecation of the Jet engine Pin
Steen Krogsgaard3-Oct-01 21:28
Steen Krogsgaard3-Oct-01 21:28 
GeneralConnectionstring to MSDE "local not working" Pin
Bigge3-Oct-01 2:26
Bigge3-Oct-01 2:26 
GeneralRe: Connectionstring to MSDE "local not working" Pin
Bigge4-Oct-01 13:27
Bigge4-Oct-01 13:27 
GeneralRe: Connectionstring to MSDE "local not working" Pin
Rashid Thadha6-Oct-01 10:44
Rashid Thadha6-Oct-01 10:44 
GeneralSQL Books or Resources... Pin
Joshua Guy2-Oct-01 11:39
Joshua Guy2-Oct-01 11:39 
GeneralProblem getting length of NTEXT column with OLEDB Pin
1-Oct-01 9:49
suss1-Oct-01 9:49 
GeneralMS Access ADO problem Pin
1-Oct-01 6:58
suss1-Oct-01 6:58 
GeneralProblem returning ADO::_Connection from COM component to MFC client Pin
AliBaba24-Sep-01 12:15
AliBaba24-Sep-01 12:15 
GeneralRe: Problem returning ADO::_Connection from COM component to MFC client Pin
Rashid Thadha25-Sep-01 5:37
Rashid Thadha25-Sep-01 5:37 
GeneralRe: Problem returning ADO::_Connection from COM component to MFC client Pin
AliBaba25-Sep-01 17:34
AliBaba25-Sep-01 17:34 
GeneralADO Named Parameters in ADO 2.6 Pin
jkgh18-Sep-01 5:43
jkgh18-Sep-01 5:43 
GeneralOracle 8i question ... Pin
Hadi Rezaee16-Sep-01 21:41
Hadi Rezaee16-Sep-01 21:41 
GeneralRe: Oracle 8i question ... Pin
Ray Kinsella16-Sep-01 21:54
Ray Kinsella16-Sep-01 21:54 
GeneralRe: Oracle 8i question ... Pin
Rashid Thadha16-Sep-01 23:40
Rashid Thadha16-Sep-01 23:40 
GeneralMSDASQL & SyBase... Pin
14-Sep-01 11:34
suss14-Sep-01 11:34 

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.