12-07-2005, 10:36 AM
|
#1
|
Scoring Winger
Join Date: Feb 2004
Location: Calgary, AB
|
SQL Server Data Extract from a Table??
With all the Computer User horse power on this board, does anyone have an easy, fast, cheap way to extract data from an SQL Server table to a csv or xls file?
Thanks
|
|
|
12-07-2005, 10:40 AM
|
#2
|
Scoring Winger
Join Date: Feb 2004
Location: Calgary, AB
|
HS!! I am stupid, I can use MS Access and link to the table and create the file from their. DOH!!
|
|
|
12-07-2005, 10:42 AM
|
#3
|
Franchise Player
Join Date: May 2002
Location: Virginia
|
How about using excel, and doing a Data/Import External Data and choosing Sql Server option, or an odbc connection you've already set up.
I am more of an Oracle guy, but don't you have a sql server client? I would think it would have some option to export to csv as well.
|
|
|
12-07-2005, 11:00 AM
|
#4
|
The new goggles also do nothing.
Join Date: Oct 2001
Location: Calgary
|
Yeah, I'm pretty sure Enterprise Manager has an option to export to a csv file.
__________________
Uncertainty is an uncomfortable position.
But certainty is an absurd one.
|
|
|
12-07-2005, 11:06 AM
|
#5
|
Scoring Winger
Join Date: Feb 2004
Location: Calgary, AB
|
I found the solution out of EM but that was ######ed as you had to tell it which columns of data you want. (I want them all) plus you could not save the extract to run it monthly. Also I don't really want a users messing around in EM.
|
|
|
12-07-2005, 09:04 PM
|
#7
|
The new goggles also do nothing.
Join Date: Oct 2001
Location: Calgary
|
Quote:
Originally Posted by JohnnyO
I found the solution out of EM but that was ######ed as you had to tell it which columns of data you want. (I want them all) plus you could not save the extract to run it monthly. Also I don't really want a users messing around in EM.
|
Lol good point.
__________________
Uncertainty is an uncomfortable position.
But certainty is an absurd one.
|
|
|
12-07-2005, 09:37 PM
|
#8
|
Lifetime Suspension
Join Date: Oct 2001
Location: Calgary, AB
|
How do I save from a .aspx web form into a database?
|
|
|
12-07-2005, 10:01 PM
|
#9
|
Franchise Player
Join Date: Apr 2004
Location: I don't belong here
|
Quote:
Originally Posted by Calgary Flames
How do I save from a .aspx web form into a database?
|
what have you got so far? have you opened a connection? how?
post your code somewhere for us to take a look at
|
|
|
12-09-2005, 04:25 PM
|
#10
|
Lifetime Suspension
Join Date: Oct 2001
Location: Calgary, AB
|
Quote:
Originally Posted by Buff
what have you got so far? have you opened a connection? how?
post your code somewhere for us to take a look at
|
No connection yet. Simply form elements and a button on plain page....
I'll post the code this Sunday.
|
|
|
12-09-2005, 04:35 PM
|
#11
|
Director of the HFBI
Join Date: Sep 2004
Location: Calgary
|
Please tell me you are at least using a code behind page.
But to give you a little hint, double click on the button.
|
|
|
12-09-2005, 04:43 PM
|
#12
|
Lifetime Suspension
Join Date: Oct 2001
Location: Calgary, AB
|
Quote:
Originally Posted by arsenal
Please tell me you are at least using a code behind page.
But to give you a little hint, double click on the button.
|
Obviously...
|
|
|
12-09-2005, 10:14 PM
|
#13
|
Franchise Player
Join Date: Aug 2005
Location: Memento Mori
|
Quick and dirty:
Use Query Analyser. Make sure to select "Results in Grid" in the "Query" menu item. Run the query you want to export. Select the results by selecting a cell and then hitting ctrl-a. Paste into Excel.
|
|
|
12-09-2005, 10:18 PM
|
#14
|
Franchise Player
Join Date: Apr 2004
Location: I don't belong here
|
Quote:
Originally Posted by Shazam
Quick and dirty:
Use Query Analyser. Make sure to select "Results in Grid" in the "Query" menu item. Run the query you want to export. Select the results by selecting a cell and then hitting ctrl-a. Paste into Excel.
|
Unfortunately that isn't quite what he is looking for.
|
|
|
12-10-2005, 10:25 AM
|
#15
|
Franchise Player
Join Date: Aug 2005
Location: Memento Mori
|
Quote:
unfortunately that isn't quite what he is looking for.
|
Uh, yes it is.
|
|
|
12-10-2005, 01:42 PM
|
#16
|
Franchise Player
Join Date: Apr 2004
Location: I don't belong here
|
Quote:
Originally Posted by Shazam
Uh, yes it is.
|
He wants to connect the web form that he is writing to a database and have the data inserted into the database. Excel is not a database, it is a spreadsheet. He wants to code the form, and then the user presses select and it goes into the database. He doesn't want to do all the work that you are suggesting, everytime the page is visited.
He wants, when the submit button is pressed, to have a connection to the db opened, the results inserted into the fields of the database, the connection closed, and perhaps a message on the screen telling him/the user that the submission was successfull.
|
|
|
12-10-2005, 01:45 PM
|
#17
|
Franchise Player
Join Date: Apr 2004
Location: I don't belong here
|
Jordon, what kind of database? Hopefully SQL.
Anyways, check over this link, I didn't look to closely but it probably has some hints for you... and it isn't done with a code behind page either, but it works and you can easily implement a code behind page.
http://msdn.microsoft.com/library/de...qldatabase.asp
edit: Just out of curiousity, I'm assuming you're doing this in .NET, what language are you using for the code behind? VB? C#?
|
|
|
12-10-2005, 01:47 PM
|
#18
|
Lifetime Suspension
Join Date: Oct 2001
Location: Calgary, AB
|
Quote:
Originally Posted by Buff
He wants to connect the web form that he is writing to a database and have the data inserted into the database. Excel is not a database, it is a spreadsheet. He wants to code the form, and then the user presses select and it goes into the database. He doesn't want to do all the work that you are suggesting, everytime the page is visited.
He wants, when the submit button is pressed, to have a connection to the db opened, the results inserted into the fields of the database, the connection closed, and perhaps a message on the screen telling him/the user that the submission was successfull.
|
Bingo bango. I just need to look in the database and figure out which form field input goes into which table column in the database and write the SQL statement.
Say I have a field called fldName, how would I make that go into tblCustomers/CustomerName?
|
|
|
12-10-2005, 01:53 PM
|
#19
|
Franchise Player
Join Date: Apr 2004
Location: I don't belong here
|
Quote:
Originally Posted by Calgary Flames
Bingo bango. I just need to look in the database and figure out which form field input goes into which table column in the database and write the SQL statement.
Say I have a field called fldName, how would I make that go into tblCustomers/CustomerName?
|
I don't want to help you too much as it is better for you to learn it, perhaps I did too much with the link I posted already, but take a look at the code in there and study it, and see what is happening.
|
|
|
12-10-2005, 01:57 PM
|
#20
|
Lifetime Suspension
Join Date: Oct 2001
Location: Calgary, AB
|
Quote:
Originally Posted by Buff
I don't want to help you too much as it is better for you to learn it, perhaps I did too much with the link I posted already, but take a look at the code in there and study it, and see what is happening.
|
Typical programmer response...  But I get what you're trying to say.
thanks for the link.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -6. The time now is 05:11 PM.
|
|