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

Friday, March 30, 2012

How to get the value of a parameter programmatically

Hi,,
Say I have connected to the webs ervice and extracted all the parameters of
a particular report ,,how can I show the default bvalue of those parameter
if any'
thanks for your help,,here is my code:
ReportingService rs = new ReportingService(enviromental_Vars.LocalPath);
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
//string report = this.cmbReports.Items[this.cmbReports.SelectedIndex].ToString();
bool forRendering = false;
string historyID = null;
ParameterValue[] values = null;
DataSourceCredentials[] credentials = null;
ReportParameter[] parameters = null;
try
{
parameters = rs.GetReportParameters(enviromental_Vars.ReportName, historyID,
forRendering, values, credentials);
if (parameters != null)
{
}
}There is a property on the ReportParameter class with the name of
DefaultValues, and of type string[].
You could use something along the lines of:
foreach(ReportParameter p in parameters)
{
string[] defaults = p.DefaultValues;
// work on defaults...
}
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 12 Nov 2004 19:12:19 -0800, "ALI-R" <newbie@.microsoft.com>
wrote:
>Hi,,
>Say I have connected to the webs ervice and extracted all the parameters of
>a particular report ,,how can I show the default bvalue of those parameter
>if any'
>thanks for your help,,here is my code:
>ReportingService rs = new ReportingService(enviromental_Vars.LocalPath);
>rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
>//string report =>this.cmbReports.Items[this.cmbReports.SelectedIndex].ToString();
>bool forRendering = false;
>string historyID = null;
>ParameterValue[] values = null;
>DataSourceCredentials[] credentials = null;
>ReportParameter[] parameters = null;
>try
>{
>parameters = rs.GetReportParameters(enviromental_Vars.ReportName, historyID,
>forRendering, values, credentials);
>if (parameters != null)
>{
>
>}
>}
>

Friday, March 23, 2012

how to get the Default SA Account Password and How to change it in Sql 2000 Personal Editi

hi, all:

I installed a Sql 2000 Personal Edition in my Laptop,now I want to change my Sql 2000 sa account password.

but I can not find where I can get the default password for sa account and how to change it .

thanks

Password for SA is not set during installation but you can create one by going to the Security section of Enterprise manager. Hope this helps.

how to get the default DATEFORMAT?

Hello,
Can someone tell me how to get the default dateformat for a sql server?
The reason is that I have a stored proceure used to work fine, but it
stopped working this morning.
I checked and found out that if I use US dateformat then it will be fine. I
do want to find out the default dateformat for the server and possibly when
it get changed since it was OK.
hello, please helpALWAYS use YYYYMMDD rather than any regional or language specific date
format. Then you don't have to worry about DATEFORMAT at all, since humans
and software can not misinterpret it no matter what.
You can check using DBCC USEROPTIONS but this is user- or session-specific
information, and can be overriden by any user as they are connected.
A
"jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
news:6482818F-CF80-4187-A179-7C14D39A561F@.microsoft.com...
> Hello,
> Can someone tell me how to get the default dateformat for a sql server?
> The reason is that I have a stored proceure used to work fine, but it
> stopped working this morning.
> I checked and found out that if I use US dateformat then it will be fine.
> I
> do want to find out the default dateformat for the server and possibly
> when
> it get changed since it was OK.
> --
> hello, please help|||Hi,
Can you tell me how to set and get the dateformat for a sql server? I
checked the regional setting for windows and it is set to UK, not US.
Thanks
--
hello, please help
"Aaron Bertrand [SQL Server MVP]" wrote:

> ALWAYS use YYYYMMDD rather than any regional or language specific date
> format. Then you don't have to worry about DATEFORMAT at all, since human
s
> and software can not misinterpret it no matter what.
> You can check using DBCC USEROPTIONS but this is user- or session-specific
> information, and can be overriden by any user as they are connected.
> A
>
>
> "jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
> news:6482818F-CF80-4187-A179-7C14D39A561F@.microsoft.com...
>
>|||To set it:
SET DATEFORMAT dmy
or
SET DATEFORMAT mdy
To get it, you will have to call DBCC USEROPTIONS, like I said before, and
examine the dateformat row. Keep in mind that this setting can be different
for different users, even if they are connected to SQL Server at the same
time.
However, the only *SOLUTION* is to use dateformat-, region- and
language-independent date formats (such as YYYYMMDD).
"jerry.xuddd" <jerryxuddd@.discussions.microsoft.com> wrote in message
news:E520DAAB-1B74-42DE-9D06-610414017795@.microsoft.com...
> Hi,
> Can you tell me how to set and get the dateformat for a sql server? I
> checked the regional setting for windows and it is set to UK, not US.
>
> Thanks
> --
> hello, please help
>
> "Aaron Bertrand [SQL Server MVP]" wrote:
>

How to get the default data path of a SQL Server?

Could I get the default data path of a SQL Server if under following condition:
1) I have only known the SQL Server Name in my network.
2) I am using a workstation computer that connects to a SQL Server through network.
3) I can use store procedure.

The result I wanted is the default data path of a SQL Server like:
"[SQL Server Installed path]\MSSQL\Data", ie. most common case "C:\Program Files\Microsoft SQL Server\MSSQL\Data"

Does any method or store procedure could do the above case?I forget to state the following point:
1) I also need to handle the case if a SQL Server in network has multiple instances.
2) I use a SQL Server 2000.|||Hi,

One easy method is,

SELECT * FROM master..sysdatabases WHERE name LIKE '<database name>'

You can also find information @. http://support.microsoft.com/default.aspx?scid=kb;en-us;Q272705&SD=MSKB&

Thanks
Yogish

Originally posted by king
Could I get the default data path of a SQL Server if under following condition:
1) I have only known the SQL Server Name in my network.
2) I am using a workstation computer that connects to a SQL Server through network.
3) I can use store procedure.

The result I wanted is the default data path of a SQL Server like:
"[SQL Server Installed path]\MSSQL\Data", ie. most common case "C:\Program Files\Microsoft SQL Server\MSSQL\Data"

Does any method or store procedure could do the above case?|||by Alexander Chigrik
USE master
GO
DECLARE @.install_path NVARCHAR(260)
EXEC sp_MSgettools_path @.install_path OUTPUT
SELECT @.install_path
GO

... its an undocumented XP available.

Wednesday, March 7, 2012

How to get new sql server logs without restart SQL server (not SQL transaction log)

hi
I'm using SQL 2000 SP4 on Win2003 Server
By default, when we restart the SQL server, the new "sql server logs" will
be created, my question is, how to achieve the same result by NOT restart
the SQL server
Thanks a lot> By default, when we restart the SQL server, the new "sql server logs" will
> be created, my question is, how to achieve the same result by NOT restart
> the SQL server
EXEC sp_cycle_errorlog
--
Hope this helps.
Dan Guzman
SQL Server MVP
"gbkhor" <gbkhor@.time.net.my> wrote in message
news:uJSGIj4UIHA.6060@.TK2MSFTNGP05.phx.gbl...
> hi
> I'm using SQL 2000 SP4 on Win2003 Server
> By default, when we restart the SQL server, the new "sql server logs" will
> be created, my question is, how to achieve the same result by NOT restart
> the SQL server
> Thanks a lot
>|||Thanks Dan, it work well
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:1E79D060-BADE-4703-9E23-EB3D374F27F9@.microsoft.com...
>> By default, when we restart the SQL server, the new "sql server logs"
>> will be created, my question is, how to achieve the same result by NOT
>> restart the SQL server
> EXEC sp_cycle_errorlog
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "gbkhor" <gbkhor@.time.net.my> wrote in message
> news:uJSGIj4UIHA.6060@.TK2MSFTNGP05.phx.gbl...
>> hi
>> I'm using SQL 2000 SP4 on Win2003 Server
>> By default, when we restart the SQL server, the new "sql server logs"
>> will be created, my question is, how to achieve the same result by NOT
>> restart the SQL server
>> Thanks a lot
>

How to get new sql server logs without restart SQL server (not SQL transaction log)

hi
I'm using SQL 2000 SP4 on Win2003 Server
By default, when we restart the SQL server, the new "sql server logs" will
be created, my question is, how to achieve the same result by NOT restart
the SQL server
Thanks a lot
> By default, when we restart the SQL server, the new "sql server logs" will
> be created, my question is, how to achieve the same result by NOT restart
> the SQL server
EXEC sp_cycle_errorlog
Hope this helps.
Dan Guzman
SQL Server MVP
"gbkhor" <gbkhor@.time.net.my> wrote in message
news:uJSGIj4UIHA.6060@.TK2MSFTNGP05.phx.gbl...
> hi
> I'm using SQL 2000 SP4 on Win2003 Server
> By default, when we restart the SQL server, the new "sql server logs" will
> be created, my question is, how to achieve the same result by NOT restart
> the SQL server
> Thanks a lot
>
|||Thanks Dan, it work well
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:1E79D060-BADE-4703-9E23-EB3D374F27F9@.microsoft.com...
> EXEC sp_cycle_errorlog
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "gbkhor" <gbkhor@.time.net.my> wrote in message
> news:uJSGIj4UIHA.6060@.TK2MSFTNGP05.phx.gbl...
>