Thursday, March 29, 2012

Getting a parameter to depend on another parameter.

I'm putting together a crosstab showing some facts for a year, compared to the year before (so we're showing 2 years). Years in the columns and a dimension in the rows. Nothing fancy, but we do want to put in a parameter so the users can choose which year they want to see. So I put a range and get two parameters. We now want the first parameter, the "from", to take the value of the "to" - 1. I can get the same value in there, but appearantly getting the previous year isn't as simple as just taking the parameter - 1.
A helping hand would be great. This all seems a bit overkill for what to me feels like an easy report, so I feel like I'm missing something.

We're building this report on a cube.

Hi,

In the Report Parameters dialog, set the Default value of your second parameter to Non Queried and enter the following in the Expression Editor

Code Snippet

=CINT(Parameters!<Param1>.Value) - 1

Replace with the name of your parameter and this should achieve what you want to do.

HTH.

Cheers,

Leigh

|||That gives me an error while previewing. More precisely, when I select the "to" in preview, I get:

Code Snippet

An error occured during local report processing.
Error during processing of of "FromYear" report parameter.

Can it be because the first (to) depends on a time dimension?

Getting a Package's ExecutionID

Hello everyone

I'm logging the execution of my package into a SQL SERVER table. Everything works right. I'm also executing this package using a web service, I'd like to retrive the package's executionId after it is executed. By the way, i'm using a Microsft.SqlServer.Dts.Runtime.Package object but i haven't found any property that could give this.

any clue?

thanks a lotHave you searched this forum for executionID? There has been many threads around this topic and the current version of SSIS' shortcomings with respect to logging the execution ID.|||There is a system variable ExecutionId. Try that for now, not sure if the value is available post execution, but would seem sensible.|||I mean there is a system variable called ExecutionInstanceGUID which is the same value as you get logged in the sysdtslog90 table.

Getting a Major error.....

When i try to launch SQL 2005, I'm all of a sudden getting the following error:
"SqlWb.exe - Application Error
The application failed to initialize properly (0xc0000034). Click on OK to
terminate the application."
Any suggestions or recommendations? Tried to search the knowledgebase, but,
couldn't find anything.
Thanks.
JJ
Maybe I am wrong but looks like SqlWb is Management Studio so perhaps SQL
Server is really running. Try connecting from another client like Query
Analyzer to see if the instance is running.
With no additional information perhaps what I would try is rebooting the
computer and, if the problem is still there, reinstalling the client tools.
Regards,
Ben Nevarez
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:658463FC-52F7-493E-9FF7-7DA363D12681@.microsoft.com...
> When i try to launch SQL 2005, I'm all of a sudden getting the following
> error:
> "SqlWb.exe - Application Error
> The application failed to initialize properly (0xc0000034). Click on OK to
> terminate the application."
> Any suggestions or recommendations? Tried to search the knowledgebase,
> but,
> couldn't find anything.
> Thanks.
> --
> JJ

Getting a Major error.....

When i try to launch SQL 2005, I'm all of a sudden getting the following error:
"SqlWb.exe - Application Error
The application failed to initialize properly (0xc0000034). Click on OK to
terminate the application."
Any suggestions or recommendations? Tried to search the knowledgebase, but,
couldn't find anything.
Thanks.
--
JJMaybe I am wrong but looks like SqlWb is Management Studio so perhaps SQL
Server is really running. Try connecting from another client like Query
Analyzer to see if the instance is running.
With no additional information perhaps what I would try is rebooting the
computer and, if the problem is still there, reinstalling the client tools.
Regards,
Ben Nevarez
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:658463FC-52F7-493E-9FF7-7DA363D12681@.microsoft.com...
> When i try to launch SQL 2005, I'm all of a sudden getting the following
> error:
> "SqlWb.exe - Application Error
> The application failed to initialize properly (0xc0000034). Click on OK to
> terminate the application."
> Any suggestions or recommendations? Tried to search the knowledgebase,
> but,
> couldn't find anything.
> Thanks.
> --
> JJ

Getting a Major error.....

When i try to launch SQL 2005, I'm all of a sudden getting the following err
or:
"SqlWb.exe - Application Error
The application failed to initialize properly (0xc0000034). Click on OK to
terminate the application."
Any suggestions or recommendations? Tried to search the knowledgebase, but,
couldn't find anything.
Thanks.
JJMaybe I am wrong but looks like SqlWb is Management Studio so perhaps SQL
Server is really running. Try connecting from another client like Query
Analyzer to see if the instance is running.
With no additional information perhaps what I would try is rebooting the
computer and, if the problem is still there, reinstalling the client tools.
Regards,
Ben Nevarez
"Jeff" <Jeff@.discussions.microsoft.com> wrote in message
news:658463FC-52F7-493E-9FF7-7DA363D12681@.microsoft.com...
> When i try to launch SQL 2005, I'm all of a sudden getting the following
> error:
> "SqlWb.exe - Application Error
> The application failed to initialize properly (0xc0000034). Click on OK to
> terminate the application."
> Any suggestions or recommendations? Tried to search the knowledgebase,
> but,
> couldn't find anything.
> Thanks.
> --
> JJsql

getting a list of user created tables ONLY

sql server 2k
I am aware of SELECT * FROM INFORMATION_SCHEMA.TABLES ad sp_help, but in
each case I also get a table called dtproperties and, in neither case, is
there a logical way to tell one apart. I am also adverse to using
undocumented system tables seeing as sql server 2005 is just around the
corner and upgrading is more than likely... and its a bad idea.
I am currently using the following. Isn't there a more built in way to do
this?
SELECT TABLE_SCHEMA + '.' + TABLE_NAME AS USERTABLE
FROM INFORMATION_SCHEMA.TABLES
WHERE table_type = 'base table' AND TABLE_NAME <> 'dtproperties'Here's one way...
--Get all the dbo-owned Tables together and exclude system, view, and tables
begining with 'ARCH_' (Archive tables)
Create table #IntermediateTableList
(Table_Qualfier varchar(100),
Table_Owner varchar(100),
Table_Name varchar(100),
Table_Type varchar(100),
Remarks varchar(100),
Table_Count numeric(9))
--Create table #IntermediateTableList (Table_Name varchar(100), Table_Count
numeric(9))
Insert into #IntermediateTableList (Table_Qualfier, Table_Owner, Table_Name,
Table_Type, Remarks) Execute sp_Tables
--Exclude non-dbo-owned tables, system tables, views, and tables begining
with 'ARCH_' (Archive tables)
Select Table_Name, Table_Count into #FinalizedTableList from
#IntermediateTableList where (Table_Type <> 'system table' and Table_Type <>
'view' and Table_Name NOT LIKE 'ARCH_%' and TABLE_OWNER = 'dbo')
"kevin" wrote:

> sql server 2k
> I am aware of SELECT * FROM INFORMATION_SCHEMA.TABLES ad sp_help, but in
> each case I also get a table called dtproperties and, in neither case, is
> there a logical way to tell one apart. I am also adverse to using
> undocumented system tables seeing as sql server 2005 is just around the
> corner and upgrading is more than likely... and its a bad idea.
> I am currently using the following. Isn't there a more built in way to do
> this?
> SELECT TABLE_SCHEMA + '.' + TABLE_NAME AS USERTABLE
> FROM INFORMATION_SCHEMA.TABLES
> WHERE table_type = 'base table' AND TABLE_NAME <> 'dtproperties'|||See view information_schema.tables and function objectproperty.
Example:
use northwind
go
select
*
from
information_schema.tables
where
table_type = 'base table'
and objectproperty(object_id(quotename(table
_schema) + '.' +
quotename(table_name)), 'IsUserTable') = 1
and objectproperty(object_id(quotename(table
_schema) + '.' +
quotename(table_name)), 'IsMSShipped') = 0
go
AMB
"kevin" wrote:

> sql server 2k
> I am aware of SELECT * FROM INFORMATION_SCHEMA.TABLES ad sp_help, but in
> each case I also get a table called dtproperties and, in neither case, is
> there a logical way to tell one apart. I am also adverse to using
> undocumented system tables seeing as sql server 2005 is just around the
> corner and upgrading is more than likely... and its a bad idea.
> I am currently using the following. Isn't there a more built in way to do
> this?
> SELECT TABLE_SCHEMA + '.' + TABLE_NAME AS USERTABLE
> FROM INFORMATION_SCHEMA.TABLES
> WHERE table_type = 'base table' AND TABLE_NAME <> 'dtproperties'|||Thanks to the two of you.
Alejandro, that was the ticket. Gracias!!
"Alejandro Mesa" wrote:
> See view information_schema.tables and function objectproperty.
> Example:
> use northwind
> go
> select
> *
> from
> information_schema.tables
> where
> table_type = 'base table'
> and objectproperty(object_id(quotename(table
_schema) + '.' +
> quotename(table_name)), 'IsUserTable') = 1
> and objectproperty(object_id(quotename(table
_schema) + '.' +
> quotename(table_name)), 'IsMSShipped') = 0
> go
>
> AMB
> "kevin" wrote:
>

Getting a list of user access to which databases - help

Hi ,
i know there's a view "sxyslogin" in Master database that is able to show a
list of user with the default database that they have access to
however , i like to get a list of users with all the databases that they are
able to access, how can i do that with the rights that they have in these
databases as well ?
for example userA has access to DB1 , DB4 , DB5 , i need to show that userA
has the access to these users
appreciate any advise
tks & rdgs
Hi,
Execute the system procedure sp_helplogin to get all the users with
associated access to databases.
For displaying object level previlages for the user , execute sp_helprotect.
See the reference of both procedures in books online.
Thanks
Hari
SQL Server MVP
"maxzsim" <maxzsim@.discussions.microsoft.com> wrote in message
news:455416BC-1ED3-4F69-B9DB-E17A078A7C79@.microsoft.com...
> Hi ,
> i know there's a view "sxyslogin" in Master database that is able to show
a
> list of user with the default database that they have access to
> however , i like to get a list of users with all the databases that they
are
> able to access, how can i do that with the rights that they have in these
> databases as well ?
> for example userA has access to DB1 , DB4 , DB5 , i need to show that
userA
> has the access to these users
> appreciate any advise
> tks & rdgs
|||You can check the stored procedure sp_helplogins
best Regards,
Chandra
http://chanduas.blogspot.com/
"maxzsim" wrote:

> Hi ,
> i know there's a view "sxyslogin" in Master database that is able to show a
> list of user with the default database that they have access to
> however , i like to get a list of users with all the databases that they are
> able to access, how can i do that with the rights that they have in these
> databases as well ?
> for example userA has access to DB1 , DB4 , DB5 , i need to show that userA
> has the access to these users
> appreciate any advise
> tks & rdgs
|||Here you go this query will match up the sysdatabases which is the list of
databases you need with the sysusers information which will give you a
results set of databases and the user for that database. Then if you want to
go a little further and match that sid with sysxlogins if you need some
information from there. The in clause makes it where you dont have to see
all the user information for sql internal usage.
Hope this helps.
Select a.name,
b.[name],
b.[UID],
b.[SID],
b.[ISSQLROLE],
CASE WHEN b.[ISSQLUSER] = 1
THEN 1
ELSE 0
END AS issqluser
from [master].[dbo].[sysdatabases] a ,
[master].[dbo].[sysusers] b
WHERE b.[name] NOT IN (
'public',
'db_owner',
'db_accessadmin',
'db_securityadmin',
'db_ddladmin',
'db_backupoperator',
'db_datareader',
'db_datawriter',
'db_denydatareader',
'db_denydatawriter',
'dbo',
'guest',
'INFORMATION_SCHEMA',
'system_function_schema'
)
"maxzsim" wrote:

> Hi ,
> i know there's a view "sxyslogin" in Master database that is able to show a
> list of user with the default database that they have access to
> however , i like to get a list of users with all the databases that they are
> able to access, how can i do that with the rights that they have in these
> databases as well ?
> for example userA has access to DB1 , DB4 , DB5 , i need to show that userA
> has the access to these users
> appreciate any advise
> tks & rdgs