Showing posts with label case. Show all posts
Showing posts with label case. Show all posts

Thursday, March 8, 2012

Create new login non case sensitive

I am trying to create a new login on a database, and I want that username and password NOT to be case sensitive. Do I have to set this at the server level or can I set this in the SQL script?

Here is the script I am currently using...

IF EXISTS (SELECT * FROM dbo.sysusers WHERE [name] = 'UName')

BEGIN

EXEC sp_dropuser 'UserName'

EXEC sp_droplogin 'UserName'

END

EXEC sp_addlogin 'UserName', 'Password', 'Database'

GO

EXEC sp_adduser 'UserName', 'Password', 'db_datareader'

GO

Any help would be appreciated...

David

SQL Server 2005 only uses case sensitive password, this is an intentional behavior change for SQL Server 2005.See http://msdn2.microsoft.com/en-us/library/ms143359.aspx for more details.

Thanks,

-Raul Garcia

SDE/T

SQL Server Engine

|||

Also, the sp_adduser statement is incorrect - there is no password for users; the second parameter of sp_adduser is the user's name in the database. See http://msdn2.microsoft.com/en-us/library/ms181422.aspx for more information on sp_adduser.

Thanks
Laurentiu

Wednesday, March 7, 2012

Create NamedCalculation in DSV based on other NamedCalculation

Dear Friends,

How can I create a namedcalculation based on another named calculation?

The first named calculatoion has in expression textarea:

CASE
WHEN [D_INST_TIPO_ID]=1 THEN
CASE
WHEN [Price/NPV] = 0 THEN [Avg Flash]
ELSE [Price/NPV]
END
END

And I need to create a second named calculation based on the first!!

If it's not possible, can I set the expression of first named calculation to a variable? To use only one named calculation? example:

xx=(CASE
WHEN [D_INST_TIPO_ID]=1 THEN
CASE
WHEN [Price/NPV] = 0 THEN [Avg Flash]
ELSE [Price/NPV]
END
END)

xx/(Field3)+(Field4)*(Field5)

?

Thanks!!

I don't believe this is possible. You may need to repeat the first calculation in the context of the second one.|||Someone knows any solution?|||

Hi,

you can't use a named calculation inside another.

If you have formulae that are going to be used one inside another,

then you can use 'calculated measures'.

These are created from the 'calculation' tab of the BI studio.

and they are evaluated at run time.

Check this link for more details of creating calculations,

http://msdn2.microsoft.com/en-us/library/ms181224.aspx

if you have specific reasons not to use this,

then you have to expand all your formulae to the lowest level.

That is to elements that are already avaliable in the dsv table.

Regards

Vijay R

Sunday, February 19, 2012

Create Dynamic Report

Mr. Babu,

How can I manipulate the query from VB depending on the input entered by the user. In this case I can make one report only and modify the query and pass it to the report.
Otherwise for each user input I will have call a different report.
If possible do send me an example.

Thanks,

SatishHave you try to pass parameters to your report?|||I have tried parameters and it works, but I would like to chang the sql
i.e. select * from .... where empno= variable

regards,
Satish|||This may be more trouble than it's worth...

You could change your report so that VB does all the database queries and passes a recordset to your report.

Example 1:

Dim CrApp1 As New CRPEAuto.Application
Dim CrRep As CRPEAuto.Report
Dim CrDB As CRPEAuto.Database
Dim CrTables As CRPEAuto.DatabaseTables
Dim CrTable As CRPEAuto.DatabaseTable

'open report
Set CrRep = CrApp1.OpenReport("C:\Report.rpt")

'set the database object to the reports database
Set CrDB = CrRep.Database

'Set the databasetables object
Set CrTables = CrDB.Tables

'set the databasetable object to the first table in the report
Set CrTable = CrTables(1)

'sets ADO recordset as the data for the first table
CrTable.SetPrivateData 3, rsData

'preview the report with the ADO recordset as the data
CrRep.Preview

Example 2 (uses RDC, which I like better):

Dim Report As New CrystalReport1

Report.Database.SetDataSource rsData, 3, 1

CRViewer1.ReportSource = Report
CRViewer1.ViewReport

In Example 2, CrystalReport1 is the dsr file created by clicking 'Project', 'Add Crystal Report 8.5' in the VB IDE. CRViewer1 is the Crystal Report Viewer component.

Both of these examples were created using CR 8.5 and VB 6.|||This is in reference to your reply.

In Example 2, CrystalReport1 is the dsr file created by clicking 'Project', 'Add Crystal Report 8.5' in the VB IDE.

When I click Project, I cannot see "Add Crystal Report 8.5".
How do I get it.

Regards,
Satish|||I am not getting CRPEAuto method. What reference has to be made.

what does crpeauto stand for?|||My References for the 'CRPEAuto' Method says 'Crystal Report Engine 8 Object Library'

As for the 'Add Crystal Report 8.5', do you have Crystal Reports Developer Edition installed on your development machine? If so, what version? I think RDC was made avaiable in either version 8 or 8.5 and higher.

You can try to do a search on Crystal's website:
http://support.businessobjects.com/search/advsearch.asp|||how do I get the reference to "'Crystal Report Engine 8 Object Library'" in my computer.|||I'm using version 8.5 Developer Edition. When I installed it, it placed all the necessary dlls on my comuter for me.

Click 'Project', 'References', and check 'Crystal Report Engine 8 Object Library'