Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "Tony Johansson" Newsgroups: comp.databases.ms-sqlserver Subject: Re: How do I best take a sql dump with contents where you can see pk and fk Date: Tue, 17 Jul 2012 00:01:57 +0200 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit Injection-Date: Mon, 16 Jul 2012 22:02:15 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="da50b8a0e4970e2b9711eebf9392fd1d"; logging-data="18582"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+XhA9iQRhrPprveyoFWh98" X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18645 In-Reply-To: X-Newsreader: Microsoft Windows Mail 6.0.6001.18416 Cancel-Lock: sha1:cw/rPbdTzBTFolSBxLFCAbjV20c= X-Priority: 3 X-MSMail-Priority: Normal Xref: csiph.com comp.databases.ms-sqlserver:1176 I want to get the name of the columns, the primary key and foreign key and the contents. I want all this output to be stored in a file. I can do select * but can I redirect the output to a file. //Tony "Erland Sommarskog" skrev i meddelandet news:XnsA092F33A6DD1CYazorman@127.0.0.1... > Tony Johansson (johansson.andersson@telia.com) writes: >> I need to extract a sql dump from several tables where I can see the >> contens and primary key and foreign key > > SELECT *? Or do you want the "dump" in any special format? Can you > be more specific? > > -- > Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se > > Links for SQL Server Books Online: > SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx > SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx >