2012年3月29日星期四
Display a servers "environment"
server might be part of (e.g. Production, UAT, Development etc).
Instance names already follow a standard naming convention (non descriptive)
so that is not an option.
My ideal solution would be to have a description appear for the server
registration in SSMS or Entman.
e.g.
server1 (SQL Server 8.0.878 - dom1\myuser)
would become...
server1 (SQL Server 8.0.878 PRODUCTION - dom1\myuser)
-
What metadata/ registry entries would I need to change to get this. Would it
cause issues (such as service pack upgrade problems). I would prefer not to
have to resort to putting this in a db/ table since I want the information
visible without having to issue a query.
Many thanks,
Mark.Hi
How does it know whether SQL Server uses PRODUCTION ir DEVELOPMENT?
http://dimantdatabasesolutions.blog...er.ht
ml
"news.microsoft.com" <nospam@.nospam.com> wrote in message
news:OFMENhYNIHA.5140@.TK2MSFTNGP05.phx.gbl...
> Does anyone have any techniques to be able to display what environment a
> server might be part of (e.g. Production, UAT, Development etc).
> Instance names already follow a standard naming convention (non
> descriptive) so that is not an option.
> My ideal solution would be to have a description appear for the server
> registration in SSMS or Entman.
> e.g.
> server1 (SQL Server 8.0.878 - dom1\myuser)
> would become...
> server1 (SQL Server 8.0.878 PRODUCTION - dom1\myuser)
> -
> What metadata/ registry entries would I need to change to get this. Would
> it cause issues (such as service pack upgrade problems). I would prefer
> not to have to resort to putting this in a db/ table since I want the
> information visible without having to issue a query.
> Many thanks,
> Mark.
>|||> My ideal solution would be to have a description appear for the server
> registration in SSMS or Entman.
Both SSMS and Enterprise Manager allow you to to logically group servers.
You might consider creating different groups for PROD, UAT, etc. to
categorize your servers by environment.
Hope this helps.
Dan Guzman
SQL Server MVP
"news.microsoft.com" <nospam@.nospam.com> wrote in message
news:OFMENhYNIHA.5140@.TK2MSFTNGP05.phx.gbl...
> Does anyone have any techniques to be able to display what environment a
> server might be part of (e.g. Production, UAT, Development etc).
> Instance names already follow a standard naming convention (non
> descriptive) so that is not an option.
> My ideal solution would be to have a description appear for the server
> registration in SSMS or Entman.
> e.g.
> server1 (SQL Server 8.0.878 - dom1\myuser)
> would become...
> server1 (SQL Server 8.0.878 PRODUCTION - dom1\myuser)
> -
> What metadata/ registry entries would I need to change to get this. Would
> it cause issues (such as service pack upgrade problems). I would prefer
> not to have to resort to putting this in a db/ table since I want the
> information visible without having to issue a query.
> Many thanks,
> Mark.
>|||those properties just tell me about the installation and are readonly.
I'm looking to add a custom property description that will be displayed at
the server registration.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uUguZuZNIHA.1168@.TK2MSFTNGP02.phx.gbl...
> Hi
> How does it know whether SQL Server uses PRODUCTION ir DEVELOPMENT?
> http://dimantdatabasesolutions.blog...er.
html
> "news.microsoft.com" <nospam@.nospam.com> wrote in message
> news:OFMENhYNIHA.5140@.TK2MSFTNGP05.phx.gbl...
>|||that would only help me (and I dont want to distribute anything).
what I need is for the logical server usage name to be displayed whenever a
developer registers a server.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:5F7B5747-FBF7-44BA-9D5A-5387DCA323CC@.microsoft.com...
> Both SSMS and Enterprise Manager allow you to to logically group servers.
> You might consider creating different groups for PROD, UAT, etc. to
> categorize your servers by environment.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "news.microsoft.com" <nospam@.nospam.com> wrote in message
> news:OFMENhYNIHA.5140@.TK2MSFTNGP05.phx.gbl...
>|||> what I need is for the logical server usage name to be displayed whenever
> a developer registers a server.
I don't have suggestion other than those already mentioned. The Best
Practice is to use mnemonic server/instance names that include the role of
the server but you mentioned that's not an option.
Hope this helps.
Dan Guzman
SQL Server MVP
"news.microsoft.com" <nospam@.nospam.com> wrote in message
news:O9shrmlNIHA.5988@.TK2MSFTNGP02.phx.gbl...
> that would only help me (and I dont want to distribute anything).
> what I need is for the logical server usage name to be displayed whenever
> a developer registers a server.
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:5F7B5747-FBF7-44BA-9D5A-5387DCA323CC@.microsoft.com...
>|||Thanks anyway Dan, always good to know opinions on best practice though.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:C9D2AAAF-D3F1-4293-97FC-951A096736F2@.microsoft.com...
> I don't have suggestion other than those already mentioned. The Best
> Practice is to use mnemonic server/instance names that include the role of
> the server but you mentioned that's not an option.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "news.microsoft.com" <nospam@.nospam.com> wrote in message
> news:O9shrmlNIHA.5988@.TK2MSFTNGP02.phx.gbl...
>
Display a report in fullscreenmode
Hello,
is it possible to open a report in fullscreenmode automatically? Perhaps there might be a http parameter?
Current view:
Now a click on the button on the right side. This is the view i want to see when i open a report.
Did anyone have an idea how i can achieve my goal?
Thanks for your help!
Christian Niehaves
Thanks for your help.
Display a report in a WinForm client
This question has probably been asked many of times and I apologize for
asking again.
What is the best way to display a report in a WinForm client?
Thanks,
YEither embed IE control and use URL integration or use web services. With
Widbey and Yukon MS has announced a winform control but until then you have
to jump through more hoops.
--
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Yoshi" <yoshi@.home.com> wrote in message
news:O0HKyt0xEHA.3840@.tk2msftngp13.phx.gbl...
> Hi everyone!
> This question has probably been asked many of times and I apologize for
> asking again.
> What is the best way to display a report in a WinForm client?
> Thanks,
> Y
>|||Perfecto!
Thanks for the quick response. I think I can handle these hoops.
Y
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:exbA590xEHA.3096@.tk2msftngp13.phx.gbl...
> Either embed IE control and use URL integration or use web services. With
> Widbey and Yukon MS has announced a winform control but until then you
> have
> to jump through more hoops.
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Yoshi" <yoshi@.home.com> wrote in message
> news:O0HKyt0xEHA.3840@.tk2msftngp13.phx.gbl...
>> Hi everyone!
>> This question has probably been asked many of times and I apologize for
>> asking again.
>> What is the best way to display a report in a WinForm client?
>> Thanks,
>> Y
>>
>sql
display a message in store procedure
helo all..., this is my store procedure. but it can not display message. my friend said it must use output code.
can someone add output code to my store procedure, so it can display message?
ALTER PROCEDURE [bank].[dbo].[pay]
(
@.no_billINT,
@.no_orderint,
@.totalcostmoney,
@.messagevarchar(100)-- make it output parameter in your stored procedure
)
ASBEGIN TRANSACTION
DECLARE @.balanceAS money
select @.balance = balance
from bank.dbo.bill
where no_bill = @.no_billselect @.totalcost = totalcost
from games.dbo.totalcost
where no_order = @.no_orderif (@.balance > @.totalcost)
begin
set @.balance = @.balance - @.totalcostUPDATE bank.dbo.bill
SET
[balance] = @.balance
WHERE [no_bill] = @.no_bill-- set @.message = 'your have enough balance'
end
else
begin
set @.message ='sorry, your balance not enough'
endCOMMIT TRANSACTION
set nocount off
pls.., thx
ALTER PROCEDURE [bank].[dbo].[pay]( @.no_billINT, @.no_orderint, @.totalcostmoney, @.messagevarchar(100)OUTPUT-- make it output parameter in your stored procedure)ASBEGIN TRANSACTION DECLARE @.balanceAS moneyselect @.balance = balancefrom bank.dbo.billwhere no_bill = @.no_billselect @.totalcost = totalcostfrom games.dbo.totalcostwhere no_order = @.no_orderif (@.balance > @.totalcost)beginset @.balance = @.balance - @.totalcostUPDATE bank.dbo.billSET [balance] = @.balanceWHERE [no_bill] = @.no_billset @.message ='your have enough balance'endelsebeginset @.message ='sorry, your balance not enough'end|||
yes, thx. but when i execute that procedure, it told to insert no_order, no_bill,totalcost, message. i don't want to insert message, i want to insert no_order,no_bill,totalcost, and click ok, so then message automatic display it..
can u add any code ?
thx...
Using the code posted below, I dont see how it could be wanting to "INSERT" or "UPDATE" message. We are setting the parameter @.message after the update statement is completed.
If you are still getting the error then post the current version of the code you are using.
ALTER PROCEDURE [bank].[dbo].[pay]( @.no_billINT, @.no_orderint, @.totalcostmoney, @.messagevarchar(100)OUTPUT-- make it output parameter in your stored procedure)ASBEGIN TRANSACTION DECLARE @.balanceAS money select @.balance = balancefrom bank.dbo.billwhere no_bill = @.no_billselect @.totalcost = totalcostfrom games.dbo.totalcostwhere no_order = @.no_orderif (@.balance > @.totalcost)begin set @.balance = @.balance - @.totalcostUPDATE bank.dbo.billSET [balance] = @.balanceWHERE [no_bill] = @.no_billset @.message ='your have enough balance'end else begin set @.message ='sorry, your balance not enough'endCOMMIT TRANSACTION|||
yes, your code are right, but when i execute your code, it display:
type direction name value
int in no_bill we insert to this,example:110
int in no_order we insert to this,ex:2
money in totalcost we insert to this, ex 100$
char in/out message ??? if i not insert to this, myerror :Procedure or Function 'pay' expects parameter '@.message', whichwas not supplied.
so i must insert it something, then it can work... but i want to only insert no_bill,no_order,totalcost,so message is display automatic after i insert no_bill,no_order,totalcost.. is there can show automatic message without insert data to message?
thx...
|||
When you define an output parameter in a Stored procedure, you still need to pass a parameter in to the stored procedure. In your case you would pass in an empty string param.
Its not inserting into your DB message it just needs to know what to pass your output param back to.
If you need help with calling the stored procedure, then post that code where you are calling it and we can help you call it properly.
|||thx .., now i want to call that message from pay.aspx. this is my pay.aspx.vb like:
pay.aspx.vb
Protected Sub Button1_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) Handles Button1.Command
Dim sp As String = "pay"
Dim connect As String = ConfigurationManager.AppSettings("ConnectionString")
Dim conn As New SqlConnection(connect)
Dim cm As New SqlCommand(sp, conn)
Dim totalcost As Label = Me.FormView1.FindControl("totallabel")
Dim no As Label = Me.FormView1.FindControl("no_orderlabel")
cm.CommandType = CommandType.StoredProcedure
cm.Parameters.AddWithValue("@.totalcost ", totalcost.Text)
cm.Parameters.AddWithValue("@.no_order ", no.Text)
cm.Parameters.AddWithValue("@.no_bill ", no_bill.Text)
cm.Parameters.AddWithValue("@.message", Label1.Text )
conn.Open()
cm.ExecuteNonQuery() ' do not forget to close Connection
conn.Close()
end sub
that code can work..., but i don't know about to display that message.
if totalcost > balance, show message"sorry, your balance is not enough"
if totalcost<balance, not show message..
pls...
thx...
First change
cm.Parameters.AddWithValue("@.message", Label1.Text )
to
cm.Parameters.Add(New SqlParameter("@.message", SqlDbType.VarChar, 250, ParameterDirection.Output))
Then right after
cm.ExecuteNonQuery() ' do not forget to close Connection
add
Dim message As String - cm.Parameters("@.message").Value
|||thx, it work.. but not display a message.
so i put label1.text in this, but it still no display a message. this is my code:
Protected Sub Button1_Command(ByVal sender As Object, ByVal e AsSystem.Web.UI.WebControls.CommandEventArgs) Handles Button1.Command
Dim sp As String = "pay"
Dim connect As String = ConfigurationManager.AppSettings("ConnectionString")
Dim conn As New SqlConnection(connect)
Dim cm As New SqlCommand(sp, conn)
Dim totalcost As Label = Me.FormView1.FindControl("totallabel")
Dim no As Label = Me.FormView1.FindControl("no_orderlabel")
cm.CommandType = CommandType.StoredProcedure
cm.Parameters.AddWithValue("@.totalcost ", totalcost.Text)
cm.Parameters.AddWithValue("@.no_order ", no.Text)
cm.Parameters.AddWithValue("@.no_bill ", no_bill.Text)
cm.Parameters.Add(New SqlParameter("@.message", SqlDbType.VarChar, 250, ParameterDirection.Output))
conn.Open()
cm.ExecuteNonQuery() ' do not forget to close Connection
Dim message As String - cm.Parameters("@.message").Value
conn.Close()
label1.text= message
end sub
but the label no show message.. how should i do?
thx...
|||have you tried debugging and stepping through the code?
|||yes, i have many try it, but not show a message, maybe i put label1.text in wrong location. can u show that label put in true location?
pls..,thx..
|||other than changing it to
label1.text = message.tostring()
your code looks correct. When you step through it set a breakpoing on "Dim message as string" so when you step on to conn.close() you can see if message has a value.
|||i have use breakpoint at row label1.text, it display value text="". it mean not take message from @.message,so empty..
or maybe my store procedure is wrong?
this is my store procedure
ALTER PROCEDURE [bank].[dbo].[paid]
(
@.no_billINT,
@.no_orderint,
@.totalcostmoney,
@.messagevarchar(100) output="a"
)
ASBEGIN TRANSACTION
DECLARE @.balanceAS money
select @.balance = balance
from bank.dbo.bill
where no_bill = @.no_billselect @.totalcost = totalcost
from games.dbo.totalcost
where no_order = @.no_orderif (@.balance > @.totalcost)
begin
set @.balance = @.balance - @.totalcostUPDATE bank.dbo.bill
SET
[balance] = @.balance
WHERE [no_bill] = @.no_bill-- set @.message = 'your have enough balance'
end
else
begin
set @.message ='sorry, your balance not enough'
endCOMMIT TRANSACTION
but i execute in store procedure, it can display message...
so,which is wrong?
thx
|||
Here is an article for you on another way to define an output parameter.
http://www.sqlservercentral.com/columnists/kKellenberger/usingparameterswithstoredprocedures.asp
Also you have in your stored procedure one line commented out that sets @.message, and your also trying to set a default value using double quotes.
If you want to set a default value for the parameter then set it inside of your begin transaction statement, and also use single quotes in setting it.
Display a KPI need the same Dimension on its Value and Target?
I mean, I have a KPI, it's value is set to a measure of a measuregroup based on a facttable A. and it's Target is set to a measure of another measuregroup based on another facttable B.
Now I want to display the KPI, with a given dimension's slice. My question is, is it needed that the dimension I chose must be shared by both the measures of KPI's Value and Target? For an example, If I dispaly the KPI with the Promotion Dimention, and the Promotion Dimention has a relation to the KPI's Value's related measure(There's a PromotionKey column in facttable A; ), but it has no relation to the KPI's Target's related measure(There's NOT a PromotionKey column in facttable B).
Could I do so?
I think this is SSAS question. I moved it to the SSAS forum...|||
OK.
Help, Help! Thanks.
|||
The KPI should work similarly to the underlying measures - so, in your example, the KPI Target behavior will depend on how the IgnoreUnrelatedDimensions property of the "facttable B" Measure Group is set. If true (default), then the KPI Target should be unaffected by slicing the Promotion dimension; if false, the KPI Target should become null.
http://sqljunkies.com/WebLog/mosha/archive/2005/12/31/cube_init.aspx
>>
Default members, MDX Scripts, Security, KPIs and Perspectives
...
KPI trigger creation of hidden calculated measures only if the MDX expression for the KPI property is not a simple reference to some measure (either calculated or physical). However, if the expression is a simple reference, such as [Measures].[Sales], then no hidden calculated measure will be created, and KPIValue, KPIGoal, KPITrend etc functions will simply return that measure.
>>
http://msdn2.microsoft.com/en-us/library/ms365411.aspx
>>
Configuring Measure Group Properties
...
IgnoreUnrelatedDimensions
Determines whether unrelated dimensions are forced to their top level when members of dimensions that are unrelated to the measure group are included in a query. Default setting is True.
>>
|||Thanks! that's what i am looking for! Thank you, Puri.Display a image based on a value field
I have a problem displaying a picture on a table detail based on a value of
a column.
If this column have a value greather than 10, show a image, else show
another image. I don't know how to call the images on the statement below
=IIf(Fields!DIAS.Value > 10, show_image_1, show_image_2)
I've added the images to the project as a embedded images.
Can anyone please help me or give me an example?
Thanks for Help
BrunoI only know one line of VB code, which is what I use to show/hide
report elements. Maybe you can use it to help you write yours to work
the way it needs to.
=IIF(Parameters!ReportGroup.Value = 1 AND Parameters!ReportType.Value =1, False, True)|||Hi Bruno
I'm only a novice, but this works:
Create two identical table rows, one below the other, each row has one cell
showing the (same) database field - e.g. "ID" and one cell to hold the
appropriate image - row 1 holds image1, row2 holds image2.
Now set the visibility of each row using expressions:
row1: =iif(Fields!ID.value<10,true,false)
row2: =iif(Fields!ID.value>=10,true,false)
when you run the report, the rows will be visible with the appropriate
images appearing as the ID.values change
~grasshopper~
"Bruno" wrote:
> Hello friends
> I have a problem displaying a picture on a table detail based on a value of
> a column.
> If this column have a value greather than 10, show a image, else show
> another image. I don't know how to call the images on the statement below
> =IIf(Fields!DIAS.Value > 10, show_image_1, show_image_2)
> I've added the images to the project as a embedded images.
> Can anyone please help me or give me an example?
> Thanks for Help
> Bruno|||Create an image control on the report, make it show one of the images
you've embedded. In the properties of the image, you should be able to
see how the image is referred to in the "value" property. Now wrap the
=IIf statement around this. The image name will have to be in double
quotes because you are passing a string value to the property. For
example;
=IIf(Fields!DIAS.Value > 10, "Image1.gif", "Image2.gif")
If you wanted to show now image you could do;
=IIf(Fields!DIAS.Value > 10, Nothing, "Image2.bmp")
I haven't tried this but see no reason it shouldn't work for both
RS2000 or RS2005.
Cheers
Chris
Bruno wrote:
> Hello friends
> I have a problem displaying a picture on a table detail based on a
> value of a column.
> If this column have a value greather than 10, show a image, else show
> another image. I don't know how to call the images on the statement
> below
> =IIf(Fields!DIAS.Value > 10, show_image_1, show_image_2)
> I've added the images to the project as a embedded images.
> Can anyone please help me or give me an example?
> Thanks for Help
> Bruno
Display a field onlt up to a Specific Character
Can someone please tell me if there is a function that can be used to print a field only up till a specific character. For ex: I'm trying to print all the student email Id's bu only the characters that fall before the "@." sign.
Thanks
ACleft(x, instr(x, '@.') -1)|||Hello
Thank you sooo much. It worked!!
Thanks again
Aparna