Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Thursday, March 29, 2012

Export Excel : put name of table in sheet's name

Hello,
Is it possible to give another name that "Sheet1" when I export my report to
Excel ?
Can I put the title of my table report, for example ?
Thanks.You can not control the name of the sheets. One sheet report will use the
report name for the sheet name. Multiple sheets report will use Sheet1,
Sheet2 ...
--
Nico Cristache [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Drix78" <Drix78@.discussions.microsoft.com> wrote in message
news:C69AE2AB-7FC5-4B61-8E43-318A3DD4115D@.microsoft.com...
> Hello,
> Is it possible to give another name that "Sheet1" when I export my report
to
> Excel ?
> Can I put the title of my table report, for example ?
> Thanks.
>

export DBCC CHECKDB into table

Is there anyway to export DBCC CHECKDB results into a table?
The only example I was able to find on Books Online is:
INSERT INTO #tracestatus
EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')
Please helpBelow work fine on 2005:
CREATE TABLE a
(c1 int, c2 int, c3 int, c4 varchar(4000), c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int,
c12 int, c23 int, c14 int, c15 int, c16 int, c17 int, c18 int)
insert into a
EXEC('DBCC CHECKDB(pubs) WITH TABLERESULTS')
SELECT * FROM a
Of course, create the table with a bit more care and try to match the data types carefully instead
of just guessing like I did. :-)
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in message
news:D82B695F-110A-492B-82C6-33C592981F8F@.microsoft.com...
> Is there anyway to export DBCC CHECKDB results into a table?
> The only example I was able to find on Books Online is:
> INSERT INTO #tracestatus
> EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')
> Please help|||It works!
Thanks a million, Tibor!
"Tibor Karaszi" wrote:
> Below work fine on 2005:
> CREATE TABLE a
> (c1 int, c2 int, c3 int, c4 varchar(4000), c5 int, c6 int, c7 int, c8 int, c9 int, c10 int, c11 int,
> c12 int, c23 int, c14 int, c15 int, c16 int, c17 int, c18 int)
> insert into a
> EXEC('DBCC CHECKDB(pubs) WITH TABLERESULTS')
> SELECT * FROM a
>
> Of course, create the table with a bit more care and try to match the data types carefully instead
> of just guessing like I did. :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in message
> news:D82B695F-110A-492B-82C6-33C592981F8F@.microsoft.com...
> > Is there anyway to export DBCC CHECKDB results into a table?
> >
> > The only example I was able to find on Books Online is:
> > INSERT INTO #tracestatus
> > EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')
> >
> > Please help
>

export DBCC CHECKDB into table

Is there anyway to export DBCC CHECKDB results into a table?
The only example I was able to find on Books Online is:
INSERT INTO #tracestatus
EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')
Please helpBelow work fine on 2005:
CREATE TABLE a
(c1 int, c2 int, c3 int, c4 varchar(4000), c5 int, c6 int, c7 int, c8 int, c
9 int, c10 int, c11 int,
c12 int, c23 int, c14 int, c15 int, c16 int, c17 int, c18 int)
insert into a
EXEC('DBCC CHECKDB(pubs) WITH TABLERESULTS')
SELECT * FROM a
Of course, create the table with a bit more care and try to match the data t
ypes carefully instead
of just guessing like I did. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in me
ssage
news:D82B695F-110A-492B-82C6-33C592981F8F@.microsoft.com...
> Is there anyway to export DBCC CHECKDB results into a table?
> The only example I was able to find on Books Online is:
> INSERT INTO #tracestatus
> EXEC ('DBCC TRACESTATUS (-1) WITH NO_INFOMSGS')
> Please help|||It works!
Thanks a million, Tibor!
"Tibor Karaszi" wrote:

> Below work fine on 2005:
> CREATE TABLE a
> (c1 int, c2 int, c3 int, c4 varchar(4000), c5 int, c6 int, c7 int, c8 int,
c9 int, c10 int, c11 int,
> c12 int, c23 int, c14 int, c15 int, c16 int, c17 int, c18 int)
> insert into a
> EXEC('DBCC CHECKDB(pubs) WITH TABLERESULTS')
> SELECT * FROM a
>
> Of course, create the table with a bit more care and try to match the data
types carefully instead
> of just guessing like I did. :-)
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message
> news:D82B695F-110A-492B-82C6-33C592981F8F@.microsoft.com...
>

Monday, March 26, 2012

Export data onto Hard Disk

Hello People,

I have began to store binary data in my database, for example word documents, PDF's...etc.

But now my database file is growing beyond what I want, and I need to move all of the files out of the DB onto normal hard disk space.

Is there anyway, say by using a bulk copy command, that I can write all the contents of the table into a folder on my hard disk...?

My database table consists of ID(int), Filename(varchar), Filetype(varchar), Filesize(varchar), Filebody(image)

Any help would be extremely appreciated....

Many Thanks,

Alan...bcp, DTS?|||You can BCP (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/coprompt/cp_bcp_61et.asp) the entire contents of a table into a single file on your hard disk. You could write a DTS (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dtssql/dts_tools_des_4fg2.asp) package that took every row from your table, and wrote the contents of the filebody column into a file named by the filename column.

-PatP

Friday, March 23, 2012

Export Column Import Column in SSIS

HI FOCKS,

i want to know the use of Export Column & Import Column in SSIS

please give me the example

regards

koti

They are used to move files into and out of columns in the data flow.

Wednesday, March 21, 2012

export (from mdb)-> import (to MS Sql server)

I have big problem.

In database MyDB.mdb I have table for example: ORDERS with colums:
- Id int
- Name varchar(20)

Also I create same table in SQL Server 2k.
I can manualy export this data from mdb database to SQL Server. But I want
to make this more automatic.

Is is possible? To import automaticaly data from mdb format to table in SQL
Server 2000?

please, help me :)

best regards
Piotr Leib

ps.
sorry for my terrible english language"BUSHII" <piotrl@.robcom.com.pl> wrote in message news:<cd3vki$6pk$1@.nemesis.news.tpi.pl>...
> I have big problem.
> In database MyDB.mdb I have table for example: ORDERS with colums:
> - Id int
> - Name varchar(20)
> Also I create same table in SQL Server 2k.
> I can manualy export this data from mdb database to SQL Server. But I want
> to make this more automatic.
> Is is possible? To import automaticaly data from mdb format to table in SQL
> Server 2000?
> please, help me :)
> best regards
> Piotr Leib
> ps.
> sorry for my terrible english language

Have you looked at DTS? It can move data directly between different
data sources. To get started quickly, you can use the "Import and
Export Data" option in the start menu. Another possibility is to
create a linked server from MSSQL to the Access DB, and then simply
INSERT...SELECT... directly - see "Linked Servers" in Books Online.
Finally, if you can export to a flat file from Access, then you can
import that file with bcp.exe or DTS.

Simon|||I just create an ODBC connection to this database server and MS Access can
export directly to ODBC. It even will create the tables for you.

Oscar...

"BUSHII" <piotrl@.robcom.com.pl> wrote in message
news:cd3vki$6pk$1@.nemesis.news.tpi.pl...
> I have big problem.
> In database MyDB.mdb I have table for example: ORDERS with colums:
> - Id int
> - Name varchar(20)
> Also I create same table in SQL Server 2k.
> I can manualy export this data from mdb database to SQL Server. But I want
> to make this more automatic.
> Is is possible? To import automaticaly data from mdb format to table in
SQL
> Server 2000?
> please, help me :)
> best regards
> Piotr Leib
> ps.
> sorry for my terrible english language

Wednesday, March 7, 2012

Expand/collapse view on Report Viewer

The expand +/collapse - view does not work on reports viewed using the
ReportViewer.dll (MS example).
Any tips/help would be greatly appreciated. Thank you.
MarlonActually, after some testing, the expand/collapse works, but only if the web
site and the reports are on the same server. It doesn't work if they are on
different servers.
Still looking for a solution to this issue.
Marlon
"TechnoSpyke" <technospyke@.yahoo.com> wrote in message
news:unhWp$QGFHA.2824@.tk2msftngp13.phx.gbl...
> The expand +/collapse - view does not work on reports viewed using the
> ReportViewer.dll (MS example).
> Any tips/help would be greatly appreciated. Thank you.
> Marlon
>

Expand/collapse matrix cells

Hi folks - I am trying to figure out how to set up the visibility
(expand/collapse) for my grouped matrix. So for example:
A
A1 10
A2 15
Total A 25
B
B1 35
B2 30
Total B 70
I want the user to be able to click and collapse to just see this:
A 25
B 70
Is this possible? I get the table, but am confused on how the matrix
handles grouping and visibility...
-RyanIn a matrix, you would have two row groupings. One for A, B, etc. and an
inner grouping for A1, A2, B1, etc.
1. For the inner row grouping, edit the grouping expression and go to the
Visibility tab of the grouping and sorting dialog. Set initial visibility to
"Hidden". Then, select "Visibility can be toggled by another reportitem" and
select the textbox of the outer row grouping heading.
2. For the inner row grouping, go to its heading textbox properties and set
the "initial appearance of the toggle" to Collapsed.
I also recommend to look at the sample reports that come with RS 2000 / RS
2005. Specifically, check the "Company Sales" sample report - it should
provide what you are looking for.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ryan M" <ryan.marples@.bluetidemanagement.com> wrote in message
news:1128026677.096400.11570@.f14g2000cwb.googlegroups.com...
> Hi folks - I am trying to figure out how to set up the visibility
> (expand/collapse) for my grouped matrix. So for example:
> A
> A1 10
> A2 15
> Total A 25
> B
> B1 35
> B2 30
> Total B 70
> I want the user to be able to click and collapse to just see this:
> A 25
> B 70
> Is this possible? I get the table, but am confused on how the matrix
> handles grouping and visibility...
> -Ryan
>|||Thanks for the pointer Robert. It turned out what I was doing wrong is
... applying the visibility properties to the textbox that represented
the group, not the group itself. Now I get it, thanks!
Now if I could just figure out how to get column heading for my row
groups...
-Ryan

Sunday, February 26, 2012

exit from script

I need to exit from a script after checking some conditions . for example I need to check if a store procedure does not exist make it other wise go exit . I try following code but became an error

if exists(select ..... )

create store procedure ...

<<error becomes>>

or

if exists(select .... ) return

go

create store procedure .....

go

<<both command runs>>

Moved to T-SQL forum.

|||

A good way to check before creation is something like this: Note: RETURN in not required.

The CREATE PROCEDURE code will execute after the PROCEDURE has been deleted.

Code Snippet


IF EXISTS
( SELECT name
FROM sys.Procedures
WHERE name = 'MyProcedureName'
)
DROP PROCEDURE dbo.MyProcedureName
GO


CREATE PROCEDURE dbo.MyProcedureName
( @.Parameters etc )
AS
...


GO

|||

Unfortunately you can't do it here.Create procedure script should not be batched on IF statement.

As per the specification Create Procedure/Function/Trigger/View should be the first statement of your query

The best approach is,

Code Snippet

IF EXISTS (Procedure)

Drop Procedure ...

go

Create Proc ....

|||

If you use GO on your batch you can't stop it. You can only return / stop the current query (which is enclosed by GO).. When you return or use goto, it will automatically fetch the next script..

So always check the object is available, if available drop it & recreate it.

Friday, February 24, 2012

ExecutionLog Fields

Is there a document that details what the fields in the ExecutionLog
represent. For example, what is the RowCount based on? Or how are the
TimeDataRetrieval, TimeProcessing & TimeRendering fields calculated?You may want to check this related thread for an explanation of execution
log times:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=599418b6-d837-446b-b02b-26394c4a8a7b&sloc=en-us
The RowCount column shows the total number of rows read in _all_ datasets
during the report execution. This includes also dataset rows read for
query-based report parameters.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Propwash" <scott.tyree@.crossmark.com> wrote in message
news:1115137030.760735.158180@.o13g2000cwo.googlegroups.com...
> Is there a document that details what the fields in the ExecutionLog
> represent. For example, what is the RowCount based on? Or how are the
> TimeDataRetrieval, TimeProcessing & TimeRendering fields calculated?
>|||Ok, just to make sure I am fully understanding. If I have a SP that
joins three tables (A,B,C), then my RowCound will be the sum of tables
A, B & C plus the resulting recordset. Is this correct?|||No. The RowCount represents only the number of rows in the resulting record
set. If you join multiple table into one dataset inside the stored
procedure, it will not influence the RowCount.
However, if you use the record set in a report parameter and in the report,
you may say a higher count than if you only use it in the report.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Propwash" <scott.tyree@.crossmark.com> wrote in message
news:1115209799.601180.4530@.g14g2000cwa.googlegroups.com...
> Ok, just to make sure I am fully understanding. If I have a SP that
> joins three tables (A,B,C), then my RowCound will be the sum of tables
> A, B & C plus the resulting recordset. Is this correct?
>