Click here to Skip to main content
15,892,537 members
Home / Discussions / Database
   

Database

 
Questionin a stored procedure, can I directly write some lines to a txt file? Pin
alexyxj30-Jul-08 11:56
alexyxj30-Jul-08 11:56 
AnswerRe: in a stored procedure, can I directly write some lines to a txt file? Pin
goodideadave30-Jul-08 13:10
goodideadave30-Jul-08 13:10 
AnswerRe: in a stored procedure, can I directly write some lines to a txt file? Pin
SimulationofSai30-Jul-08 19:24
SimulationofSai30-Jul-08 19:24 
AnswerRe: in a stored procedure, can I directly write some lines to a txt file? Pin
Vimalsoft(Pty) Ltd30-Jul-08 20:59
professionalVimalsoft(Pty) Ltd30-Jul-08 20:59 
Questionhow to use bulk insert to import a data file with this format? Please help Pin
alexyxj30-Jul-08 9:09
alexyxj30-Jul-08 9:09 
AnswerRe: how to use bulk insert to import a data file with this format? Please help Pin
Wendelius30-Jul-08 9:48
mentorWendelius30-Jul-08 9:48 
GeneralRe: how to use bulk insert to import a data file with this format? Please help Pin
alexyxj30-Jul-08 11:23
alexyxj30-Jul-08 11:23 
GeneralRe: how to use bulk insert to import a data file with this format? Please help Pin
Wendelius30-Jul-08 11:55
mentorWendelius30-Jul-08 11:55 
Yes, the table must exist. Try something like this:
CREATE TABLE BulkTest (
Column1 bigint,
Column2 bigint)

Then create the format file using notepad and save it:
<?xml version="1.0"?>
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <RECORD>
  <FIELD ID="1" xsi:type="NativeFixed" LENGTH="7"/>
  <FIELD ID="2" xsi:type="NativeFixed" LENGTH="1"/>
 </RECORD>
 <ROW>
  <COLUMN SOURCE="1" NAME="Column1" xsi:type="SQLBIGINT"/>
  <COLUMN SOURCE="2" NAME="Column2" xsi:type="SQLBIGINT"/>
 </ROW>
</BCPFORMAT>

And then bulk insert the data:
BULK INSERT BulkTest FROM 'f:\orders\lineitem.tbl' WITH (FORMATFILE='f:\orders\BulkInsertFormat.txt')

Mika
Questionhow to ArrayList store whole records? Pin
zeeShan anSari30-Jul-08 6:32
zeeShan anSari30-Jul-08 6:32 
AnswerCross-post Pin
Wendelius30-Jul-08 6:48
mentorWendelius30-Jul-08 6:48 
Questionpossible database fields Pin
dream_liner_7e730-Jul-08 4:03
dream_liner_7e730-Jul-08 4:03 
AnswerRe: possible database fields Pin
SimulationofSai30-Jul-08 5:28
SimulationofSai30-Jul-08 5:28 
GeneralRe: possible database fields Pin
Paul Conrad30-Jul-08 7:13
professionalPaul Conrad30-Jul-08 7:13 
AnswerRe: possible database fields Pin
Vimalsoft(Pty) Ltd30-Jul-08 21:02
professionalVimalsoft(Pty) Ltd30-Jul-08 21:02 
Questionretrieve more than one row in one row Pin
obarahmeh29-Jul-08 23:16
obarahmeh29-Jul-08 23:16 
AnswerRe: retrieve more than one row in one row Pin
Declan Bright30-Jul-08 3:56
Declan Bright30-Jul-08 3:56 
AnswerRe: retrieve more than one row in one row Pin
leoinfo30-Jul-08 4:26
leoinfo30-Jul-08 4:26 
GeneralRe: retrieve more than one row in one row [modified] Pin
PIEBALDconsult31-Jul-08 4:36
mvePIEBALDconsult31-Jul-08 4:36 
JokeRe: retrieve more than one row in one row Pin
leoinfo31-Jul-08 8:56
leoinfo31-Jul-08 8:56 
GeneralRe: retrieve more than one row in one row Pin
PIEBALDconsult31-Jul-08 10:16
mvePIEBALDconsult31-Jul-08 10:16 
AnswerRe: retrieve more than one row in one row Pin
PIEBALDconsult30-Jul-08 20:25
mvePIEBALDconsult30-Jul-08 20:25 
JokeRe: retrieve more than one row in one row Pin
leoinfo31-Jul-08 2:35
leoinfo31-Jul-08 2:35 
GeneralRe: retrieve more than one row in one row Pin
PIEBALDconsult31-Jul-08 3:38
mvePIEBALDconsult31-Jul-08 3:38 
QuestionReporting Services - Subreport cannot be viewed. Pin
Rashmi Deshpande29-Jul-08 20:10
Rashmi Deshpande29-Jul-08 20:10 
QuestionCommon Stored procedure for insert update and delete. Pin
santosh04229-Jul-08 19:58
santosh04229-Jul-08 19:58 

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.