Calgarypuck Forums - The Unofficial Calgary Flames Fan Community

Go Back   Calgarypuck Forums - The Unofficial Calgary Flames Fan Community > Main Forums > The Off Topic Forum
Register Forum Rules FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 12-07-2005, 10:36 AM   #1
JohnnyO
Scoring Winger
 
JohnnyO's Avatar
 
Join Date: Feb 2004
Location: Calgary, AB
Exp:
Default 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
JohnnyO is offline   Reply With Quote
Old 12-07-2005, 10:40 AM   #2
JohnnyO
Scoring Winger
 
JohnnyO's Avatar
 
Join Date: Feb 2004
Location: Calgary, AB
Exp:
Default

HS!! I am stupid, I can use MS Access and link to the table and create the file from their. DOH!!
JohnnyO is offline   Reply With Quote
Old 12-07-2005, 10:42 AM   #3
nfotiu
Franchise Player
 
Join Date: May 2002
Location: Virginia
Exp:
Default

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.
nfotiu is offline   Reply With Quote
Old 12-07-2005, 11:00 AM   #4
photon
The new goggles also do nothing.
 
photon's Avatar
 
Join Date: Oct 2001
Location: Calgary
Exp:
Default

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.
photon is offline   Reply With Quote
Old 12-07-2005, 11:06 AM   #5
JohnnyO
Scoring Winger
 
JohnnyO's Avatar
 
Join Date: Feb 2004
Location: Calgary, AB
Exp:
Default

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.
JohnnyO is offline   Reply With Quote
Old 12-07-2005, 08:49 PM   #6
dirk diggler
First Line Centre
 
dirk diggler's Avatar
 
Join Date: May 2004
Exp:
Default

Johnny O, you might be the biggest geek around... Make sure you take your pencil out of your pocket protector and jot this stuff down...
dirk diggler is offline   Reply With Quote
Old 12-07-2005, 09:04 PM   #7
photon
The new goggles also do nothing.
 
photon's Avatar
 
Join Date: Oct 2001
Location: Calgary
Exp:
Default

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.
photon is offline   Reply With Quote
Old 12-07-2005, 09:37 PM   #8
Calgary Flames
Lifetime Suspension
 
Join Date: Oct 2001
Location: Calgary, AB
Exp:
Default

How do I save from a .aspx web form into a database?
Calgary Flames is offline   Reply With Quote
Old 12-07-2005, 10:01 PM   #9
Buff
Franchise Player
 
Buff's Avatar
 
Join Date: Apr 2004
Location: I don't belong here
Exp:
Default

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
Buff is offline   Reply With Quote
Old 12-09-2005, 04:25 PM   #10
Calgary Flames
Lifetime Suspension
 
Join Date: Oct 2001
Location: Calgary, AB
Exp:
Default

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.
Calgary Flames is offline   Reply With Quote
Old 12-09-2005, 04:35 PM   #11
arsenal
Director of the HFBI
 
arsenal's Avatar
 
Join Date: Sep 2004
Location: Calgary
Exp:
Default

Please tell me you are at least using a code behind page.
But to give you a little hint, double click on the button.
arsenal is offline   Reply With Quote
Old 12-09-2005, 04:43 PM   #12
Calgary Flames
Lifetime Suspension
 
Join Date: Oct 2001
Location: Calgary, AB
Exp:
Default

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...
Calgary Flames is offline   Reply With Quote
Old 12-09-2005, 10:14 PM   #13
Shazam
Franchise Player
 
Shazam's Avatar
 
Join Date: Aug 2005
Location: Memento Mori
Exp:
Default

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.
Shazam is offline   Reply With Quote
Old 12-09-2005, 10:18 PM   #14
Buff
Franchise Player
 
Buff's Avatar
 
Join Date: Apr 2004
Location: I don't belong here
Exp:
Default

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.
Buff is offline   Reply With Quote
Old 12-10-2005, 10:25 AM   #15
Shazam
Franchise Player
 
Shazam's Avatar
 
Join Date: Aug 2005
Location: Memento Mori
Exp:
Default

Quote:
unfortunately that isn't quite what he is looking for.
Uh, yes it is.
Shazam is offline   Reply With Quote
Old 12-10-2005, 01:42 PM   #16
Buff
Franchise Player
 
Buff's Avatar
 
Join Date: Apr 2004
Location: I don't belong here
Exp:
Default

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.
Buff is offline   Reply With Quote
Old 12-10-2005, 01:45 PM   #17
Buff
Franchise Player
 
Buff's Avatar
 
Join Date: Apr 2004
Location: I don't belong here
Exp:
Default

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#?
Buff is offline   Reply With Quote
Old 12-10-2005, 01:47 PM   #18
Calgary Flames
Lifetime Suspension
 
Join Date: Oct 2001
Location: Calgary, AB
Exp:
Default

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?
Calgary Flames is offline   Reply With Quote
Old 12-10-2005, 01:53 PM   #19
Buff
Franchise Player
 
Buff's Avatar
 
Join Date: Apr 2004
Location: I don't belong here
Exp:
Default

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.
Buff is offline   Reply With Quote
Old 12-10-2005, 01:57 PM   #20
Calgary Flames
Lifetime Suspension
 
Join Date: Oct 2001
Location: Calgary, AB
Exp:
Default

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.
Calgary Flames is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:11 PM.

Calgary Flames
2024-25




Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Calgarypuck 2021 | See Our Privacy Policy