Click here to Skip to main content
15,915,094 members
Home / Discussions / Database
   

Database

 
AnswerRe: Connecting to a Database Pin
Colin Angus Mackay2-May-06 22:29
Colin Angus Mackay2-May-06 22:29 
AnswerRe: Connecting to a Database Pin
Jerry Hammond3-May-06 4:23
Jerry Hammond3-May-06 4:23 
Questionhow 2 write Querry in C# Pin
cshivaprasad2-May-06 19:35
cshivaprasad2-May-06 19:35 
AnswerRe: how 2 write Querry in C# Pin
Christian Graus2-May-06 20:06
protectorChristian Graus2-May-06 20:06 
GeneralRe: how 2 write Querry in C# Pin
cshivaprasad2-May-06 20:11
cshivaprasad2-May-06 20:11 
GeneralRe: how 2 write Querry in C# Pin
Christian Graus2-May-06 20:24
protectorChristian Graus2-May-06 20:24 
AnswerRe: how 2 write Querry in C# Pin
Colin Angus Mackay2-May-06 22:25
Colin Angus Mackay2-May-06 22:25 
QuestionHow do I execute an Ascii-formatted script from my code? Pin
spazzman2-May-06 14:29
spazzman2-May-06 14:29 
I want to create some database objects (tables, stored procedures etc) from a TSQL script. The script is stored in an ASCII txt file, and was generated using the MS SQL Manager's "Generate SQL script" option.

This is my problem : the script file contains formatting (line breaks, tabs etc), TSQL comments and so forth. If I simply load the contents of the script file into a string variable, and execute this from my C# code the way I would any ad-hoc SQL command, the ASCII-text formatting breaks the SQL. For example,

"SELECT *
FROM MyTable;"

now becomes

"SELECT *\r\nFROM MyTable;"

This is not valid SQL, and an exception is thrown. If I parse out all the ASCII formatting (and TSQL comments etc), I can execute a very large TSQL script file as an adhoc SQL command with no errors. This is great, except that my stored procedures now lose all their nice formatting and comments, making them difficult to read.

So ... is there some way to execute an ASCII-formatted TSQL script from C# code without having to strip all the ASCII formatting out?

Thanks in advance!
AnswerRe: How do I execute an Ascii-formatted script from my code? Pin
Colin Angus Mackay2-May-06 22:28
Colin Angus Mackay2-May-06 22:28 
GeneralRe: How do I execute an Ascii-formatted script from my code? Pin
spazzman3-May-06 4:07
spazzman3-May-06 4:07 
QuestionA question in SQL Query Pin
PrashantJ2-May-06 9:45
PrashantJ2-May-06 9:45 
AnswerRe: A question in SQL Query Pin
JimRoss2-May-06 10:52
JimRoss2-May-06 10:52 
Questionhow to config out global culture? Pin
Sasuko2-May-06 7:22
Sasuko2-May-06 7:22 
QuestionBest Practice for returning DataTable Pin
econner2-May-06 5:57
econner2-May-06 5:57 
QuestionIncremental Backups in MySQL Pin
mSoni2-May-06 0:29
mSoni2-May-06 0:29 
AnswerRe: Incremental Backups in MySQL Pin
Graham Nimbley2-May-06 2:44
Graham Nimbley2-May-06 2:44 
GeneralRe: Incremental Backups in MySQL Pin
mSoni2-May-06 2:58
mSoni2-May-06 2:58 
QuestionNo ijvm assembly language Pin
cut_sun1-May-06 21:26
cut_sun1-May-06 21:26 
AnswerRe: No ijvm assembly language Pin
toxcct2-May-06 0:17
toxcct2-May-06 0:17 
QuestionConnection String and Entlib DAAB Pin
Pradeep Shamarao1-May-06 19:10
Pradeep Shamarao1-May-06 19:10 
QuestionExecute permission denied in object in sql server2000. Pin
Praveen_S1-May-06 18:29
Praveen_S1-May-06 18:29 
AnswerRe: Execute permission denied in object in sql server2000. Pin
Colin Angus Mackay1-May-06 23:27
Colin Angus Mackay1-May-06 23:27 
AnswerRe: Execute permission denied in object in sql server2000. Pin
Mike Dimmick2-May-06 0:29
Mike Dimmick2-May-06 0:29 
Questioninsert record into two joined tables Pin
MarkyMark1-May-06 11:42
MarkyMark1-May-06 11:42 
AnswerRe: insert record into two joined tables Pin
mr_123451-May-06 16:12
mr_123451-May-06 16:12 

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.