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

Thursday, March 22, 2012

Create a Named Instance on top of a Default Instance

Hi

I've never had to do this, but when I downloaded the Web Workflow Approvals Starter Kit, it requested that I install the database into a User Instance of .\SQLEXPRESS.

Now the problem is, I've installed it onto a default instance, so I was wondering whether you can create a named instance on top of a default instance... and if so, how would you do that?

Cheers

Chris

hi Chris,

you can not create one as you intend, but you can install an additional named instance for that.. or, you can modify the connection strings in the application code to connect to

Data Source=(Local); .....; User Instance=true;

instead of

Data Source=(Local)\SQLExpress; .....; User Instance=true;

regards

|||Hi Andrea

Thanks for the tip... I always wondered what user instances were for...

Now I just have to uninstall & reinstall SQL and enable it.

Cheers

Chris
sql

Create a database login in the default domain

I'm trying to create a login in the default domain. I know I can pull
this information from xp_loginconfig, but don't see how I can use it in
the context of sp_grantlogin.

For example, pull the domain the user is currently logged in on and
insert it into the sp_grantlogin script. Has anyone ever done this in
the past?"Aaron" <aaronakzin@.yahoo.com> wrote in message
news:1104954562.282980.203900@.z14g2000cwz.googlegr oups.com...
> I'm trying to create a login in the default domain. I know I can pull
> this information from xp_loginconfig, but don't see how I can use it in
> the context of sp_grantlogin.
> For example, pull the domain the user is currently logged in on and
> insert it into the sp_grantlogin script. Has anyone ever done this in
> the past?

First of all, I strongly suggest that you consider adding domain accounts to
a domain group, and then just grant login to the group - that's much easier
to manage (and it's the MS recommended way to implement security).

I'm not sure I really understood your question - do you mean that given the
Windows domain account name 'Someone', you want to find the default domain
name from xp_loginconfig (let's call it SOMEDOMAIN), and then grant login to
'SOMEDOMAIN\Someone'? If so, see the (untested) code below.

If I misunderstood you, you might want to give a specific example of what
you're trying to do.

Simon

create proc dbo.GrantLogin
@.Account sysname
as
begin
declare @.Domain sysname,
@.Login sysname

create table #t
(Attrib sysname, Val sysname)

insert into #t exec master..xp_loginconfig

select @.Domain = Val
from #t
where Attrib = 'default domain'

set @.Login = @.Domain + '\' + @.Account

exec sp_grantlogin @.Login
end|||Great, this seems perfect. Thanks for your help.

Tuesday, March 20, 2012

CREATE / EXECUTE Stored Procedure (SQL Server 7.0)

Hi,
I create one stored procedure to return some objects, this procedure accepts
two parameters and this parameters have a default value.
When i execute the procedure with no values the default parameters are used
and every thing goes fine, when i need to input these parameters the
following error appears.
--exec procedure_name db_name, user_name
Error:
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'user_name'.
Can you help me.
Best regardsI guess it should be
exec procedure_name 'db_name', 'user_name'
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:4A3D9388-DB65-4CAA-9F29-13C2D5B735AE@.microsoft.com...
> Hi,
> I create one stored procedure to return some objects, this procedure
> accepts
> two parameters and this parameters have a default value.
> When i execute the procedure with no values the default parameters are
> used
> and every thing goes fine, when i need to input these parameters the
> following error appears.
> --exec procedure_name db_name, user_name
> Error:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'user_name'.
> Can you help me.
> Best regards
>|||If quoting the parameters doesn't fix it, then post the SP source so we can
see.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:4A3D9388-DB65-4CAA-9F29-13C2D5B735AE@.microsoft.com...
> Hi,
> I create one stored procedure to return some objects, this procedure
accepts
> two parameters and this parameters have a default value.
> When i execute the procedure with no values the default parameters are
used
> and every thing goes fine, when i need to input these parameters the
> following error appears.
> --exec procedure_name db_name, user_name
> Error:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'user_name'.
> Can you help me.
> Best regards
>

CREATE / EXECUTE Stored Procedure (SQL Server 7.0)

Hi,
I create one stored procedure to return some objects, this procedure accepts
two parameters and this parameters have a default value.
When i execute the procedure with no values the default parameters are used
and every thing goes fine, when i need to input these parameters the
following error appears.
--exec procedure_name db_name, user_name
Error:
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'user_name'.
Can you help me.
Best regardsI guess it should be
exec procedure_name 'db_name', 'user_name'
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:4A3D9388-DB65-4CAA-9F29-13C2D5B735AE@.microsoft.com...
> Hi,
> I create one stored procedure to return some objects, this procedure
> accepts
> two parameters and this parameters have a default value.
> When i execute the procedure with no values the default parameters are
> used
> and every thing goes fine, when i need to input these parameters the
> following error appears.
> --exec procedure_name db_name, user_name
> Error:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'user_name'.
> Can you help me.
> Best regards
>|||If quoting the parameters doesn't fix it, then post the SP source so we can
see.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:4A3D9388-DB65-4CAA-9F29-13C2D5B735AE@.microsoft.com...
> Hi,
> I create one stored procedure to return some objects, this procedure
accepts
> two parameters and this parameters have a default value.
> When i execute the procedure with no values the default parameters are
used
> and every thing goes fine, when i need to input these parameters the
> following error appears.
> --exec procedure_name db_name, user_name
> Error:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'user_name'.
> Can you help me.
> Best regards
>sql

CREATE / EXECUTE Stored Procedure (SQL Server 7.0)

Hi,
I create one stored procedure to return some objects, this procedure accepts
two parameters and this parameters have a default value.
When i execute the procedure with no values the default parameters are used
and every thing goes fine, when i need to input these parameters the
following error appears.
--exec procedure_name db_name, user_name
Error:
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'user_name'.
Can you help me.
Best regards
I guess it should be
exec procedure_name 'db_name', 'user_name'
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:4A3D9388-DB65-4CAA-9F29-13C2D5B735AE@.microsoft.com...
> Hi,
> I create one stored procedure to return some objects, this procedure
> accepts
> two parameters and this parameters have a default value.
> When i execute the procedure with no values the default parameters are
> used
> and every thing goes fine, when i need to input these parameters the
> following error appears.
> --exec procedure_name db_name, user_name
> Error:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'user_name'.
> Can you help me.
> Best regards
>
|||If quoting the parameters doesn't fix it, then post the SP source so we can
see.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"CC&JM" <CCJM@.discussions.microsoft.com> wrote in message
news:4A3D9388-DB65-4CAA-9F29-13C2D5B735AE@.microsoft.com...
> Hi,
> I create one stored procedure to return some objects, this procedure
accepts
> two parameters and this parameters have a default value.
> When i execute the procedure with no values the default parameters are
used
> and every thing goes fine, when i need to input these parameters the
> following error appears.
> --exec procedure_name db_name, user_name
> Error:
> Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'user_name'.
> Can you help me.
> Best regards
>

Sunday, March 11, 2012

CR10 RDC Default Printer Issue

Hi All,

I'm glad to have found this forum! I've slogged thru Crystal issues on my own for quite a while now and it's a relief to have a place to go to share information. I have a few questions today, so please bare with me.

I'm converting an ASP application from CR8 to CR10 CE Embedded. For the most part I'm using RAS to display and print reports. I have a couple of reports where the users send the reports directly to the printer without viewing them first.

First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.

I'm experimenting with RDC in ASP and I'm having an issue with the default printer.

Second question, how do you set the printer using RDC? I'm using the following code:

Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")

Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")

session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false

The report keeps printing to the default printer, no matter what I'm setting it to programmatically. I thought maybe it had to do with the printer selected in the Report Designer, so I set that to "No Printer", and that didn't help.

I popped the oRpt object into the debug watch window and observed that the SelectPrinter method did not change the properties in oRpt. Hmmmm! Not sure what is going on there.

Third question, is there a good resource somewhere for learning the RDC and RAS object models? I can see the properties in a debug window, but I have not found good documentation on the methods. I have found that Business Objects has not improved the product documentation since they took over. It would really be nice to find a clear, concise reference of the object models.

Thanks!

LindaSecond question, how do you set the printer using RDC? I'm using the following code:

Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")

Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")

session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false

I was able to figure this out on my own and am posting the solution in case somebody else is in the same boat. I had an error in the DeviceName and Port parameters. SelectPrinter must do validation before applying the parameters supplied. If the parameters are incorrect SelectPrinter does not change the printer settings. Perhaps there is a property in the RDC to trigger an error if this happens.........it certainly would have been useful to me!

I would still like to hear if anyone knows how to send a report directly to the printer using RAS, or if anyone has come across some good documentation of the RAS and RDC API's.

Thanks!

Linda|||First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.

VICTORY!!!! Just for the record, I was told months ago by Business Objects that this was impossible. I came across a white paper today, on the Business Objects site, that discusses RAS Server-Server Side printing, and gives you the code sample as well. Here it is:

http://www.buisnessobjects.com/global/pdf/dev_zone/ras_serverside_printing.pdf?ref=devzone_netzone_archive

Linda