Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Tuesday, March 20, 2012

'Other' segment in a pie chart

Hello everybody,

I am creating a pie chart report from a cube. This report may contain unknown number of segments. Here is the thing; if more than 1 data slice is generated with a value less than 5% of the total, then a segment labelled 'other' will be generated, and data from all slices with value < 5% will be added to this 'Other' segment.

Is it possible to implement this functionality with out writing a complex MDX query?

If not can anybody give me a sample MDX query which implements similar issue(i.e. 'Other-ing' rule.)

For your information, this feature can be implemented using a third pary software such as 'Dundas chart for Reporting Service'.

Hi,

Does anybody has some idea?

--Amde

|||

This is answered here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=638700&SiteID=1&mode=1

-- Robert

'Other' segment in a pie chart

Hello everybody,

I am creating a pie chart report from a cube. This report may contain unknown number of segments. Here is the thing; if more than 1 data slice is generated with a value less than 5% of the total, then a segment labelled 'other' will be generated, and data from all slices with value < 5% will be added to this 'Other' segment.

Is it possible to implement this functionality with out writing a complex MDX query?

If not can anybody give me a sample MDX query which implements similar issue(i.e. 'Other-ing' rule.)

For your information, this feature can be implemented using a third pary software such as 'Dundas chart for Reporting Service'.

Hi,

Does anybody has some idea?

--Amde

|||

This is answered here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=638700&SiteID=1&mode=1

-- Robert

Monday, March 12, 2012

OT: Database Documentation Strategy

I'm creating a new SQL Server 2005 database with about 110 tables, some of
which have dozens of columns. I would like to document this database. What I
mean by that is I want a document that contains at least the following:
1. Each table name, and each column name per table.
2. For each column: data type, length, default value (if any), constraints
3. For each table: primary key column(s), indexes, foreign key constraints.
4. Brief text description of the data stored in the table, and business use
of the data (where not obvious).
Before I go and create an Excel spreadsheet that contains all of the above I
was wanting to know what some of you do. Are you all using Excel for this
sort of thing? Is there something more efficient? If so, what is it or what
do you do or recommend? Can I automate some of this?
FWIW: I'm already documenting the data model (tables and relationships etc)
in a Visio diagram. Now I need to document the table detail.
Thanks!Mark (A@.B.COM) writes:
> I'm creating a new SQL Server 2005 database with about 110 tables, some
> of which have dozens of columns. I would like to document this database.
> What I mean by that is I want a document that contains at least the
> following:
> 1. Each table name, and each column name per table.
> 2. For each column: data type, length, default value (if any), constraints
> 3. For each table: primary key column(s), indexes, foreign key
> constraints.
> 4. Brief text description of the data stored in the table, and business
> use of the data (where not obvious).
> Before I go and create an Excel spreadsheet that contains all of the
> above I was wanting to know what some of you do. Are you all using Excel
> for this sort of thing? Is there something more efficient? If so, what
> is it or what do you do or recommend? Can I automate some of this?
In our shop we use PowerDesigner from Sybase. This is a full-blown
data-modelling tool. The way I use it is that I first define the tables
in PowerDesigner and then generate a script from PowerDesigner that I
then post-process with my own Perl tools to get files formatted and
structuted to my own liking. PowerDesigner permits you to enter comments
for tables and columns. I can also generate reports from the data model,
either in RTF or HTML. What we actually use is the HTML reports, and
to make them a little nicer, I have a post-processing tool here as well.
PowerDesigner permits you to configure the reports, so that you can decide
what goes into it and what does not.
Since you already have the database in place, you may want to avoid to
enter all data manually - stay , you can do reverse engineering. Once
you have the data model in shape, you should start working in the other
direction.
The main competitors to PowerDesigner are ERwin (from Computer Associates)
and Embrocadero. I have not looked very closely on them, but they should
have the same capabilities as PowerDesigner.
All these tools comes with quite a price tag, I should hasten to add.
But a single-user license of PowerDesigner with only Physical Atchitect
is certainly worth the money.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Saturday, February 25, 2012

osql - creating a DB - permission problem.

Hi;
I am trying to create a database from the command line using osql and a .sql
file. If I create the database first in the enterprise manager and then run
it - it works fine. But if the database does not exist I get:
C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
Server\90\Tools\Binn\OS
QL.EXE" -S ARIEL -d WindwardPortal -E -i
\src\RePortal\SqlScripts\SqlServer.sql
Login failed for user 'THIELEN\dave'.
[SQL Native Client]Shared Memory Provider: The system cannot open the file.
[SQL Native Client]Communication link failure
Cannot open database requested in login 'WindwardPortal'. Login fails.
The file SqlServer.sql starts with:
CREATE DATABASE [WindwardPortal]
GO
use [WindwardPortal]
GO
/****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006 2:06:26
PM ******/
CREATE TABLE [dbo].[Datasource] (
[datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
any ideas?
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Since the database has not yet been created. OSQL cannot set the database
context to that database with the "-d WindwardPortal" specification. You
can remove "-d WindwardPortal" since you have a USE following the CREATE
DATABASE.
Hope this helps.
Dan Guzman
SQL Server MVP
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>
|||Hello,
Looks like the path for SQLServer.SQL is wrong. As a first step try login
using OSQL with out giving the database name and script name.
OSQL -S Servername -E
Thanks
Hari
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>

osql - creating a DB - permission problem.

Hi;
I am trying to create a database from the command line using osql and a .sql
file. If I create the database first in the enterprise manager and then run
it - it works fine. But if the database does not exist I get:
C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
Server\90\Tools\Binn\OS
QL.EXE" -S ARIEL -d WindwardPortal -E -i
\src\RePortal\SqlScripts\SqlServer.sql
Login failed for user 'THIELEN\dave'.
[SQL Native Client]Shared Memory Provider: The system cannot open the fi
le.
[SQL Native Client]Communication link failure
Cannot open database requested in login 'WindwardPortal'. Login fails.
The file SqlServer.sql starts with:
CREATE DATABASE [WindwardPortal]
GO
use [WindwardPortal]
GO
/****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
2:06:26
PM ******/
CREATE TABLE [dbo].[Datasource] (
[datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
any ideas?
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmSince the database has not yet been created. OSQL cannot set the database
context to that database with the "-d WindwardPortal" specification. You
can remove "-d WindwardPortal" since you have a USE following the CREATE
DATABASE.
Hope this helps.
Dan Guzman
SQL Server MVP
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/20
06
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>|||Hello,
Looks like the path for SQLServer.SQL is wrong. As a first step try login
using OSQL with out giving the database name and script name.
OSQL -S Servername -E
Thanks
Hari
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/20
06
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>

osql - creating a DB - permission problem.

Hi;
I am trying to create a database from the command line using osql and a .sql
file. If I create the database first in the enterprise manager and then run
it - it works fine. But if the database does not exist I get:
C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
Server\90\Tools\Binn\OS
QL.EXE" -S ARIEL -d WindwardPortal -E -i
\src\RePortal\SqlScripts\SqlServer.sql
Login failed for user 'THIELEN\dave'.
[SQL Native Client]Shared Memory Provider: The system cannot open the file.
[SQL Native Client]Communication link failure
Cannot open database requested in login 'WindwardPortal'. Login fails.
The file SqlServer.sql starts with:
CREATE DATABASE [WindwardPortal]
GO
use [WindwardPortal]
GO
/****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006 2:06:26
PM ******/
CREATE TABLE [dbo].[Datasource] (
[datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
any ideas?
--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htmSince the database has not yet been created. OSQL cannot set the database
context to that database with the "-d WindwardPortal" specification. You
can remove "-d WindwardPortal" since you have a USE following the CREATE
DATABASE.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>|||Hello,
Looks like the path for SQLServer.SQL is wrong. As a first step try login
using OSQL with out giving the database name and script name.
OSQL -S Servername -E
Thanks
Hari
"David Thielen" <thielen@.nospam.nospam> wrote in message
news:1D648FD7-2565-4DFD-B3AF-1867E6B3445C@.microsoft.com...
> Hi;
> I am trying to create a database from the command line using osql and a
> .sql
> file. If I create the database first in the enterprise manager and then
> run
> it - it works fine. But if the database does not exist I get:
> C:\src\RePortal\SqlScripts>"\Program Files\Microsoft SQL
> Server\90\Tools\Binn\OS
> QL.EXE" -S ARIEL -d WindwardPortal -E -i
> \src\RePortal\SqlScripts\SqlServer.sql
> Login failed for user 'THIELEN\dave'.
> [SQL Native Client]Shared Memory Provider: The system cannot open the
> file.
> [SQL Native Client]Communication link failure
> Cannot open database requested in login 'WindwardPortal'. Login fails.
> The file SqlServer.sql starts with:
> CREATE DATABASE [WindwardPortal]
> GO
> use [WindwardPortal]
> GO
> /****** Object: Table [dbo].[Datasource] Script Date: 11/16/2006
> 2:06:26
> PM ******/
> CREATE TABLE [dbo].[Datasource] (
> [datasourceId] [int] IDENTITY (1, 1) NOT NULL ,
> any ideas?
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
> Cubicle Wars - http://www.windwardreports.com/film.htm
>

OSQL

Creating a utility that will allow a user to run a query from a BAT file.
BUT the SQL client is not installed on all PCs. How can I modify this to
run, or what must I do in order for this to work from PCs with no SQL client
'
osql -E -S EXCEDE\EXCEDE -d excede_Reporting -q"EXIT(exec isp_SetCrPw %1)"Hi,
you would probably have to write your own application for this using
e.g. .NET. That should be quite easy, as the only thing would be to
have a argument parser in place, the rest is only some simply
SqlConnection and SqlCommand.
HTH, Jens K. Suessmeyer.
--
http://www.sqlserver2005.de
--|||That would be beyond my current abilities. I can write some very simple
scripts, and I have a mild understanding of some VB and .NET, But to write
my own code. Well I have no idea where to start. If you would like to help
and get me started I would greatly appreciate and enjoy the experience.
Thanks.
==============================================="Jens" <Jens@.sqlserver2005.de> wrote in message
news:1171392808.470036.289720@.j27g2000cwj.googlegroups.com...
> Hi,
> you would probably have to write your own application for this using
> e.g. .NET. That should be quite easy, as the only thing would be to
> have a argument parser in place, the rest is only some simply
> SqlConnection and SqlCommand.
>
> HTH, Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>|||Lets take that offline and write me an Email.|||WANNABE;7269311 Wrote:
> That would be beyond my current abilities. I can write some very
> simple
> scripts, and I have a mild understanding of some VB and .NET, But to
> write
> my own code. Well I have no idea where to start. If you would like to
> help
> and get me started I would greatly appreciate and enjoy the
> experience.
> Thanks.
> ===============================================> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1171392808.470036.289720@.j27g2000cwj.googlegroups.com...
> > Hi,
> >
> > you would probably have to write your own application for this using
> > e.g. .NET. That should be quite easy, as the only thing would be to
> > have a argument parser in place, the rest is only some simply
> > SqlConnection and SqlCommand.
> >
> >
> > HTH, Jens K. Suessmeyer.
> >
> > --
> > http://www.sqlserver2005.de
> > --
> >
I have written an OSQL like replacement in C#/.Net 2.0. I am
having a wee bit of an issue though. If the SQL file to be run
has dynamic SQL in it (building SQL strings and then executing
them) then the command will fail - always. I think it has
something to do with the nesting of the quotes. Got any ideas
on what would be causing something like this?
Thanks
escher4096

OSQL

Creating a utility that will allow a user to run a query from a BAT file.
BUT the SQL client is not installed on all PCs. How can I modify this to
run, or what must I do in order for this to work from PCs with no SQL client
?
osql -E -S EXCEDE\EXCEDE -d excede_Reporting -q"EXIT(exec isp_SetCrPw %1)"
Hi,
you would probably have to write your own application for this using
e.g. .NET. That should be quite easy, as the only thing would be to
have a argument parser in place, the rest is only some simply
SqlConnection and SqlCommand.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||That would be beyond my current abilities. I can write some very simple
scripts, and I have a mild understanding of some VB and .NET, But to write
my own code. Well I have no idea where to start. If you would like to help
and get me started I would greatly appreciate and enjoy the experience.
Thanks.
===============================================
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1171392808.470036.289720@.j27g2000cwj.googlegr oups.com...
> Hi,
> you would probably have to write your own application for this using
> e.g. .NET. That should be quite easy, as the only thing would be to
> have a argument parser in place, the rest is only some simply
> SqlConnection and SqlCommand.
>
> HTH, Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>
|||Lets take that offline and write me an Email.
|||

Quote:

Originally Posted by WANNABEView Post

That would be beyond my current abilities. I can write some very simple
scripts, and I have a mild understanding of some VB and .NET, But to write
my own code. Well I have no idea where to start. If you would like to help
and get me started I would greatly appreciate and enjoy the experience.
Thanks.
===============================================
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1171392808.470036.289720@.j27g2000cwj.googlegr oups.com...
> Hi,
> you would probably have to write your own application for this using
> e.g. .NET. That should be quite easy, as the only thing would be to
> have a argument parser in place, the rest is only some simply
> SqlConnection and SqlCommand.
>
> HTH, Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>

I have written an OSQL like replacement in C#/.Net 2.0. I am
having a wee bit of an issue though. If the SQL file to be run
has dynamic SQL in it (building SQL strings and then executing
them) then the command will fail - always. I think it has
something to do with the nesting of the quotes. Got any ideas
on what would be causing something like this?
Thanks

OSQL

Creating a utility that will allow a user to run a query from a BAT file.
BUT the SQL client is not installed on all PCs. How can I modify this to
run, or what must I do in order for this to work from PCs with no SQL client
'
osql -E -S EXCEDE\EXCEDE -d excede_Reporting -q"EXIT(exec isp_SetCrPw %1)"Hi,
you would probably have to write your own application for this using
e.g. .NET. That should be quite easy, as the only thing would be to
have a argument parser in place, the rest is only some simply
SqlConnection and SqlCommand.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
--|||That would be beyond my current abilities. I can write some very simple
scripts, and I have a mild understanding of some VB and .NET, But to write
my own code. Well I have no idea where to start. If you would like to help
and get me started I would greatly appreciate and enjoy the experience.
Thanks.
========================================
=======
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1171392808.470036.289720@.j27g2000cwj.googlegroups.com...
> Hi,
> you would probably have to write your own application for this using
> e.g. .NET. That should be quite easy, as the only thing would be to
> have a argument parser in place, the rest is only some simply
> SqlConnection and SqlCommand.
>
> HTH, Jens K. Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>|||Lets take that offline and write me an Email.|||WANNABE;7269311 Wrote:[vbcol=seagreen]
> That would be beyond my current abilities. I can write some very
> simple
> scripts, and I have a mild understanding of some VB and .NET, But to
> write
> my own code. Well I have no idea where to start. If you would like to
> help
> and get me started I would greatly appreciate and enjoy the
> experience.
> Thanks.
> ========================================
=======
> "Jens" <Jens@.sqlserver2005.de> wrote in message
> news:1171392808.470036.289720@.j27g2000cwj.googlegroups.com...
I have written an OSQL like replacement in C#/.Net 2.0. I am
having a wee bit of an issue though. If the SQL file to be run
has dynamic SQL in it (building SQL strings and then executing
them) then the command will fail - always. I think it has
something to do with the nesting of the quotes. Got any ideas
on what would be causing something like this?
Thanks
escher4096