Click here to Skip to main content
11,637,176 members (67,838 online)
   

Database

 
GeneralRe: Combining Data From Temp Tables Pin
Matt U.28-Jan-13 12:13
memberMatt U.28-Jan-13 12:13 
GeneralRe: Combining Data From Temp Tables Pin
Mycroft Holmes28-Jan-13 12:00
memberMycroft Holmes28-Jan-13 12:00 
GeneralRe: Combining Data From Temp Tables Pin
Matt U.28-Jan-13 12:16
memberMatt U.28-Jan-13 12:16 
AnswerRe: Combining Data From Temp Tables Pin
Jörgen Andersson28-Jan-13 22:57
memberJörgen Andersson28-Jan-13 22:57 
GeneralRe: Combining Data From Temp Tables Pin
Matt U.29-Jan-13 2:52
memberMatt U.29-Jan-13 2:52 
GeneralRe: Combining Data From Temp Tables Pin
Jörgen Andersson29-Jan-13 3:02
memberJörgen Andersson29-Jan-13 3:02 
GeneralRe: Combining Data From Temp Tables Pin
Jörgen Andersson28-Jan-13 22:28
memberJörgen Andersson28-Jan-13 22:28 
Question[VB.net+ADO.net]how can combobox 1 control the result of combobox2 Pin
Achilles8428-Jan-13 8:20
memberAchilles8428-Jan-13 8:20 
AnswerRe: [VB.net+ADO.net]how can combobox 1 control the result of combobox2 Pin
Achilles8430-Jan-13 3:47
memberAchilles8430-Jan-13 3:47 
QuestionSMO Retrieve Table Record Pin
savbace28-Jan-13 2:31
membersavbace28-Jan-13 2:31 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 2:42
mvpSandeep Mewara28-Jan-13 2:42 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 2:55
membersavbace28-Jan-13 2:55 
QuestionRe: SMO Retrieve Table Record Pin
Eddy Vluggen28-Jan-13 3:21
mvpEddy Vluggen28-Jan-13 3:21 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 3:22
mvpSandeep Mewara28-Jan-13 3:22 
Here, a similar question[^] discussed.

It says: Have a look at SMO's Scripter class[^]. The following basic sample works for me:
using System.Data.SqlClient;
using System.IO;
using System.Text;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
 
namespace SqlExporter
{
class Program
{
static void Main(string[] args)
{
    var server = new Server(new ServerConnection {ConnectionString = new SqlConnectionStringBuilder {DataSource = @"LOCALHOST\SQLEXPRESS", IntegratedSecurity = true}.ToString()});
    server.ConnectionContext.Connect();
    var database = server.Databases["MyDatabase"];
    var output = new StringBuilder();
 
    foreach (Table table in database.Tables)
    {
        var scripter = new Scripter(server) {Options = {ScriptData = true}};
        var script = scripter.EnumScript(new SqlSmoObject[] {table});
        foreach (var line in script)
            output.AppendLine(line);
    }
    File.WriteAllText(@"D:\MyDatabase.sql", output.ToString());
}
}
}
Sandeep Mewara
Microsoft ASP.NET MVP 2012 & 2013


[My Latest Article(s)]:
How to extend a WPF Textbox to Custom Picker
Server side Delimiters in ASP.NET

AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 3:40
membersavbace28-Jan-13 3:40 
Questionhow can reporting in this Situation Pin
karimkpg26-Jan-13 2:38
memberkarimkpg26-Jan-13 2:38 
AnswerRe: how can reporting in this Situation Pin
Sandeep Mewara26-Jan-13 6:02
mvpSandeep Mewara26-Jan-13 6:02 
QuestionQuery to concatenate multiple rows based on sequence in results set Pin
Alex Lush24-Jan-13 22:43
memberAlex Lush24-Jan-13 22:43 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
Eddy Vluggen25-Jan-13 1:51
mvpEddy Vluggen25-Jan-13 1:51 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
Shameel25-Jan-13 3:20
memberShameel25-Jan-13 3:20 
GeneralRe: Query to concatenate multiple rows based on sequence in results set Pin
Alex Lush25-Jan-13 3:30
memberAlex Lush25-Jan-13 3:30 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
mmccarth25-Jan-13 5:21
membermmccarth25-Jan-13 5:21 
QuestionSyntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 14:40
memberIgaBaro23-Jan-13 14:40 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Mycroft Holmes23-Jan-13 15:02
memberMycroft Holmes23-Jan-13 15:02 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 15:25
memberIgaBaro23-Jan-13 15:25 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 15:37
memberPIEBALDconsult23-Jan-13 15:37 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 16:16
memberIgaBaro23-Jan-13 16:16 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 16:26
memberPIEBALDconsult23-Jan-13 16:26 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 16:58
memberIgaBaro23-Jan-13 16:58 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 16:59
memberPIEBALDconsult23-Jan-13 16:59 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Richard MacCutchan23-Jan-13 23:22
mvpRichard MacCutchan23-Jan-13 23:22 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 5:48
memberPIEBALDconsult24-Jan-13 5:48 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 5:54
memberIgaBaro24-Jan-13 5:54 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 6:00
memberPIEBALDconsult24-Jan-13 6:00 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 7:11
memberIgaBaro24-Jan-13 7:11 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 7:56
memberPIEBALDconsult24-Jan-13 7:56 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Richard MacCutchan24-Jan-13 22:35
mvpRichard MacCutchan24-Jan-13 22:35 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 5:51
memberIgaBaro24-Jan-13 5:51 
Questioncreated tables not dropped in a transaction rollback Pin
Danzy8320-Jan-13 16:13
memberDanzy8320-Jan-13 16:13 
AnswerRe: created tables not dropped in a transaction rollback Pin
Mycroft Holmes20-Jan-13 16:32
memberMycroft Holmes20-Jan-13 16:32 
AnswerRe: created tables not dropped in a transaction rollback Pin
Eddy Vluggen21-Jan-13 2:06
mvpEddy Vluggen21-Jan-13 2:06 
AnswerRe: created tables not dropped in a transaction rollback Pin
Shameel21-Jan-13 22:08
memberShameel21-Jan-13 22:08 
GeneralRe: created tables not dropped in a transaction rollback Pin
jschell22-Jan-13 8:16
memberjschell22-Jan-13 8:16 
GeneralRe: created tables not dropped in a transaction rollback Pin
Shameel22-Jan-13 23:46
memberShameel22-Jan-13 23:46 
QuestionChange the language for Sql Server 2008 Pin
Thaer Hamael19-Jan-13 1:27
memberThaer Hamael19-Jan-13 1:27 
AnswerRe: Change the language for Sql Server 2008 Pin
PIEBALDconsult19-Jan-13 5:29
memberPIEBALDconsult19-Jan-13 5:29 
AnswerRe: Change the language for Sql Server 2008 Pin
Mycroft Holmes19-Jan-13 14:19
memberMycroft Holmes19-Jan-13 14:19 
Questionsql server 2008 Pin
Kapilkp17-Jan-13 23:25
memberKapilkp17-Jan-13 23:25 
QuestionRe: sql server 2008 Pin
Eddy Vluggen18-Jan-13 1:30
mvpEddy Vluggen18-Jan-13 1:30 
GeneralRe: sql server 2008 Pin
Kapilkp20-Jan-13 23:06
memberKapilkp20-Jan-13 23:06 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 29 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid