Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Wednesday, March 28, 2012

How to remove default schema?

Hi,

Re: sql server 2005

I recently migrated a database from one server to another. In the process of doing this, I renamed one of the sql server 2000 migrated logins to a new name, using "alter login with name" and "alter user with name"

Now, I'm having problems with permissions. This user cannot execute sp_send_dbmail, even though it has explicit execute permissions on this stored proc in the msdb database.

What I noticed about this user is that is carried over a default schema from the old 2000 server. I'm beginning to think that this has something to do with the lost permissions. So I tried to drop the default schema. No dice. Next, I set the default schema to dbo. That still didn't work.

Can someone please tell me how to drop a default schema for a user? I've tried everything I can think of, from removing the schema name from the properties windows, to "alter user". Nothing has worked.

Thanks

You cannot remove, you can just change the default schema.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Thanks. Yes, I gathered as much.

I realize that the problem with sp_send_dbmail didn't have anything to do with the default schema. It had to do with the fact that the login wasn't mapped to the msdb database, even though it existed as a user in the msdb database. (long story)

Dropping the user, then remapping the login to the user solved the problem.

However, some of the migrated users do NOT have a default schema assigned to them. How is this possible?

All of the other migrated users DID have a default schema, i.e.) the user name = default schema name.

Monday, March 26, 2012

How to remove a database without deleting the mdf file ?

I have both sql 2005 express and developer edition installed.
If I have attached a mdf file to my local sql server default instance, how can I remove that database from this instance without deleting the underlying mdf file ? I have attached an mdf file under sql 2005 (dev edition) default instance, but now I want to detach it and reattach it under my sql 2005 express named instance. Why is there not a "detach" menu option ?

help ?for some strange reason, a "detach" menu option is there when I select the database node in the left panel of mgt studio, then right-click the db and choose tasks > detach.

Oh wait, its there under the right-click menu in the left pane as well. disregard everything i just said

Monday, March 19, 2012

How to redirect report to a frame?

Hi,
I've a web application. The default page consists of
three frames. 'List bar frame', 'Banner frame' and 'Main
frame'. Reports are displayed on this 'Main frame'.
I've a report which has got a column which is linked to
another report. I want the second report to be displayed
in the same frme ('Main frame'). Right now while
clicking the link column, report is displayed in the
parent frame, there by I'm loosing list bar and banner in
the application. How do I do this?
thanks,
DeeWhen you access the parent report in your frame, add the URL access
parameter rc:LinkTarget=framename. This will target all of the hyperlinks in
the report. You can also do stuff like rc:LinkTarget=_blank to open in a new
window.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Deepak" <deee@.discussions.microsoft.com> wrote in message
news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
> Hi,
> I've a web application. The default page consists of
> three frames. 'List bar frame', 'Banner frame' and 'Main
> frame'. Reports are displayed on this 'Main frame'.
> I've a report which has got a column which is linked to
> another report. I want the second report to be displayed
> in the same frme ('Main frame'). Right now while
> clicking the link column, report is displayed in the
> parent frame, there by I'm loosing list bar and banner in
> the application. How do I do this?
> thanks,
> Dee|||After giving rc:LinkTarget=framename, second report is
opening in a new window. Not in the given frame. I'm
using Jump to report method for calling 2nd report.
thanks,
Deee
>--Original Message--
>When you access the parent report in your frame, add the
URL access
>parameter rc:LinkTarget=framename. This will target all
of the hyperlinks in
>the report. You can also do stuff like
rc:LinkTarget=_blank to open in a new
>window.
>--
>Bryan Keller
>Developer Documentation
>SQL Server Reporting Services
>A friendly reminder that this posting is provided "AS
IS" with no
>warranties, and confers no rights.
>
>"Deepak" <deee@.discussions.microsoft.com> wrote in
message
>news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
>> Hi,
>> I've a web application. The default page consists of
>> three frames. 'List bar frame', 'Banner frame'
and 'Main
>> frame'. Reports are displayed on this 'Main frame'.
>> I've a report which has got a column which is linked to
>> another report. I want the second report to be
displayed
>> in the same frme ('Main frame'). Right now while
>> clicking the link column, report is displayed in the
>> parent frame, there by I'm loosing list bar and banner
in
>> the application. How do I do this?
>> thanks,
>> Dee
>
>.
>|||You will need to use jump to URL action and build the URL as an expression,
adding rc:LinkTarget. I know it is not ideal, but it is the suggested
workaround for your scenario.
--
Bryan Keller
Developer Documentation
SQL Server Reporting Services
A friendly reminder that this posting is provided "AS IS" with no
warranties, and confers no rights.
"Deepak" <dee@.discussions.microsoft.com> wrote in message
news:05b901c46e31$d7519f40$a501280a@.phx.gbl...
> After giving rc:LinkTarget=framename, second report is
> opening in a new window. Not in the given frame. I'm
> using Jump to report method for calling 2nd report.
> thanks,
> Deee
> >--Original Message--
> >When you access the parent report in your frame, add the
> URL access
> >parameter rc:LinkTarget=framename. This will target all
> of the hyperlinks in
> >the report. You can also do stuff like
> rc:LinkTarget=_blank to open in a new
> >window.
> >
> >--
> >Bryan Keller
> >Developer Documentation
> >SQL Server Reporting Services
> >
> >A friendly reminder that this posting is provided "AS
> IS" with no
> >warranties, and confers no rights.
> >
> >
> >"Deepak" <deee@.discussions.microsoft.com> wrote in
> message
> >news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
> >> Hi,
> >>
> >> I've a web application. The default page consists of
> >> three frames. 'List bar frame', 'Banner frame'
> and 'Main
> >> frame'. Reports are displayed on this 'Main frame'.
> >> I've a report which has got a column which is linked to
> >> another report. I want the second report to be
> displayed
> >> in the same frme ('Main frame'). Right now while
> >> clicking the link column, report is displayed in the
> >> parent frame, there by I'm loosing list bar and banner
> in
> >> the application. How do I do this?
> >>
> >> thanks,
> >>
> >> Dee
> >
> >
> >.
> >|||It's working. thank you very much.
>--Original Message--
>You will need to use jump to URL action and build the
URL as an expression,
>adding rc:LinkTarget. I know it is not ideal, but it is
the suggested
>workaround for your scenario.
>--
>Bryan Keller
>Developer Documentation
>SQL Server Reporting Services
>A friendly reminder that this posting is provided "AS
IS" with no
>warranties, and confers no rights.
>
>"Deepak" <dee@.discussions.microsoft.com> wrote in message
>news:05b901c46e31$d7519f40$a501280a@.phx.gbl...
>> After giving rc:LinkTarget=framename, second report is
>> opening in a new window. Not in the given frame. I'm
>> using Jump to report method for calling 2nd report.
>> thanks,
>> Deee
>> >--Original Message--
>> >When you access the parent report in your frame, add
the
>> URL access
>> >parameter rc:LinkTarget=framename. This will target
all
>> of the hyperlinks in
>> >the report. You can also do stuff like
>> rc:LinkTarget=_blank to open in a new
>> >window.
>> >
>> >--
>> >Bryan Keller
>> >Developer Documentation
>> >SQL Server Reporting Services
>> >
>> >A friendly reminder that this posting is provided "AS
>> IS" with no
>> >warranties, and confers no rights.
>> >
>> >
>> >"Deepak" <deee@.discussions.microsoft.com> wrote in
>> message
>> >news:02e201c46d7c$f84dff50$a501280a@.phx.gbl...
>> >> Hi,
>> >>
>> >> I've a web application. The default page consists
of
>> >> three frames. 'List bar frame', 'Banner frame'
>> and 'Main
>> >> frame'. Reports are displayed on this 'Main frame'.
>> >> I've a report which has got a column which is
linked to
>> >> another report. I want the second report to be
>> displayed
>> >> in the same frme ('Main frame'). Right now while
>> >> clicking the link column, report is displayed in
the
>> >> parent frame, there by I'm loosing list bar and
banner
>> in
>> >> the application. How do I do this?
>> >>
>> >> thanks,
>> >>
>> >> Dee
>> >
>> >
>> >.
>> >
>
>.
>

Friday, February 24, 2012

How to query?

In the following query, @.CusVenRefLike is a string entered by user, it is by default equal to '%' so that the query return all string when user enter nothing.

SELECT Voucher.VoucherID, Voucher.VoucherRef, Customer.CustomerRef
FROM Voucher
LEFT Join Customer on Voucher.CustomerID=Customer.CustomerID
WHERE Customer.CustomerRef LIKE @.CusVenRefLike

I find that the resulting dataset contain ONLY rows that Voucher.CustomerID<>-1. The reason is that when Voucher.CustomerID= -1, Customer.CustomerRef=NULL which is not included in Customer.CustomerRef LIKE '%' filter.

How can I include those row with Voucher.CustomerID=-1?

Thanks

You need to add additional constraints to your query, depending on exactly how you want it to work.

A simple approach is to use Coalesce(CustomerRef, '' ) to force the null into an empty string. This allows the match to procede. In fact, if there is no special meaning to the CustomerRef being NULL you might want to add a default to the column.

If you want to include nulls in any search, then add Or CustomerRef Is Null to the Where clause. You could also add Or (CustomerRef Is Null and @.CusVenRefLike = '%').

|||

SELECT Voucher.VoucherID, Voucher.VoucherRef, Customer.CustomerRef
FROM Voucher
LEFT Join Customer on Voucher.CustomerID=Customer.CustomerID
WHERE Customer.CustomerRef LIKE @.CusVenRefLike

or Customer.CustomerRef is null

|||

Can do it as this as well..

SELECT Voucher.VoucherID, Voucher.VoucherRef, Customer.CustomerRef
FROM Voucher
LEFT Join Customer on Voucher.CustomerID=Customer.CustomerID
WHERE isnull(Customer.CustomerRef ,'') LIKE @.CusVenRefLike