Showing posts with label queries. Show all posts
Showing posts with label queries. Show all posts

Thursday, March 29, 2012

automating taking data from sql server 2000 onto excel 2003 spreasheet

I would like to know recommendations on automate the following:

1. I want to know how to take data from various sql server 2000 data queries and load the data onto excel spreadsheets in an automated method. Some of the data loaded into the excel spreadsheets load detail data and some load data into pivot tables.

Is there any way that the data can be taken from sql server to the excel spreadsheets using odbc connections?

2. Some of the data taken from sql server 2000 database is loaded into pdf files. Is there any way this process can be automated?

Thanks!

You can use macros in Excel to do this task.

Have you checked out Reporting Services? This allows you to export to a number of different formats including PDF.

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

Tuesday, March 20, 2012

Automatic SQL Queries to dump data to folder

Hey everyone, trying to set up a SQL Query to run on a pre-determined
batch cycle that will automatically dump out specific table data to a
..csv file so that users can load the file into Excel right away, with
no manipulation or modification.

We are running SQL Server 2000. I am a novice SQL user. Any
suggestions?kosta.triantafillou@.gmail.com (kosta.triantafillou@.gmail.com) writes:
> Hey everyone, trying to set up a SQL Query to run on a pre-determined
> batch cycle that will automatically dump out specific table data to a
> .csv file so that users can load the file into Excel right away, with
> no manipulation or modification.
> We are running SQL Server 2000. I am a novice SQL user. Any
> suggestions?

Best is probably to set up a job in Agent that uses BCP to bulk out
the data. Do you want the entire table, or only part of it?

You can also try the Export/Import wizard and see what it gives you.
(Never have used it myself, though.)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||DTS is probably something you want to look at also. Like Erland's
suggestion, you package would be scheduled via SQL Agent.

Thursday, March 8, 2012

Automated SQL documenation?

I am an intern at a university and we are looking for a way to automatically document tables, queries, etc. ColdFusion is the platform used, and SQL Server 2000. Is there a way to have the documentation performed that will capture tables, constraints, etc.? I have found some, but so far, none are working. Please help if you can!!! :confused:SQLDMO would be my first choice, SQL-EM (Enterprise Mangler) would be a tolerable interface if you don't want to code your own.

-PatP|||ditto all 'dat

+

there are LOTS of sp_helpthisthatandwhatever you can use to get all that info if you're not a VB guy.
same stuff EM ends up using to populate its forms, but i like it mo' betta.|||What kind of documentation do you want? Relationships and dependencies and such? Who is the intended audience and what will they be doing with the information?|||I made it a habit to create data diagrams for every db I'm working with.

Automated procedures help

Anyone any tips for the most efficient way to automate procedures/sequence of queries in SQL server 2000?Set up a SQL Server Job through Enterprise Manager's SQL Server Agent.

blindman|||automate procedures and quries into stored procedures.

if you wish to schedule these tasks you can setup jobs to execute stored procedures or TSQL commnds or both.|||could triggers not be the answer........?|||Triggers are used when you want some event to occur every time data in a table is inserted, deleted, or modified.

For nightly batch processing, which is what I thought you were getting at, scheduled jobs are the most convenient method.

What kind of task are you trying to automate?

blindman|||Basically, I have a table ( or many tables) which are going to be updated several times a week, after which some queries will be run...............just need to automate this process......|||Actually..I think using schduled jobs and sprocs is my answer...do you tend to agree?|||Absolutely.

automated emails based on SQL Queries

Hello.
Does anyone know where there is an example of emails that are automatically
generated based on query results and have certain variables from the query
populate the email?
More Detail -
A query runs daily that identifies sales in certain locations. For each
location (row) an email is sent to the location manager with hard coded
verbiage and the sales figures pulled from the query for that specific
location.
I imagine this has been done somewhere, but I'm not sure where to start
looking.
Any suggestions are appreciated.
Thank you!
ChrisIf the query is done through a stored procedure, you can easily add SQL Mail
calls to issue emails.
Thomas
"chris" <chris@.discussions.microsoft.com> wrote in message
news:61C33544-A332-4DDB-90E1-11F2209CD396@.microsoft.com...
> Hello.
> Does anyone know where there is an example of emails that are automaticall
y
> generated based on query results and have certain variables from the query
> populate the email?
> More Detail -
> A query runs daily that identifies sales in certain locations. For each
> location (row) an email is sent to the location manager with hard coded
> verbiage and the sales figures pulled from the query for that specific
> location.
> I imagine this has been done somewhere, but I'm not sure where to start
> looking.
> Any suggestions are appreciated.
> Thank you!
> Chris
>|||Thank you! I will look into that.
"Thomas Coleman" wrote:

> If the query is done through a stored procedure, you can easily add SQL Ma
il
> calls to issue emails.
>
> Thomas
>
> "chris" <chris@.discussions.microsoft.com> wrote in message
> news:61C33544-A332-4DDB-90E1-11F2209CD396@.microsoft.com...
>
>|||You might want to take a look at microsofts new Notification Services. Comes
with SQL 2k5,
Download for sql 2k I believe.
http://www.microsoft.com/sql/ns/default.asp
"chris" wrote:

> Hello.
> Does anyone know where there is an example of emails that are automaticall
y
> generated based on query results and have certain variables from the query
> populate the email?
> More Detail -
> A query runs daily that identifies sales in certain locations. For each
> location (row) an email is sent to the location manager with hard coded
> verbiage and the sales figures pulled from the query for that specific
> location.
> I imagine this has been done somewhere, but I'm not sure where to start
> looking.
> Any suggestions are appreciated.
> Thank you!
> Chris
>

Sunday, February 19, 2012

auto_create & update statistics is null

Does this have the effect of not creating any statistics for the db and therefore forces queries to FTS rather than use an index?
How can I tell if stats exist for the tables/indexes?
Thanks,
MikeBetter to leave the option as it is by default, and also make sure to run SP_UPDATESTATS to update statistics and also generate DBCC checks to keep up the performance.

Use SP_HELPSTATS to return the information on stats.