Probs With T-SQL Script For Report Generation

Jun 30, 2006

Hi All,

It would be great if anybody could help me how to write a T-SQL script to generate a report in spreadSheet from a table in SQLserver 2000 database.

And this report should be generated as per the following timings(Sheduled timings only).<script></script>

As well it should be able to send a mail regarding the availability of the report to user groups.

Incase if the generation of report fails then we need to send a mail reg the failure.

Any HELP is greatly appreciated!!!

Thanks in Advance!!!


Regards,

Sashi

View 1 Replies


ADVERTISEMENT

SQL Report Generation

Jul 20, 2005

HelloFor my client, I need to generate reports from the information storedin the database. The client has fixed format forms (on paper e.g. USCustoms forms etc).Will I need to redesign the forms in the application and then show theinformation?Another approach is to scan the forms as image and print theinformation on top of that image, so when it is printed , theinformation will be displayed at the right places.Is there any other way? How is the reporting done if the forms arepre-defined and the information is stored in a databaseThanks for your input

View 1 Replies View Related

Cancelling A Report Generation

Mar 13, 2008

Hello all,
Say I have a report that is running for a long time and I want to cancel it.
Is there a way to cancel the report generation once we submit the Report Generation Button? If I close my Browser, Am I closing my session in the server side? If server is still churning out the old report and I open another browser to request the same report, I might easily crash the server if the requests for the same report keep growing?

How do I handle or how does SSRs handle this?

Thanks in advance to you all experts..

Phewa Taal

View 9 Replies View Related

Report Generation Image

Dec 8, 2005

Is there any way to change the image "Report is being generated" to something else or at least change the location of it.  I have a report that is very long and our users have to scroll down to see that.  They think the report is frozen when in all reality it is still generating.  It is postioning in the center of the page and I want it to position at the top.

View 6 Replies View Related

Slow Report Generation

Dec 14, 2005

I have developed several reports with selectable parameters.  When the report is first requested three stored procedures are triggered and return the parameters (+2 min), following parameters being returned the default report is returned (+3 min), this time is unacceptable.  Is there anything I can do to speed up the report generation?  Any help here is greatly appreciated.

View 5 Replies View Related

Report Generation And Notification

Nov 9, 2007

Hi,
We need to generate the reports in a file share location and notify the Users about the location. Since the subscriptions support either File share or Email notification, we have configured file share mode in our subscriptions.
We tried writing a custom C# component to send emails to the Users but getting the status of reports generation is difficult.
Is there a way to notify the users after generating the reports in a file share?
Subash

View 6 Replies View Related

Monthly Attendance Report Generation

Jan 4, 2009

I have created a database table in MSSQL 2000 like this

[empcode] [leave_date] [type] [reason]
100 2008-12-29 00:00:00.000 T Tour
100 2008-12-30 00:00:00.000 T Tour
101 2008-12-31 00:00:00.000 CL Casual Leave
102 2009-01-01 00:00:00.000 R Restricted holiday
100 2009-01-02 00:00:00.000 T Tour

This table contains only leave details.... but i need to create monthly attendance report such as below

empcode 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 .............
100 P P P P S P T CL P P P S P P T ............
101 P T R R S R R T CL P P S P P P..............
102 P P P P S P P P P T T S CL P P P............

P-present
T-Tour
CL- causal leave
R- Restricted holiday
S-sunday

is there any way in SQL query to get the report like that.....

View 20 Replies View Related

Report Generation In Sql Server 2000

Aug 20, 2007

Just by using SQL Server 2000, what's the best way to run a stored procedure outputing the results to an excel sheet? I don't have Crystal Reports or any other 3rd party reporting tool to help me, a restriction of our client.

Found this http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1057989,00.html sp_write2Excel. Would this be the best way? Any other methods? The SQL server does not have MS Office so I think I need to ouput to a csv file.

View 2 Replies View Related

Report Server Model Generation

Jan 28, 2008

I'm attempting to generate a model for our manufacturing database in Report Server. I can create the Data Source, but when I attempt to generate the model, I get several errors in the following format ...

More than one item in the Entity 'CUST ADDRESS' has the name 'COUNTRY'. Item names must be unique among immediate siblings. (DuplicateItemName) Get Online Help

More than one Field in the Entity 'CUST ADDRESS' has the name 'COUNTRY'. Field names must be unique within an Entity. (DuplicateFieldName) Get Online Help

There are several pairs of similar error messages (DuplicateItemName and DuplicateFieldName) listed.

The tables (i.e. CUST_ADDRESS) do contain the column name (i.e. COUNTRY) but are otherwise unremarkable.

Clicking the "Get Online Help" link leads to a page with an apology and no useful information.

The database is at Compatibility Level 80, but I am able to generate models for other databases at that level.
I've run DBCC CHECKDB against the database and it returns without errors.

This is on SQL Server 2005, Standard Edition x64 with SP2.

I'm at a loss for what to do next, there doesn't seem to be any documentation for this error available.

Thanks for any insight into this matter.

------------------------------------------------------------------------------------------

After some additional research, I've discovered that in the problem entities, i.e. "CUST ADDRESS", there is a column named "COUNTRY" and a separate column named "COUNTRY_ID". I tried renaming the COUNTRY_ID column in a test copy of the database and was then able to generate the data model in Reporting Services. The problem appears to be that the model generator is unable to differentiate between a column name "COUNTRY" with one named "COUNTRY_ID".

However, I cannot do this to my production database. Is there any fixes or workarounds in Reporting Services to handle this type of situation?

View 1 Replies View Related

User Input During Report Generation.

Nov 30, 2007



Hello,

I'm trying to do something simple that has turned out to be a frustrating problem. I have a field in my report that needs to be populated by user input. Based on this user input, I will use the field in a calculation. The simple solution to me, was to create a custom assembly that has a function that uses Console.Write("Input Data") and Console.readline() to assign the input to a string, and then return that string to the report. This works fine in a test console application, but when I copy and paste the code to my custom assembly, it returns #Error to the report. I've debugged, and found that when I hit F10 on Console.Write("test"); it skips right over it, and nothing happens. It also skips over Console.readline(); with nothing happening. This makes me unable to take the user input and set the textbox equal to that value.

Am I doing this completely wrong? Is there something I'm missing, or just not understanding correcly? It seems like reporting services has to have this option. I'd really appreciate some advice. Thanks!

-Paul

View 3 Replies View Related

SQL Server 2012 :: Using WHERE Clause For Report Generation

Sep 11, 2015

Because of the way in which a specific piece of code is written, I'm bound into using a WHERE clause for a report generation.Each Inspection generates a unique Inspection Number. Any re-inspection created from that inspection is assigned that Inspection Number and appended with ".A", ".B", ".C" and so on.

The problem is this: Each row's Primary Key is the "InspectionId" in "dbo.v_InspectionDetailsReports". I need to return not only the data related to that particular InspectionId, but also the data related to any previous related inspection. For example, if I have a main number of CCS-2012 and three re-inspections, CCS-2012.A, CCS-2012.B and CCS-2012.C, and I report on CCS-2012.B, I need all the data for CCS-2012, CCS-2012.A and CCS-2012.B but NOT CCS-2012.C.

I would prefer to not have to do everything in a WHERE statement, but my hands are a bit tied.

The "SELECT * FROM dbo.v_InspectionDetailsReports WHERE . . ." is already hardcoded (don't ask).
SELECT *
FROM dbo.v_InspectionDetailsReports
WHERE ( RefOnly = 0
OR RefOnly IS NULL

[code]...

View 5 Replies View Related

Report Generation Is Consuming 100% Of CPU Client Side.

Jan 8, 2007

Hi,

I have a problem while rendering a report which returns around 5000 rows. At first the server is busy to process the request, when the server is done the rendering client side takes 100% of CPU and never displays the result ("IE is not responding"). It seems that the ReportViewer has trouble to handle the server response.

Do you have any idea why ?

Sébastien.

View 3 Replies View Related

Report Generation Time Between Users And Admin

Aug 9, 2007

Hi,

When we generate a report with an account that is in the admin group it takes 2-3 seconds but when we do it with another user it takes over 2 minutes... any reason for this?
(The "Report is being generated" thing, by the way)

Not sure if my question is clear, I've been looking and searching for the past 2 hours but can't find anything remotly close to that problem... any help would be appreaciated!

Thanks

View 1 Replies View Related

SQL 2012 :: Multiple User Report Generation And Email?

Oct 13, 2014

Lets say for example I have a table named Drier_Lot_Recipients with columns grower_id int, crop_year int, and email_address varchar(100). This table contains users that would like to receive an SSRS report I created on daily basis.

I created the SSRS report and it is deployed on a reporting services server. The name of the report is Drier_Lot_Report.rdl.

I am not sure what would be the best way to go about this. Should I do it all in SSIS or a stored procedure in SQL Server?OR maybe a combination of both.

Do I need to have calls made to the RS.EXE utility? Do I need to setup database mail in SQL Server?We have two SMTP servers.

So the end solution must call the Drier_Lot_Report and pass in two parameters (Grower_id and Crop_Year). The output must be PDF and either have the grower_id included in the output filename OR generic filename

View 1 Replies View Related

Report Generation Using A Single Dataset, Which Combines Two Tables.

Jan 18, 2008

Hi,

I have an issue in generating the report in sql reporting services. I need to display a report in a table format. The datas of the table should be from two different sql tables. I have tried to write a stored procedure that returns two result sets from two different tables. As reporting services takes datas only from the first result set, i tried to write two different stored procedures each displays one result set. Then i have created two datasets with that two different stored procedure. Even then i cannot proceed as i was not able to use two different dataset in a single table because i was setting the datasetname to one dataset, when i try to retrieve the fields from another dataset i was able to retrieve only first and count values. Then i tried using sub reports. As sub reports for a dataregion(table) repeats for every row of the main report i was not able to fetch the correct datas. Atlast i have tried combining the query using join and wrote a single stored procedure. This stored procedure returns a single result set retrieves data from two tables satisfying the conditions. The issue i am facing with this is, the first table has only one row satisfying the condition and the second table has three rows satisfying the same condition, as i am using join query for the three rows returned by the second table the first table datas are getting duplicated for the rest of the rows in the second table. As I found using join query is the only resolution for the output which I need, and also I have to avoid the duplication of the records. Hence let me know for any solutions.

I have shown the sample datas that is duplicating which is indicated as bold. Phonenumber, Attemptdate and calloutcome are from first table and start time and endtime is from second table. As there are three different datas for the second table, first table datas are duplicated





Phone Number

Attempt Date

Call OutCome

Start Time

End Time


843-577-0800

2007-09-10 15:20:00.000

Contact with Prospect - Expressed Interest

15:08

15:12


843-577-0800

2007-09-10 15:20:00.000

Contact with Prospect - Expressed Interest

15:25

15:25


843-577-0800

2007-09-10 15:20:00.000

Contact with Prospect - Expressed Interest

15:26

15:27

Thanks for any help in advance


Thanks,
Sangeethaa

View 3 Replies View Related

Report Builder Model Generation - How To Create A Key Attribute Along With The Role?

Mar 28, 2007

Hi,



I have found that in the autogenerated model attributes are missing for those fields that have relations to other tables. At first, it may look reasonable since a user can still get down to the field's value through the relation/related table. However, if the relation's key fields is the only thing the user wants to display, then going down to the related table is an overkill.

I can add an attribute manually and bind it to the key field(s). Is there an option in the autogeneration process to do it automatically? The only post I've found so far suggests to do everything manually (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1152575&SiteID=1). Is this the only way?



Thank you,

Leonid

View 3 Replies View Related

DTS Probs

Jul 20, 2005

Hi Everybody,I am facing another probs. I have created a trigger for table Tab1 forperticular column col1 for checking value ranges.But at time for usinginsert statement it is working fine but when I am importing data fromflat file through DTS the trigger is not working.How to solve this.RegardsArijit Chatterjee

View 1 Replies View Related

Having Probs Connecting

Oct 3, 2006

this is my first time using sql server, so i guess i'm def doing something wrong here..

my connection:

Code:

objConn = "Driver={SQL Server};Server=SHEMPCWEBSERVER;Database=aoms;Trusted_Con nection=yes;"

Set conn=Server.CreateObject("ADODB.Connection")
conn.Open objConn
Set rsLogin = Server.CreateObject("ADODB.recordset")

'Select the data from the database using the submitted data.
rsLogin.Open "SELECT * FROM tblUsers", conn

Response.Write rsLogin("fldUsrsName")



my error:

Code:

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'SHEMPCIUSR_XBOARDS-VRORER9'.

/aoms/testdb.asp, line 6



can anyone see what i'm doing wrong?
Thanks
Shem

View 2 Replies View Related

Update Probs...

Feb 13, 2008

Hello...
I am stuck with update statement...
I am having 3 tables abc,def and xyz...
i want to update column1 of abc with column2 of def values (here the probs is i dont have any common fields between them)
i am having common values between def(column10) and xyz(column10_new)
so i am using inner join something like below....

but this looks like wrong to me...bcoz when i do this (only select):
select column2 FROM def inner join xyz on def. column10 = xyz. column10_new
i am getting different as compared to the update below....

UPDATE abc
SET column1 = column2 FROM def inner join xyz
on def. column10 = xyz. column10_new

can anyone suggest how to solve this update???
Thanks

View 2 Replies View Related

Conversion Probs..

Jul 23, 2005

Hi Group,I am trying to display the multiplication through this way----------------------select 1163436036*100----------------------Getting the error============================Server: Msg 8115, Level 16, State 2, Line 1Arithmetic overflow error converting expression to data type int.============================For that reason I was tried to convert that to nvarchar------------------------select convert(numeric(36,2),1163436036*100)------------------------But still getting the error=============================Server: Msg 8115, Level 16, State 2, Line 1Arithmetic overflow error converting expression to data type int.=============================Please help me to solve it out..Thanks and RegardsArijit Chatterjee

View 3 Replies View Related

Installation Probs

Dec 28, 2006

I keep getting errors while trying to install SQL 2000 enterprise edition.....

Internal Error: Contact MS Tech Support

Help !!!

View 3 Replies View Related

OPen Xml Rowpattern Probs!

Mar 1, 2007

Hi All,

I have this sql syntax which displays the records within the xml but instead of displaying 4 records (3 records relating to the last question ID) but instead resulting in only two records picking only the first options 'Unhelpful'.

Definitely doing something wrong here, please advise!

DECLARE @doc xml
SET @doc =
'<DivisionName>
<QuestInfo Custref="18759" SubDate="2006-01-01T00:00:00"
Polref="30018759" AgentID="4189" ClaimRef="14024-5647-890"/>
<DVName>Ho</DVName>
<DvcodeNo>1</DvcodeNo>
<ClaimGroup>
<CustSurveyNo>4</CustSurveyNo>
<ClaimGroupType>Water</ClaimGroupType>
<Questions>
<QuestionID>45</QuestionID>
<Answer>
<AnswerID>43</AnswerID>
<Ansoption />
</Answer>
</Questions>
<Questions>
<QuestionID>34</QuestionID>
<Answer>
<AnswerID>13</AnswerID>
<Ansoption>
<Options>Unhelpful</Options>
</Ansoption>
</Answer>
</Questions>
</ClaimGroup>
</DivisionName>'


DECLARE @docHandle int


EXEC sp_xml_preparedocument @docHandle OUTPUT, @doc


SELECT *
FROM
OPENXML(@docHandle, '/DivisionName/ClaimGroup/Questions/Answer/
Ansoption', 2)
WITH
(DVName varchar (20) '../../../../DVName',
DvcodeNo int '../../../../DvcodeNo',
CustSurveyNo int '../../../CustSurveyNo',
ClaimGroupType varchar (20) '../../../ClaimGroupType',
QuestionID int '../../QuestionID',
AnswerID int '../AnswerID',
Ansoption varchar (30)'Options')


EXEC sp_xml_removedocument @docHandle

View 1 Replies View Related

Probs With INNER JOIN Statement

Apr 19, 2004

Hi folks,

I got a strange Problem with this statement:

select * from [db1].[dbo].[table1] AS db1
INNER JOIN [db2].[dbo].[table1] AS db2
ON (db1.Text = db2.Text)

Text fields are both nvarchar(50)

I think this should work, but it doesnt?
I got a SQL Server Error 446

I know, text compares are not that good, but it exists no other way....

Thanks for any advice!!!

View 10 Replies View Related

Production Server Probs

Nov 9, 2007

I have production server 2000. The server gets disconnected sometime by itself and sometime it is working fine.Sometimes it even doesn't get restarted. Is there any problem with service packs and some performance issues.
Can you SQL guru give me best suggestion and how should i proceed.

View 3 Replies View Related

Datetime Datatype Probs....

Jan 30, 2008

when i update i want only date portion tp be displayed from datetime datatype...
create table temp11 (datecolumn datetime)
insert into temp11 values (getdate ())
insert into temp11 values (getdate ())
insert into temp11 values (getdate ())
insert into temp11 values (getdate ())

now when i am running this query,i am getting what i want...
select convert (varchar, datecolumn,111) from temp11

but when i am tyring to update in the temp11 table using the below query...

update temp11
set datecolumn = convert (varchar, datecolumn,111)

i am getting date and time as well like...
2008-01-14 00:00:00.000
2008-01-14 00:00:00.000
2008-01-14 00:00:00.000
2008-01-14 00:00:00.000

i only want the date portion in my updated new table.....
any suggestions plzzzzzzzzz
is it poss thru any sql query???or shud be done in the front end only???

View 5 Replies View Related

Interactive Sort Has Probs

Jun 11, 2007

Hi All,



I've designed a simple sales report , first grouped by Transport type and then by item.

Example

Category Item Sales



DHL A 2000

DHL C 1500

DHL E -1700



AmEx A 200

Amex E 20



-------------------------------

when click on sales under group DHL it shouild sort -say descending-

so result should be

DHL A 2000

DHL C 1500

DHL E -1700



instead I get results



DHL A 2000

DHL E -1700

DHL C 1500



this is just an example but this is the sort of results I get when I try to use interactive sorting.

Any Ideas?



thanks



Sonny

View 5 Replies View Related

AFTER INSTALLATION PROBS.......HELP NEEDED

Oct 20, 2007

You notice after installing SQL Server 2005 that there is a warning message in the SQL Server log that SQL Server cannot lock pages in memory. What must you do to allow SQL Server to lock memory pages in memory?


After installing SQL Server, your customer complains that transactions are slow. You notice that there is excessive I/O in the TempDb. You want to move TempDb to another set of disks, so you have the sytem administrator configure two more logical disks on the server. What must you do to configure the SQL Server TempDb on this new set of disks?


You are instructed to install SQL Server in an Active / Active cluster environment. What two network related pieces of information must you have prior to performing the installation?

View 3 Replies View Related

Probs In Nested Stored Procedures

Mar 22, 2001

Has anyone faced problems in calling one stored procedure from within another stored procedure ? I am considering using nested SPs, and would appreciate any inputs on it.

Thks,
SC

View 2 Replies View Related

Import From Excel With IMEX=1 Still Gives Probs

Mar 28, 2007

Hi:

Am trying to import XLS data into SQL 2005 SP2 thro a SSIS Data Flow task. My Excel Connection string has IMEX=1, ImportMixedTypes is set to Text and the typeguessrows is set to 0.

Import works fine for cells of Format Text, but when I have a large number (in a general Format cell) it gets converted into scientific notation(e.g. 3.234175e+7) in the table.

What am I doing wrong?

TIA

Kar

View 2 Replies View Related

SPROC Probs Creating A Non-identity Number Column

Jun 26, 2006

Hi. I am trying to figure out the code for sorting a manual (non-identity) number column in my table. the purpose is to
show the user's pictures in perfect order (1,2,3,4,5,6...).

The Jist of my problem... When a user first inserts six pictures, he gets:

|1|
|2|
|3|
|4|
|5|
|6|

All is good. But, say he deletes picture |3|. Now the list order looks like this:

|1|
|2|
<- |3| is removed
|4|
|5|
|6|

And, then he inserts two more pictures, now he his this:

|1|
|2|

|4|
|5|
|6|
|7| <- |7| & |8| are added
|8|

What i want to acheive is a "reshuffling" of the number order every time a picture is removed. So, when |3| is removed, |4| becomes |3|, |5| becomes |4| and so on. There should never be a gap in the order.

I am new to stored procedures, and have been trying to figure this out. Below is my guesswork:


Code:


ALTER PROCEDURE dbo.sp_NewPersonalPic

(
@photo_name VARCHAR(50) = NULL,
@photo_location VARCHAR(100) = NULL,
@photo_size VARCHAR(50) = NULL,
@user_name VARCHAR(50) = NULL,
@photo_caption VARCHAR(150) = NULL,
@photo_default BIT = NULL,
@photo_private BIT = NULL,
@photo_number INTEGER = NULL,
@photo_date DATETIME = NULL
)

AS

BEGIN
SELECT @photo_date = CONVERT(DATETIME,convert(char(26), getdate(), 109))
END

BEGIN
SET @photo_number = 1
SELECT

@photo_number = (
SELECT COUNT(*)
FROM dbo.PersonalPhotos b
WHERE
a.photo_date < b.photo_date
)
FROM
dbo.PersonalPhotos a
ORDER BY
a.photo_date
END

BEGIN



My thinking is that it would be a safe bet to use the "photo_date" column as a litmus for my "photo_number" column (ie, the most recent record inserted by the user will always be at a later date than the previously inserted record). So:

photo_number photo_date
|1| 2006-06-26 21:43:36.653
|2| 2006-06-26 21:43:50.000
|3| 2006-06-26 21:45:25.217
|4| 2006-06-26 21:45:33.763
|5| 2006-06-26 22:39:42.670
|6| 2006-06-26 22:39:49.200

If |3| is removed above, the numbers are reordered based on the time of entry sequence.

Any suggestions on how to acheive this in my stored procedure? Currenly, i get the correct order, but it goes crazy when i delete and add.

Thanks and sorry for the verbose post.

View 5 Replies View Related

DDL Generation

Oct 3, 2000

I have a quick question regarding SQL Server Enterprise Manager. I'm looking at setting up a job to automatically create DDL for a user database. This will be done along with our normal nightly backup routine.
I'm very familiar with using EM to create SQL scripts, but is there anyway to schedule this task? I've considered DTS and some type of scheduled package, but can't seem to find anything similar. I'm thinking I may need a custom task.
Could someone please shed some light on the subject? If not from within EM, how about any third party tools? FYI - I already own the Embarcadero suite and am trying it out wwith that.

Thank You.

Anthony Robinson

View 10 Replies View Related

Csv Generation

Jul 11, 2007

hi
I want to generate excel file which contain table name , column name,datatype ,size

how we can do in sql server
is there any way
pleases tell the steps

View 2 Replies View Related

SMK Generation

Nov 3, 2007

Server:
SQL 2005 SP2 on Win 2003 Ent. SP1


A 3rd part app is requiring that I create a credential, whick in turn requires an SMK be set. When I try to create the credential, I get an error message indicating a decryption error. When I run the alter command to regenerate the key (without force) it throws an error indicating the key cannot be decrypted. According to a KB article I found, this may indicate that a key has never been generated.

My question is, I have a number of production databases in this instance, including SQL Reporting Services. Except for the SRS DB's, all other user db's are simple db's that don't use encryption. If I run the Force command to generate the key, am I going to break anything? I'm really concerned about report servioces.

Thanks.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved