Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Sunday, March 11, 2012

blocking processes on scheduler

About once or twice a week, our SQL server stops responding. When this happens, we are not able to connect to it via EM or QA. The only solution at this point is to restart the SQL Service. The SQL errorlog always shows the following type of error after t
his happens:
Process ID 72:167 owns resources that are blocking processes on Scheduler 3.
I am finding it hard to troubleshoot this because there is essentially no way to find out what process is causing the blocking. I know what the SPID causing the blocking was, but due to the restart of SQLService, I don't know what it was actually doing.
Can anyone shed more light on this problem? The only potential solution I can think of is to run a trace and capture all the events before the block occurs so that we can identify the cause of the blocking...
"DBA72" <DBA72@.discussions.microsoft.com> wrote in message
news:A008E96F-84B5-4D89-935A-C6B0C6C7A113@.microsoft.com...
> About once or twice a week, our SQL server stops responding. When this
happens, we are not able to connect to it via EM or QA. The only solution at
this point is to restart the SQL Service. The SQL errorlog always shows the
following type of error after this happens:
> Process ID 72:167 owns resources that are blocking processes on Scheduler
3.
> I am finding it hard to troubleshoot this because there is essentially no
way to find out what process is causing the blocking. I know what the SPID
causing the blocking was, but due to the restart of SQLService, I don't know
what it was actually doing.
> Can anyone shed more light on this problem? The only potential solution I
can think of is to run a trace and capture all the events before the block
occurs so that we can identify the cause of the blocking...
>
I would suggest that you turn on the SQL Server Profiler and let it capture
the database activity. By doing so, you should be able to see what was
happening in the server when it finally locks up. That should give you
some direction to start in.
Rick Sawtell
MCT, MCSD, MCDBA

blocking processes on scheduler

About once or twice a week, our SQL server stops responding. When this happe
ns, we are not able to connect to it via EM or QA. The only solution at this
point is to restart the SQL Service. The SQL errorlog always shows the foll
owing type of error after t
his happens:
Process ID 72:167 owns resources that are blocking processes on Scheduler 3.
I am finding it hard to troubleshoot this because there is essentially no wa
y to find out what process is causing the blocking. I know what the SPID cau
sing the blocking was, but due to the restart of SQLService, I don't know wh
at it was actually doing.
Can anyone shed more light on this problem? The only potential solution I ca
n think of is to run a trace and capture all the events before the block occ
urs so that we can identify the cause of the blocking..."DBA72" <DBA72@.discussions.microsoft.com> wrote in message
news:A008E96F-84B5-4D89-935A-C6B0C6C7A113@.microsoft.com...
> About once or twice a week, our SQL server stops responding. When this
happens, we are not able to connect to it via EM or QA. The only solution at
this point is to restart the SQL Service. The SQL errorlog always shows the
following type of error after this happens:
> Process ID 72:167 owns resources that are blocking processes on Scheduler
3.
> I am finding it hard to troubleshoot this because there is essentially no
way to find out what process is causing the blocking. I know what the SPID
causing the blocking was, but due to the restart of SQLService, I don't know
what it was actually doing.
> Can anyone shed more light on this problem? The only potential solution I
can think of is to run a trace and capture all the events before the block
occurs so that we can identify the cause of the blocking...
>
I would suggest that you turn on the SQL Server Profiler and let it capture
the database activity. By doing so, you should be able to see what was
happening in the server when it finally locks up. That should give you
some direction to start in.
Rick Sawtell
MCT, MCSD, MCDBA

Thursday, March 8, 2012

blocking

I am trying to create a SQL Profiler trace.
I am confused because the Sessions event class only has the Existing
connection event, and no Connect or Disconnect events.
Why is this? Microsoft support articles like #224453 suggest including the
Connect and Disconnect events in a trace, but I can't find them (or some
others).
Thanks
Bill
Looks like that article is talking about SQL Server 7.0 Profiler. And the
same is not applicable to SQL Server 2000 Profiler. In SQL Server 2000
Profiler, you should be using the 'Audit Login' and 'Audit Logout' evernts
of the 'Security Audit' event class.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"bille" <belgie@.datamti.com> wrote in message
news:OkCcgHQaEHA.212@.TK2MSFTNGP12.phx.gbl...
> I am trying to create a SQL Profiler trace.
> I am confused because the Sessions event class only has the Existing
> connection event, and no Connect or Disconnect events.
> Why is this? Microsoft support articles like #224453 suggest including
the
> Connect and Disconnect events in a trace, but I can't find them (or some
> others).
> Thanks
> Bill
>
|||What you want is under the Security Audit Event Class. Look for Audit Login
and Audit Logout
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"bille" <belgie@.datamti.com> wrote in message
news:OkCcgHQaEHA.212@.TK2MSFTNGP12.phx.gbl...
> I am trying to create a SQL Profiler trace.
> I am confused because the Sessions event class only has the Existing
> connection event, and no Connect or Disconnect events.
> Why is this? Microsoft support articles like #224453 suggest including
the
> Connect and Disconnect events in a trace, but I can't find them (or some
> others).
> Thanks
> Bill
>

blocking

I am trying to create a SQL Profiler trace.
I am confused because the Sessions event class only has the Existing
connection event, and no Connect or Disconnect events.
Why is this? Microsoft support articles like #224453 suggest including the
Connect and Disconnect events in a trace, but I can't find them (or some
others).
Thanks
BillLooks like that article is talking about SQL Server 7.0 Profiler. And the
same is not applicable to SQL Server 2000 Profiler. In SQL Server 2000
Profiler, you should be using the 'Audit Login' and 'Audit Logout' evernts
of the 'Security Audit' event class.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"bille" <belgie@.datamti.com> wrote in message
news:OkCcgHQaEHA.212@.TK2MSFTNGP12.phx.gbl...
> I am trying to create a SQL Profiler trace.
> I am confused because the Sessions event class only has the Existing
> connection event, and no Connect or Disconnect events.
> Why is this? Microsoft support articles like #224453 suggest including
the
> Connect and Disconnect events in a trace, but I can't find them (or some
> others).
> Thanks
> Bill
>|||What you want is under the Security Audit Event Class. Look for Audit Login
and Audit Logout
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"bille" <belgie@.datamti.com> wrote in message
news:OkCcgHQaEHA.212@.TK2MSFTNGP12.phx.gbl...
> I am trying to create a SQL Profiler trace.
> I am confused because the Sessions event class only has the Existing
> connection event, and no Connect or Disconnect events.
> Why is this? Microsoft support articles like #224453 suggest including
the
> Connect and Disconnect events in a trace, but I can't find them (or some
> others).
> Thanks
> Bill
>

Wednesday, March 7, 2012

blocking

I am trying to create a SQL Profiler trace.
I am confused because the Sessions event class only has the Existing
connection event, and no Connect or Disconnect events.
Why is this? Microsoft support articles like #224453 suggest including the
Connect and Disconnect events in a trace, but I can't find them (or some
others).
Thanks
BillLooks like that article is talking about SQL Server 7.0 Profiler. And the
same is not applicable to SQL Server 2000 Profiler. In SQL Server 2000
Profiler, you should be using the 'Audit Login' and 'Audit Logout' evernts
of the 'Security Audit' event class.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"bille" <belgie@.datamti.com> wrote in message
news:OkCcgHQaEHA.212@.TK2MSFTNGP12.phx.gbl...
> I am trying to create a SQL Profiler trace.
> I am confused because the Sessions event class only has the Existing
> connection event, and no Connect or Disconnect events.
> Why is this? Microsoft support articles like #224453 suggest including
the
> Connect and Disconnect events in a trace, but I can't find them (or some
> others).
> Thanks
> Bill
>|||What you want is under the Security Audit Event Class. Look for Audit Login
and Audit Logout
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"bille" <belgie@.datamti.com> wrote in message
news:OkCcgHQaEHA.212@.TK2MSFTNGP12.phx.gbl...
> I am trying to create a SQL Profiler trace.
> I am confused because the Sessions event class only has the Existing
> connection event, and no Connect or Disconnect events.
> Why is this? Microsoft support articles like #224453 suggest including
the
> Connect and Disconnect events in a trace, but I can't find them (or some
> others).
> Thanks
> Bill
>

block all apps except for...

Is there a way to make it so that nobody can connect to sql unless they come
in through a certain app... without the use of Application Roles. ( my boss
doesnt want to have to pass in a password each time.)
TIA, ChrisR
On Wed, 15 Dec 2004 16:09:00 -0800, "ChrisR" <ChrisR@.noEmail.com>
wrote:
>Is there a way to make it so that nobody can connect to sql unless they come
>in through a certain app... without the use of Application Roles. ( my boss
>doesnt want to have to pass in a password each time.)
Can't you also do it with Windows domain logins, by defining a new
domain group and assigning just certain people to that group (role?),
and then giving only that group login permission in SQLServer?
I'm obviously not the expert on this, but I had the impression that
was also possible - it's application roles, but done at the network
security level, and no special passwords are required. If it's
possible at all!
J.
|||"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:ewSE$Ow4EHA.1408@.TK2MSFTNGP10.phx.gbl...
> Is there a way to make it so that nobody can connect to sql unless they
come
> in through a certain app... without the use of Application Roles. ( my
boss
> doesnt want to have to pass in a password each time.)
Get a new boss. :-)

>
> TIA, ChrisR
>
|||The dilema with this is that I need to know how to do it for SQL Logins as
well.
"JXStern" <JXSternChangeX2R@.gte.net> wrote in message
news:t9m1s01oi6urm763144udojr98tsvr3eh6@.4ax.com... [vbcol=seagreen]
> On Wed, 15 Dec 2004 16:09:00 -0800, "ChrisR" <ChrisR@.noEmail.com>
> wrote:
come[vbcol=seagreen]
boss
> Can't you also do it with Windows domain logins, by defining a new
> domain group and assigning just certain people to that group (role?),
> and then giving only that group login permission in SQLServer?
> I'm obviously not the expert on this, but I had the impression that
> was also possible - it's application roles, but done at the network
> security level, and no special passwords are required. If it's
> possible at all!
> J.
>
|||If you want to secure the system from access outside of the application,
there are two methods outside of the use of Application Roles.
First, you should be using Windows Authentication. You can either grant
users access through the use of Windows Groups, which map to database roles,
or, have a single application login id, Windows Account. Your application
would then need to be set up as a server, use DCOM, or COM+ for the database
access components.
That's for the access. To keep users from accessing the data without using
the application, consider the exclusive use of stored procedures for all of
the data manipulation. Then for users with directly mapped access, through
individual logins or the use of Windows Groups, explicitly add these users
to the default db_denydatareader and db_denydatawriter database roles.
Sincerely,
Anthony Thomas

"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:ewSE$Ow4EHA.1408@.TK2MSFTNGP10.phx.gbl...
Is there a way to make it so that nobody can connect to sql unless they come
in through a certain app... without the use of Application Roles. ( my boss
doesnt want to have to pass in a password each time.)
TIA, ChrisR

block all apps except for...

Is there a way to make it so that nobody can connect to sql unless they come
in through a certain app... without the use of Application Roles. ( my boss
doesnt want to have to pass in a password each time.)
TIA, ChrisROn Wed, 15 Dec 2004 16:09:00 -0800, "ChrisR" <ChrisR@.noEmail.com>
wrote:
>Is there a way to make it so that nobody can connect to sql unless they come
>in through a certain app... without the use of Application Roles. ( my boss
>doesnt want to have to pass in a password each time.)
Can't you also do it with Windows domain logins, by defining a new
domain group and assigning just certain people to that group (role?),
and then giving only that group login permission in SQLServer?
I'm obviously not the expert on this, but I had the impression that
was also possible - it's application roles, but done at the network
security level, and no special passwords are required. If it's
possible at all!
J.|||"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:ewSE$Ow4EHA.1408@.TK2MSFTNGP10.phx.gbl...
> Is there a way to make it so that nobody can connect to sql unless they
come
> in through a certain app... without the use of Application Roles. ( my
boss
> doesnt want to have to pass in a password each time.)
Get a new boss. :-)
>
> TIA, ChrisR
>|||The dilema with this is that I need to know how to do it for SQL Logins as
well.
"JXStern" <JXSternChangeX2R@.gte.net> wrote in message
news:t9m1s01oi6urm763144udojr98tsvr3eh6@.4ax.com...
> On Wed, 15 Dec 2004 16:09:00 -0800, "ChrisR" <ChrisR@.noEmail.com>
> wrote:
> >Is there a way to make it so that nobody can connect to sql unless they
come
> >in through a certain app... without the use of Application Roles. ( my
boss
> >doesnt want to have to pass in a password each time.)
> Can't you also do it with Windows domain logins, by defining a new
> domain group and assigning just certain people to that group (role?),
> and then giving only that group login permission in SQLServer?
> I'm obviously not the expert on this, but I had the impression that
> was also possible - it's application roles, but done at the network
> security level, and no special passwords are required. If it's
> possible at all!
> J.
>|||If you want to secure the system from access outside of the application,
there are two methods outside of the use of Application Roles.
First, you should be using Windows Authentication. You can either grant
users access through the use of Windows Groups, which map to database roles,
or, have a single application login id, Windows Account. Your application
would then need to be set up as a server, use DCOM, or COM+ for the database
access components.
That's for the access. To keep users from accessing the data without using
the application, consider the exclusive use of stored procedures for all of
the data manipulation. Then for users with directly mapped access, through
individual logins or the use of Windows Groups, explicitly add these users
to the default db_denydatareader and db_denydatawriter database roles.
Sincerely,
Anthony Thomas
"ChrisR" <ChrisR@.noEmail.com> wrote in message
news:ewSE$Ow4EHA.1408@.TK2MSFTNGP10.phx.gbl...
Is there a way to make it so that nobody can connect to sql unless they come
in through a certain app... without the use of Application Roles. ( my boss
doesnt want to have to pass in a password each time.)
TIA, ChrisR

Friday, February 24, 2012

Blob and MFC

I'm using MFC(Visual C++ 6.0), SQL Server 2000 and ODBC to connect to SQL Se
rver. I have a table that has a blob(image) column in it. The structure of t
he table is:
CREATE TABLE [dbo].[lbx_blob_1096] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Date] [varchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Refno] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[imgData] [image] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
I have a Stored Procedure thru which I would like to insert data and image i
nto the table. The Stored Procedure is defined as follows:
CREATE proc dbo.CMS_sp_inserttoblobtable
@.blobtablename varchar(50),
@.valuesstr varchar(100),
@.resultparam int output
as
BEGIN TRAN INSERT_BLOBTABLE
DECLARE @.retval int
EXEC('INSERT INTO ' + @.blobtablename + ' (busdate,refno,imgData) VALUES ( '
+ @.valuesstr + ' )')
IF @.@.ERROR <> '0'
BEGIN
ROLLBACK TRAN INSERT_BLOBTABLE
END
ELSE
BEGIN
COMMIT TRAN INSERT_BLOBTABLE
SET @.resultparam = @.@.IDENTITY
END
SET @.retval = @.@.ERROR
RETURN @.retval
GO
I would like to know of a easy way to pass the image data from my MFC applic
ation to the Stored Procedure. Rightnow, I'm trying to use the SQLBindParame
ter as :
retValue = SQLBindParameter(hstmt, 5, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_BIN
ARY,0, 0, (SQLPOINTER)s_ImgData, 0, &cbBinary);
But, I keep getting a datatype mismatch error. Can anybody please help me on
this?
Thanks,I don't think you can update BLOB fields from MFC using a SP. I think you'll
need to look into using the either the ADO GetChunk and AppendChunk methods
or the ADO Stream object. Here's a couple pieces of information that might
help:
http://support.microsoft.com/defaul...kb;en-us;189415
http://support.microsoft.com/defaul...kb;en-us;258038
Mike O.
"Mohan K" <anonymous@.discussions.microsoft.com> wrote in message
news:C8B747B6-7E2B-48A0-9219-DFF0500180AA@.microsoft.com...
> I'm using MFC(Visual C++ 6.0), SQL Server 2000 and ODBC to connect to SQL
Server. I have a table that has a blob(image) column in it. The structure of
the table is:
> CREATE TABLE [dbo].[lbx_blob_1096] (
> [ID] [int] IDENTITY (1, 1) NOT NULL ,
> [Date] [varchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NU
LL ,
> [Refno] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NU
LL ,
> [imgData] [image] NOT NULL
> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
> GO
> I have a Stored Procedure thru which I would like to insert data and image
into the table. The Stored Procedure is defined as follows:
> CREATE proc dbo.CMS_sp_inserttoblobtable
> @.blobtablename varchar(50),
> @.valuesstr varchar(100),
> @.resultparam int output
> as
> BEGIN TRAN INSERT_BLOBTABLE
> DECLARE @.retval int
> EXEC('INSERT INTO ' + @.blobtablename + ' (busdate,refno,imgData)
VALUES ( ' + @.valuesstr + ' )')
> IF @.@.ERROR <> '0'
> BEGIN
> ROLLBACK TRAN INSERT_BLOBTABLE
> END
> ELSE
> BEGIN
> COMMIT TRAN INSERT_BLOBTABLE
> SET @.resultparam = @.@.IDENTITY
> END
> SET @.retval = @.@.ERROR
> RETURN @.retval
> GO
> I would like to know of a easy way to pass the image data from my MFC
application to the Stored Procedure. Rightnow, I'm trying to use the
SQLBindParameter as :
> retValue = SQLBindParameter(hstmt, 5, SQL_PARAM_INPUT, SQL_C_BINARY,
SQL_BINARY,0, 0, (SQLPOINTER)s_ImgData, 0, &cbBinary);
> But, I keep getting a datatype mismatch error. Can anybody please help me
on this?
> Thanks,

Sunday, February 19, 2012

blank report result

Hi aLL,

I have two DB's. A and B. I connect to A and construct a link diagram and run the report. But i get no data. When i see the SQL Its got the database B prefixed to the tables i am using. Even when i am conncting to A its running against B and that why getting no data.

What do i do...i am new to crystal...

matuI assume you're talking about views. If a view references B then it will quite rightly return data from B, even if you've stored that view in A. This isn't a crystal problem.

If the structure of A and B are the same, remove the B prefix from the view in A. Also, create this same view in B.

Now in Crystal, change your datasource location to whichever view you want the data from.

blank report - problems with datasource?

I creted a web project with visual studio 2005 express but the report
is blank.
My report's source is on MySql; I connect runtime and send datatable
to the report.
this is the rdlc file; I canceled some rows
[code]
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/
2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/
SQLServer/reporting/reportdesigner">
<PageWidth>21cm</PageWidth>
<rd:DrawGrid>true</rd:DrawGrid>
<InteractiveWidth>21cm</InteractiveWidth>
<rd:GridSpacing>0.25cm</rd:GridSpacing>
<rd:SnapToGrid>true</rd:SnapToGrid>
<Body>
<ColumnSpacing>1cm</ColumnSpacing>
<ReportItems>
<Textbox Name="comune">
<Left>0.25cm</Left>
<Top>0.25cm</Top>
<rd:DefaultName>comune</rd:DefaultName>
<ZIndex>1</ZIndex>
<Width>14.25cm</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>0.63492cm</Height>
<Value>=First(Fields!comune.Value)</Value>
</Textbox>
<Textbox Name="textbox2">
<Left>15cm</Left>
<Top>0.25cm</Top>
<rd:DefaultName>textbox2</rd:DefaultName>
<Width>3.99471cm</Width>
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
</Style>
<CanGrow>true</CanGrow>
<Height>1.00529cm</Height>
<Value>Scheda cliente</Value>
</Textbox>
</ReportItems>
<Height>25cm</Height>
</Body>
<rd:ReportID>2c8fb28d-af14-4a5f-b557-de3fbbfb5378</rd:ReportID>
<DataSources>
<DataSource Name="reminder_local">
<ConnectionProperties>
<ConnectString />
<DataProvider>OLEDB</DataProvider>
</ConnectionProperties>
<rd:DataSourceID>47284d9e-3aa3-4350-9732-405dc3c0abbf</
rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="DSCliente">
<rd:DataSetInfo>
<rd:TableAdapterGetDataMethod>GetData</
rd:TableAdapterGetDataMethod>
<rd:DataSetName>dbDataSet</rd:DataSetName>
<rd:TableAdapterFillMethod>Fill</rd:TableAdapterFillMethod>
<rd:TableAdapterName>ProductsTableAdapter</
rd:TableAdapterName>
<rd:TableName>tbCliente</rd:TableName>
</rd:DataSetInfo>
<Query>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
<CommandText>select * from tbCliente</CommandText>
<DataSourceName>reminder_local</DataSourceName>
</Query>
<Fields>
<Field Name="id">
<rd:TypeName>System.Int64</rd:TypeName>
<DataField>id</DataField>
</Field>
<Field Name="ragsoc">
<rd:TypeName>System.String</rd:TypeName>
<DataField>ragsoc</DataField>
</Field>
<Field Name="via">
<rd:TypeName>System.String</rd:TypeName>
<DataField>via</DataField>
</Field>
<Field Name="comune">
<rd:TypeName>System.String</rd:TypeName>
<DataField>comune</DataField>
</Field>
<Field Name="prov">
<rd:TypeName>System.String</rd:TypeName>
<DataField>prov</DataField>
</Field>
</Fields>
... fields tolti...
</DataSet>
</DataSets>
<Width>20.25cm</Width>
<InteractiveHeight>29.7cm</InteractiveHeight>
<Language>en-US</Language>
<PageHeight>29.7cm</PageHeight>
</Report>
[/code]
and this is the page code loading the report
[code]
protected void Page_Load(object sender, EventArgs e)
{
DataSet dsCliente = new DataSet();
dsCliente.DataSetName = "DsCliente";
MySqlConnection mycnn = new
MySqlConnection(ConfigurationManager.ConnectionStrings["reminder_local"].ToString());
MySqlCommand cmd = new MySqlCommand();
MySqlDataAdapter DA = new MySqlDataAdapter();
cmd.Connection = mycnn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new MySqlParameter("P_ID", 1));
cmd.Parameters.Add(new MySqlParameter("P_AncheAnnullati",
"True"));
cmd.CommandText = "spSelectClienteByID";
DA.SelectCommand = cmd;
DA.Fill(dsCliente);
dsCliente.Tables[0].TableName = "tbCliente";
rwScheda.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
rwScheda.LocalReport.ReportPath = MapPath("SchedeClienti.rdlc");
ReportDataSource rptDS = new ReportDataSource();
rptDS.Name = "DSCliente";
rptDS.Value = dsCliente.Tables[0];
rwScheda.LocalReport.DataSources.Add(rptDS);
rwScheda.DataBind();
//rwScheda.LocalReport.Refresh();
}
[/code]
I've already seen that in the table there is one record.
Why I don't see anything'I answer myself
I put the property AsyncRendering="false" on the reportviewer object
in the aspx page
and now works fine.

Blank password check

Is there any way to check whether the password for existing sql authentication login is blank? (except trying to connect)

Where can I find information about how the passwords are stored internally in SQL Server?

which version r u talking about. if its 2005 you can do that i believe.

credentials are stored in sysxlogins system table

Madhu

|||Only hashes are stored, you won′t find them in clear text. For SQL Server 2005 use password policies to ensure a certain password complexity.

Jens K. Suessmeyer:


http://www.sqlserver2005.de

|||Yes I understand it, I just wonder how some tools discover logins with blank passwords (http://www.ngssoftware.com/products/database-security/ngs-squirrel-sql.php)|||

Oh, actually it seems to be fairly simple,

I just call ALTER LOGIN myLogin WITH PASSWORD = N'' OLD_PASSWORD = N'' and if it succeed -- login myLogin has a blank password. Or am I missing something?

|||

sir..... you are resetting the password to null. it will change the password, it will not tell u whether its blank or not. But it will make the password blank evenif its not blank. Not atall the correct method

Madhu

|||No, trying to change the password seems to be a bit offensive :-)

I wrote this short code snippet for you, tell me if it works for you, it scans all reachable /discoverable servers and test all SQL Server logins:

Code Snippet

foreach (DataRow dr in SmoApplication.EnumAvailableSqlServers().Rows)

{

Server srv = new Server(dr["Name"].ToString());

foreach (Login l in srv.Logins)

{

if (l.LoginType == LoginType.SqlLogin)

{

SqlConnection conn = new SqlConnection(string.Format("Data Source={0};Initial Catalog=master;User Id={1},Password={2}",

srv.InstanceName,

l.Name,

string.Empty));

try

{

conn.Open();

Console.WriteLine(string.Format("The userid {0} has an empty password.", l.Name));

}

catch (SqlException ex)

{ }

finally

{

if (conn.State == ConnectionState.Open)

conn.Close();

}

}

}

}

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Thanks Jens,

the way you suggest works fine I think.

|||

Madhu,

I cannot agree with you.

See the following script:

Code Snippet

CREATE LOGIN myLogin WITH PASSWORD = N'IT IS NOT A BLANK PASSWORD!', CHECK_POLICY = OFF

BEGIN TRY

-- this statement will FAIL because we specified invalid old (current) password

ALTER LOGIN myLogin WITH PASSWORD = N'' OLD_PASSWORD = N''

END TRY

BEGIN CATCH

PRINT 'Password is NOT blank!'

END CATCH

-- this statement will actually change the password

ALTER LOGIN myLogin WITH PASSWORD = N''

PRINT '//Password was changed to blank//'

-- so now password is blank

BEGIN TRY

-- this statement will SUCCEED because we specified right old (current) password

ALTER LOGIN myLogin WITH PASSWORD = N'' OLD_PASSWORD = N''

-- but actually nothing will happen because new password is the same as old one.

PRINT 'Password is BLANK!'

END TRY

BEGIN CATCH

END CATCH

DROP LOGIN myLogin

The idea is that ALTER LOGIN fails when called with OLD_PASSWORD option and invalid old (current) password given.

I think that it is even more effective way to check than trying to logon on server with <loginName, blankPassword> credentials.

Blank password check

Is there any way to check whether the password for existing sql authentication login is blank? (except trying to connect)

Where can I find information about how the passwords are stored internally in SQL Server?

which version r u talking about. if its 2005 you can do that i believe.

credentials are stored in sysxlogins system table

Madhu

|||Only hashes are stored, you won′t find them in clear text. For SQL Server 2005 use password policies to ensure a certain password complexity.

Jens K. Suessmeyer:


http://www.sqlserver2005.de

|||Yes I understand it, I just wonder how some tools discover logins with blank passwords (http://www.ngssoftware.com/products/database-security/ngs-squirrel-sql.php)|||

Oh, actually it seems to be fairly simple,

I just call ALTER LOGIN myLogin WITH PASSWORD = N'' OLD_PASSWORD = N'' and if it succeed -- login myLogin has a blank password. Or am I missing something?

|||

sir..... you are resetting the password to null. it will change the password, it will not tell u whether its blank or not. But it will make the password blank evenif its not blank. Not atall the correct method

Madhu

|||No, trying to change the password seems to be a bit offensive :-)

I wrote this short code snippet for you, tell me if it works for you, it scans all reachable /discoverable servers and test all SQL Server logins:

Code Snippet

foreach (DataRow dr in SmoApplication.EnumAvailableSqlServers().Rows)

{

Server srv = new Server(dr["Name"].ToString());

foreach (Login l in srv.Logins)

{

if (l.LoginType == LoginType.SqlLogin)

{

SqlConnection conn = new SqlConnection(string.Format("Data Source={0};Initial Catalog=master;User Id={1},Password={2}",

srv.InstanceName,

l.Name,

string.Empty));

try

{

conn.Open();

Console.WriteLine(string.Format("The userid {0} has an empty password.", l.Name));

}

catch (SqlException ex)

{ }

finally

{

if (conn.State == ConnectionState.Open)

conn.Close();

}

}

}

}

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Thanks Jens,

the way you suggest works fine I think.

|||

Madhu,

I cannot agree with you.

See the following script:

Code Snippet

CREATE LOGIN myLogin WITH PASSWORD = N'IT IS NOT A BLANK PASSWORD!', CHECK_POLICY = OFF

BEGIN TRY

-- this statement will FAIL because we specified invalid old (current) password

ALTER LOGIN myLogin WITH PASSWORD = N'' OLD_PASSWORD = N''

END TRY

BEGIN CATCH

PRINT 'Password is NOT blank!'

END CATCH

-- this statement will actually change the password

ALTER LOGIN myLogin WITH PASSWORD = N''

PRINT '//Password was changed to blank//'

-- so now password is blank

BEGIN TRY

-- this statement will SUCCEED because we specified right old (current) password

ALTER LOGIN myLogin WITH PASSWORD = N'' OLD_PASSWORD = N''

-- but actually nothing will happen because new password is the same as old one.

PRINT 'Password is BLANK!'

END TRY

BEGIN CATCH

END CATCH

DROP LOGIN myLogin

The idea is that ALTER LOGIN fails when called with OLD_PASSWORD option and invalid old (current) password given.

I think that it is even more effective way to check than trying to logon on server with <loginName, blankPassword> credentials.

Sunday, February 12, 2012

Bizarre sql management studio problem...cant see server status for

This one has me stumped.
Basically when I open sql management studio 2005 and connect to one of
my servers, the little server status icon adjacent to the server name
contains a blank circle. Normally it contains a small green triangle
to indicate the server is running. If I right click on the server
name, all the start/stop/pause/resume etc options are greyed out. This
is very confusing for the following reasons:
- I am logged on as 'sa' and all my other permissions work.
- Other logins (both sql server and windows authentication) show the
same issue
- Connecting to other database servers works fine (and shows the
correct status icon)
I originally thought it was some bizarre permissions issue, however if
I am logged directly into the server start the sql management tool
there using the same database login, the server shows the 'started'
green triangle and the start/stop/pause/resume etc options are
available.
This issue appears to have occurred randomly, I can not think of
anything I have done recently that involved changing permissions or
anything like that.
Any ideas?The connection as sa is a regular SQL Server connection. The
indicator that shows that the server is running is not updated based
on making a SQL Server connection; if you open SSMS without connecting
to any SQL Server the status of the servers should show.
The indication that SQL Server is running, or not, is based on SSMS
finding out if the service is running. That query is made to the
server's operating system, and is based on the rights of the Windows
account you are logged in with. For the servers that are displayed
with the status you have rights, for the others you do not.
I admit to a bit of guesswork in the above, but I think it is the
answer.
Roy Harvey
Beacon Falls, CT
On Fri, 11 Jan 2008 17:16:50 -0800 (PST), Alex Danger
<alex.csp@.gmail.com> wrote:
>This one has me stumped.
>Basically when I open sql management studio 2005 and connect to one of
>my servers, the little server status icon adjacent to the server name
>contains a blank circle. Normally it contains a small green triangle
>to indicate the server is running. If I right click on the server
>name, all the start/stop/pause/resume etc options are greyed out. This
>is very confusing for the following reasons:
>
>- I am logged on as 'sa' and all my other permissions work.
>- Other logins (both sql server and windows authentication) show the
>same issue
>- Connecting to other database servers works fine (and shows the
>correct status icon)
>I originally thought it was some bizarre permissions issue, however if
>I am logged directly into the server start the sql management tool
>there using the same database login, the server shows the 'started'
>green triangle and the start/stop/pause/resume etc options are
>available.
>This issue appears to have occurred randomly, I can not think of
>anything I have done recently that involved changing permissions or
>anything like that.
>Any ideas?