显示标签为“following”的博文。显示所有博文
显示标签为“following”的博文。显示所有博文

2012年3月29日星期四

Display 1 piece of Data from a SQLDataSource

I have the following sqlDataSource. I wan't to display one piece of data, not a whole row, from it. I can find lots of information on putting it into a datagrid, but nothing on puttin one piece in a textbox. I cannot use a formview as we are embedding html in response.write and it breaks in a formview. Thanks.

<asp:SqlDataSourcerunat="server"

ID="myEmpInfo"

SelectCommand="Select di.EmpInfo,di.eth,gc.t_level

From tblEmp di

,tblMisc gc

Where di.empnum = @.empnum

and di.empnum = gc.empnum"DataSourceMode="DataReader"ConnectionString="<%$ ConnectionStrings : myConnectionString %>">

<SelectParameters>

<asp:QueryStringParameterName="empnum"QueryStringField="empnum"/>

</SelectParameters>

</asp:SqlDataSource>

Hi,

Do you want to get the value of specific row and specific column from a table? If so,you can use DataView to achieve. See the following sample:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" DataSourceMode="DataSet" ConnectionString="<%$ ConnectionStrings:TestConnectionString2%>" ></asp:SqlDataSource>
SqlDataSource1.SelectCommand ="select CategoryName from Categories";DataView dw = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
 
/// Display all the valueforeach (DataRow drin dw.Table.Rows) {foreach (DataColumn dcin dw.Table.Columns) { Response.Write(dr[dc.ToString()].ToString() +";"); } Response.Write("\r\n"); }/// You also can use /// string str = dw.Table.Rows[0][0].ToString(); /// to get the value from a specific row specific column.
Hope that helps. Thanks.

2012年3月27日星期二

Disk Reads and writes

I have a performance issue and I'm trying to monitor it
using performance monitor. I came up with the following
disk info :
disk reads 1460
disk writes 193
What is causing the read operation to be so slow? I've
looked at the queries being run and they are fine with
good amount of indexes on the tables - but something must
be wrong somewhere on those disks or I don't know. Any
suggestions on what to look for? Thank you.
JohnYou said the indexes are fine, But have you checked the actual execution
plan of those queries, to make sure the indexes are being used optimally?
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"John Bull" <anonymous@.discussions.microsoft.com> wrote in message
news:357d01c47ef9$2758bd20$a301280a@.phx.gbl...
> I have a performance issue and I'm trying to monitor it
> using performance monitor. I came up with the following
> disk info :
> disk reads 1460
> disk writes 193
> What is causing the read operation to be so slow? I've
> looked at the queries being run and they are fine with
> good amount of indexes on the tables - but something must
> be wrong somewhere on those disks or I don't know. Any
> suggestions on what to look for? Thank you.
> John
>
>|||Vyas,
thank you for the suggestion. I'm afraid I haven't done
that. Can you please suggest how? Thanks.
John
>--Original Message--
>You said the indexes are fine, But have you checked the
actual execution
>plan of those queries, to make sure the indexes are being
used optimally?
>--
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>
>"John Bull" <anonymous@.discussions.microsoft.com> wrote
in message
>news:357d01c47ef9$2758bd20$a301280a@.phx.gbl...
>> I have a performance issue and I'm trying to monitor it
>> using performance monitor. I came up with the following
>> disk info :
>> disk reads 1460
>> disk writes 193
>> What is causing the read operation to be so slow? I've
>> looked at the queries being run and they are fine with
>> good amount of indexes on the tables - but something
must
>> be wrong somewhere on those disks or I don't know. Any
>> suggestions on what to look for? Thank you.
>> John
>>
>
>.
>|||enter the query in query analyzer and then click the button for "Estimated
execution plan"
look for table scans and index scans (they are bad) you want Index Seeks.
Greg Jackson
PDX, Oregon|||Start SQL Profiler, filter on queries making > 500000 reads (adjust as
required), and analyze the captured queries.
--
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backup files? Use MiniSQLBackup Lite, free!
"John Bull" <anonymous@.discussions.microsoft.com> wrote in message
news:3bef01c47f17$7583e510$a601280a@.phx.gbl...
> Vyas,
> thank you for the suggestion. I'm afraid I haven't done
> that. Can you please suggest how? Thanks.
> John
> >--Original Message--
> >You said the indexes are fine, But have you checked the
> actual execution
> >plan of those queries, to make sure the indexes are being
> used optimally?
> >--
> >Vyas, MVP (SQL Server)
> >http://vyaskn.tripod.com/
> >
> >
> >"John Bull" <anonymous@.discussions.microsoft.com> wrote
> in message
> >news:357d01c47ef9$2758bd20$a301280a@.phx.gbl...
> >> I have a performance issue and I'm trying to monitor it
> >> using performance monitor. I came up with the following
> >> disk info :
> >> disk reads 1460
> >> disk writes 193
> >>
> >> What is causing the read operation to be so slow? I've
> >> looked at the queries being run and they are fine with
> >> good amount of indexes on the tables - but something
> must
> >> be wrong somewhere on those disks or I don't know. Any
> >> suggestions on what to look for? Thank you.
> >> John
> >>
> >>
> >>
> >
> >
> >.
> >

2012年3月25日星期日

Disk Error?

Help, I'm getting the following error that is preventing
full backups or transaction log backups of this db...
Event ID: 17052
Error:823, Severity: 24, State:3
I/O error 2(The system cannot find the file specified.)
detected during write at offset 0x000002ca6d8000 in the
file 'D:\...db.mdf'.
I ran dbcc and it did fine against this database.
However, transaction log backups continue to fail with
this error. All other databases on this server aren't
having problems. This is a standalone environment, sql
server 2000 EE. This server has been running fine for
sometime. I suspect a disk problem but would have to
present a good case for it.Are you running backups in EM? Have you tried QA.
>--Original Message--
>Help, I'm getting the following error that is preventing
>full backups or transaction log backups of this db...
>Event ID: 17052
>Error:823, Severity: 24, State:3
>I/O error 2(The system cannot find the file specified.)
>detected during write at offset 0x000002ca6d8000 in the
>file 'D:\...db.mdf'.
>I ran dbcc and it did fine against this database.
>However, transaction log backups continue to fail with
>this error. All other databases on this server aren't
>having problems. This is a standalone environment, sql
>server 2000 EE. This server has been running fine for
>sometime. I suspect a disk problem but would have to
>present a good case for it.
>.
>|||You might want to give MS PSS a call:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;sql SQL Support
http://www.mssqlserver.com/faq/general-pss.asp MS PSS
--
Andrew J. Kelly
SQL Server MVP
"Tim Bridges" <bridgt01@.hotmail.com> wrote in message
news:03c101c3ca33$ca2ac7d0$a001280a@.phx.gbl...
> Help, I'm getting the following error that is preventing
> full backups or transaction log backups of this db...
> Event ID: 17052
> Error:823, Severity: 24, State:3
> I/O error 2(The system cannot find the file specified.)
> detected during write at offset 0x000002ca6d8000 in the
> file 'D:\...db.mdf'.
> I ran dbcc and it did fine against this database.
> However, transaction log backups continue to fail with
> this error. All other databases on this server aren't
> having problems. This is a standalone environment, sql
> server 2000 EE. This server has been running fine for
> sometime. I suspect a disk problem but would have to
> present a good case for it.|||You may want to chek the disk controllers and device drivers. There is a utility available to stress the disks. http://support.microsoft.com/default.aspx?kbid=231619. The following artcile talks about a similar problem. http://support.microsoft.com/default.aspx?kbid=826433
-- Andrew J. Kelly wrote: --
You might want to give MS PSS a call:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;sql SQL Support
http://www.mssqlserver.com/faq/general-pss.asp MS PSS
--
Andrew J. Kelly
SQL Server MVP
"Tim Bridges" <bridgt01@.hotmail.com> wrote in message
news:03c101c3ca33$ca2ac7d0$a001280a@.phx.gbl...
> Help, I'm getting the following error that is preventing
> full backups or transaction log backups of this db...
>> Event ID: 17052
> Error:823, Severity: 24, State:3
> I/O error 2(The system cannot find the file specified.)
> detected during write at offset 0x000002ca6d8000 in the
> file 'D:\...db.mdf'.
>> I ran dbcc and it did fine against this database.
> However, transaction log backups continue to fail with
> this error. All other databases on this server aren't
> having problems. This is a standalone environment, sql
> server 2000 EE. This server has been running fine for
> sometime. I suspect a disk problem but would have to
> present a good case for it.|||Thanks for the link. We've used this utility before but
with the holidays here and this problem being on a test
server it may not be until next week before we dig into
it further. Thanks for the info.
>--Original Message--
>You may want to chek the disk controllers and device
drivers. There is a utility available to stress the
disks. http://support.microsoft.com/default.aspx?
kbid=231619. The following artcile talks about a similar
problem. http://support.microsoft.com/default.aspx?
kbid=826433
>
> -- Andrew J. Kelly wrote: --
> You might want to give MS PSS a call:
> http://support.microsoft.com/default.aspx?
scid=fh;EN-US;sql SQL Support
> http://www.mssqlserver.com/faq/general-pss.asp MS
PSS
> --
> Andrew J. Kelly
> SQL Server MVP
>
> "Tim Bridges" <bridgt01@.hotmail.com> wrote in
message
> news:03c101c3ca33$ca2ac7d0$a001280a@.phx.gbl...
> > Help, I'm getting the following error that is
preventing
> > full backups or transaction log backups of this
db...
> >> Event ID: 17052
> > Error:823, Severity: 24, State:3
> > I/O error 2(The system cannot find the file
specified.)
> > detected during write at offset 0x000002ca6d8000
in the
> > file 'D:\...db.mdf'.
> >> I ran dbcc and it did fine against this database.
> > However, transaction log backups continue to fail
with
> > this error. All other databases on this server
aren't
> > having problems. This is a standalone
environment, sql
> > server 2000 EE. This server has been running
fine for
> > sometime. I suspect a disk problem but would
have to
> > present a good case for it.
>
>.
>

2012年3月22日星期四

Disk capacity and CPU/memory utilisation question?

Folks,
This is a dumb question I know but I'm a newbie and require your
help. Can anyone answer the following 2 questions concerning SQL
Server 2000:
1. How do you check for disk capacity on a SQL Server 2000 box?
2. How do you look at a log of CPU/memory utilisation and the
processes running at that time?
Any commetns/ideas/suggestions - much appreciated.
Thank you,
ColmYou check disk capacity the same as with any other box...you can use
perfmon, etc... To see how much logical space is available INSIDE the
physical files, sp_spaceused will do it...
In order to save and look at processes that were running at a particular
time, you would run perfmon and save the output. Then you may go back and do
reports on specific time periods... There are also 3rd party monitoring
tools available to you..
Microsoft also has MOM. I forget what the acronym stands for, but it is an
operational tool for monitoring windows based machines. AND there is an
add-in for SQL Server as well... This is a sku'd product which you must
purchase.
If you wish to get into this in a BIG, do it yourself kind of way, take a
look at WMI. A microsoft scripting language which allows you to do many,
many different kinds of things..
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
"Al Murphy" <almurph@.altavista.com> wrote in message
news:a23daf3f.0411240429.3f373918@.posting.google.com...
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm|||In addition to Waynes wonderful response you might find these useful:
http://www.microsoft.com/sql/techin.../perftuning.asp
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.c...mance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.c...rmance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=q224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/d.../>
on_24u1.asp
Disk Monitoring
Andrew J. Kelly SQL MVP
"Al Murphy" <almurph@.altavista.com> wrote in message
news:a23daf3f.0411240429.3f373918@.posting.google.com...
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm|||Al,
In addition to Andrew's and Waynes replies, you may wish to have a look
at some SQL Server stored procedures.
exec master..xp_fixeddrives
exec master..sp_monitor
I've found these useful in the past.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Al Murphy wrote:
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm

Disk capacity and CPU/memory utilisation question?

Folks,
This is a dumb question I know but I'm a newbie and require your
help. Can anyone answer the following 2 questions concerning SQL
Server 2000:
1. How do you check for disk capacity on a SQL Server 2000 box?
2. How do you look at a log of CPU/memory utilisation and the
processes running at that time?
Any commetns/ideas/suggestions - much appreciated.
Thank you,
Colm
You check disk capacity the same as with any other box...you can use
perfmon, etc... To see how much logical space is available INSIDE the
physical files, sp_spaceused will do it...
In order to save and look at processes that were running at a particular
time, you would run perfmon and save the output. Then you may go back and do
reports on specific time periods... There are also 3rd party monitoring
tools available to you..
Microsoft also has MOM. I forget what the acronym stands for, but it is an
operational tool for monitoring windows based machines. AND there is an
add-in for SQL Server as well... This is a sku'd product which you must
purchase.
If you wish to get into this in a BIG, do it yourself kind of way, take a
look at WMI. A microsoft scripting language which allows you to do many,
many different kinds of things..
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
"Al Murphy" <almurph@.altavista.com> wrote in message
news:a23daf3f.0411240429.3f373918@.posting.google.c om...
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm
|||In addition to Waynes wonderful response you might find these useful:
http://www.microsoft.com/sql/techinf...perftuning.asp
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.co...ance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.co...mance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=q224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/de...rfmon_24u1.asp
Disk Monitoring
Andrew J. Kelly SQL MVP
"Al Murphy" <almurph@.altavista.com> wrote in message
news:a23daf3f.0411240429.3f373918@.posting.google.c om...
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm
|||Al,
In addition to Andrew's and Waynes replies, you may wish to have a look
at some SQL Server stored procedures.
exec master..xp_fixeddrives
exec master..sp_monitor
I've found these useful in the past.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Al Murphy wrote:
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm

Disk capacity and CPU/memory utilisation question?

Folks,
This is a dumb question I know but I'm a newbie and require your
help. Can anyone answer the following 2 questions concerning SQL
Server 2000:
1. How do you check for disk capacity on a SQL Server 2000 box?
2. How do you look at a log of CPU/memory utilisation and the
processes running at that time?
Any commetns/ideas/suggestions - much appreciated.
Thank you,
ColmYou check disk capacity the same as with any other box...you can use
perfmon, etc... To see how much logical space is available INSIDE the
physical files, sp_spaceused will do it...
In order to save and look at processes that were running at a particular
time, you would run perfmon and save the output. Then you may go back and do
reports on specific time periods... There are also 3rd party monitoring
tools available to you..
Microsoft also has MOM. I forget what the acronym stands for, but it is an
operational tool for monitoring windows based machines. AND there is an
add-in for SQL Server as well... This is a sku'd product which you must
purchase.
If you wish to get into this in a BIG, do it yourself kind of way, take a
look at WMI. A microsoft scripting language which allows you to do many,
many different kinds of things..
--
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
"Al Murphy" <almurph@.altavista.com> wrote in message
news:a23daf3f.0411240429.3f373918@.posting.google.com...
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm|||In addition to Waynes wonderful response you might find these useful:
http://www.microsoft.com/sql/techinfo/administration/2000/perftuning.asp
Performance WP's
http://www.swynk.com/friends/vandenberg/perfmonitor.asp Perfmon counters
http://www.sql-server-performance.com/sql_server_performance_audit.asp
Hardware Performance CheckList
http://www.sql-server-performance.com/best_sql_server_performance_tips.asp
SQL 2000 Performance tuning tips
http://www.support.microsoft.com/?id=q224587 Troubleshooting App
Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_perfmon_24u1.asp
Disk Monitoring
Andrew J. Kelly SQL MVP
"Al Murphy" <almurph@.altavista.com> wrote in message
news:a23daf3f.0411240429.3f373918@.posting.google.com...
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colm|||Al,
In addition to Andrew's and Waynes replies, you may wish to have a look
at some SQL Server stored procedures.
exec master..xp_fixeddrives
exec master..sp_monitor
I've found these useful in the past.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Al Murphy wrote:
> Folks,
> This is a dumb question I know but I'm a newbie and require your
> help. Can anyone answer the following 2 questions concerning SQL
> Server 2000:
> 1. How do you check for disk capacity on a SQL Server 2000 box?
> 2. How do you look at a log of CPU/memory utilisation and the
> processes running at that time?
>
> Any commetns/ideas/suggestions - much appreciated.
> Thank you,
> Colmsql

Disk Alert (please help!)

Hi,
I want to setup an alert to let me know when my disk reaches 80% capacity
(20% space available).
I did the following :
1) Set the diskperf-ym switch and restarted the server.
2) Added the logical disk - disk free space counter in the perfmon
3) Set the alert value to over 80%
4) Sample data every 15 minutes.
My question is, how can i setup sql server to generate an email and send it
to the operators i create. I know that i can create custom alerts, but will
they read it from the windows event log for the above-mentioned
process..Kinda confused...please helpppp!!
Regards,
AndyHi Vishal,
Thank you for the link, however, my question still is , whether the
procedure, as per my previous mail is something that can be done ? will a
sql alert be able to read the windows application log and send email...if
that is the case then, i can do it the way i initially wanted to.
Thanks,
Andy
"Vishal Parkar" <vgparkar@.hotmail.com> wrote in message
news:udXP2EKRDHA.1556@.TK2MSFTNGP10.phx.gbl...
> Refer to this url
> http://www.databasejournal.com/scripts/article.php/1470811
> --
> -Vishal
> "Andy" <andy_rob108@.hotmail.com> wrote in message
> news:eACZ0$JRDHA.3768@.tk2msftngp13.phx.gbl...
> > Hi,
> >
> > I want to setup an alert to let me know when my disk reaches 80%
capacity
> > (20% space available).
> >
> > I did the following :
> >
> > 1) Set the diskperf-ym switch and restarted the server.
> > 2) Added the logical disk - disk free space counter in the perfmon
> > 3) Set the alert value to over 80%
> > 4) Sample data every 15 minutes.
> >
> > My question is, how can i setup sql server to generate an email and send
> it
> > to the operators i create. I know that i can create custom alerts, but
> will
> > they read it from the windows event log for the above-mentioned
> > process..Kinda confused...please helpppp!!
> >
> > Regards,
> > Andy
> >
> >
>|||Hi Andy,
I think your intended idea is not difficult to implement. Try this:
create a batch file (c:\spacealert.bat) that looks like:
osql -Sservername -Ppassword -Usa -Q"exec master..xp_sendmail @.recipients =operator, @.subject = 'disk space has exceeded limit'"
In the alert configuration window, on Action tab, click on "Run this
program" and browse to c:\spacealert.bat. This tells the alert when firing,
will trigger the batch file to execute xp_sendmail to email message to the
operators.
Richard
"Andy" <andy_rob108@.hotmail.com> wrote in message
news:eACZ0$JRDHA.3768@.tk2msftngp13.phx.gbl...
> Hi,
> I want to setup an alert to let me know when my disk reaches 80% capacity
> (20% space available).
> I did the following :
> 1) Set the diskperf-ym switch and restarted the server.
> 2) Added the logical disk - disk free space counter in the perfmon
> 3) Set the alert value to over 80%
> 4) Sample data every 15 minutes.
> My question is, how can i setup sql server to generate an email and send
it
> to the operators i create. I know that i can create custom alerts, but
will
> they read it from the windows event log for the above-mentioned
> process..Kinda confused...please helpppp!!
> Regards,
> Andy
>

2012年3月20日星期二

Disconnection when 'xp_cmd' is in a comment

If I run the following in Query Analyzer against Microsoft SQL Server
2000 - 8.00.818 while logged in as 'sa':
ALTER PROCEDURE __Test AS
BEGIN
/*
-- x p_cmd
*/
RETURN 0
END
GO
then all is well, but if I remove the space between the 'x' and the
'p' in the comment line then I get the following error:
[Microsoft][ODBC SQL Server Driver][TCP/IP
Sockets]ConnectionCheckForData (CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
ODBC: Msg 0, Level 16, State 1
Communication link failure
ODBC: Msg 0, Level 16, State 1
Communication link failure
Connection Broken
I am connecting remotely. Another user who is on the same domain as
the server does not have this problem. I assume some hardware or
software on the connection between the server and myself and the
server is causing the problem.
Does anyone have any idea what this could be?
Thanks
SylvesterIf it's hardware or software connectivity between you and
the server then you'd likely find something in the windows
event logs so you may want to start checking those.
-Sue
On 10 Oct 2004 22:01:39 -0700, junk@.riddell.co.nz
(Sylvester) wrote:

>If I run the following in Query Analyzer against Microsoft SQL Server
>2000 - 8.00.818 while logged in as 'sa':
>
> ALTER PROCEDURE __Test AS
> BEGIN
> /*
> -- x p_cmd
> */
> RETURN 0
> END
> GO
>then all is well, but if I remove the space between the 'x' and the
>'p' in the comment line then I get the following error:
> [Microsoft][ODBC SQL Server Driver][TCP/IP
>Sockets]ConnectionCheckForData (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> ODBC: Msg 0, Level 16, State 1
> Communication link failure
> ODBC: Msg 0, Level 16, State 1
> Communication link failure
> Connection Broken
>
>I am connecting remotely. Another user who is on the same domain as
>the server does not have this problem. I assume some hardware or
>software on the connection between the server and myself and the
>server is causing the problem.
>Does anyone have any idea what this could be?
>Thanks
>Sylvester

Disconnection when 'xp_cmd' is in a comment

If I run the following in Query Analyzer against Microsoft SQL Server
2000 - 8.00.818 while logged in as 'sa':
ALTER PROCEDURE __Test AS
BEGIN
/*
-- x p_cmd
*/
RETURN 0
END
GO
then all is well, but if I remove the space between the 'x' and the
'p' in the comment line then I get the following error:
[Microsoft][ODBC SQL Server Driver][TCP/IP
Sockets]ConnectionCheckForData (CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
ODBC: Msg 0, Level 16, State 1
Communication link failure
ODBC: Msg 0, Level 16, State 1
Communication link failure
Connection Broken
I am connecting remotely. Another user who is on the same domain as
the server does not have this problem. I assume some hardware or
software on the connection between the server and myself and the
server is causing the problem.
Does anyone have any idea what this could be?
Thanks
Sylvester
If it's hardware or software connectivity between you and
the server then you'd likely find something in the windows
event logs so you may want to start checking those.
-Sue
On 10 Oct 2004 22:01:39 -0700, junk@.riddell.co.nz
(Sylvester) wrote:

>If I run the following in Query Analyzer against Microsoft SQL Server
>2000 - 8.00.818 while logged in as 'sa':
>
> ALTER PROCEDURE __Test AS
> BEGIN
> /*
> -- x p_cmd
> */
>RETURN 0
> END
> GO
>then all is well, but if I remove the space between the 'x' and the
>'p' in the comment line then I get the following error:
> [Microsoft][ODBC SQL Server Driver][TCP/IP
>Sockets]ConnectionCheckForData (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> ODBC: Msg 0, Level 16, State 1
> Communication link failure
> ODBC: Msg 0, Level 16, State 1
> Communication link failure
> Connection Broken
>
>I am connecting remotely. Another user who is on the same domain as
>the server does not have this problem. I assume some hardware or
>software on the connection between the server and myself and the
>server is causing the problem.
>Does anyone have any idea what this could be?
>Thanks
>Sylvester

Disconnection when 'xp_cmd' is in a comment

If I run the following in Query Analyzer against Microsoft SQL Server
2000 - 8.00.818 while logged in as 'sa':
ALTER PROCEDURE __Test AS
BEGIN
/*
-- x p_cmd
*/
RETURN 0
END
GO
then all is well, but if I remove the space between the 'x' and the
'p' in the comment line then I get the following error:
[Microsoft][ODBC SQL Server Driver][TCP/IP
Sockets]ConnectionCheckForData (CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
ODBC: Msg 0, Level 16, State 1
Communication link failure
ODBC: Msg 0, Level 16, State 1
Communication link failure
Connection Broken
I am connecting remotely. Another user who is on the same domain as
the server does not have this problem. I assume some hardware or
software on the connection between the server and myself and the
server is causing the problem.
Does anyone have any idea what this could be?
Thanks
SylvesterIf it's hardware or software connectivity between you and
the server then you'd likely find something in the windows
event logs so you may want to start checking those.
-Sue
On 10 Oct 2004 22:01:39 -0700, junk@.riddell.co.nz
(Sylvester) wrote:
>If I run the following in Query Analyzer against Microsoft SQL Server
>2000 - 8.00.818 while logged in as 'sa':
>
> ALTER PROCEDURE __Test AS
> BEGIN
> /*
> -- x p_cmd
> */
> RETURN 0
> END
> GO
>then all is well, but if I remove the space between the 'x' and the
>'p' in the comment line then I get the following error:
> [Microsoft][ODBC SQL Server Driver][TCP/IP
>Sockets]ConnectionCheckForData (CheckforData()).
> Server: Msg 11, Level 16, State 1, Line 0
> General network error. Check your network documentation.
> ODBC: Msg 0, Level 16, State 1
> Communication link failure
> ODBC: Msg 0, Level 16, State 1
> Communication link failure
> Connection Broken
>
>I am connecting remotely. Another user who is on the same domain as
>the server does not have this problem. I assume some hardware or
>software on the connection between the server and myself and the
>server is causing the problem.
>Does anyone have any idea what this could be?
>Thanks
>Sylvester

disconnected import-export

Hi everybody,
I have the following problem: I have a very large data base used by our
clients for beta-testing. With prohibitions of just taking the data (using a
backup or so)
I can connect to this machine by accesing two terminal service - poor
network performance so on.
I have to take data out of this database - to have a proper "seed" for our
load test scenarios.
I tried bulk copy - well, I still have some problems with the inserts in our
database, but I am wondering wether is there a better way of automating the
task of exporting every table to a file using bcp - here comes the problem
wether I need a format file for every table)
Maybe I can achieve the same result in a more elegent way with DTS packages?
Is there a way to do this disconnected import export operation using dts and
some intermediery text/binary files that I can move between the machines?
Any help is welcomed,
Andreandrea,
Regarding moving data from one machine to another with bcp, you do not need
a format file for every table if: you:
1. Choose an overall format -c (character mode) or -n (native mode)
2. The table definitions between servers are identical.
Following is an example xfer.cmd file
-- BCPXFER.BAT
REM Parms %1=SourceServer %2=TargetServer %3=DatabaseName %4=TableName
%5=LogPath
bcp %3..%4 out \\Server\Xfer\%4.dat -c -S%1 -T -e%4-bcpout.log >> %5bcp.log
osql -S%1 -Q"truncate table %3..%4" -E >> %5bcp.log
bcp %3..%4 in \\Server\Xfer\ -c -S%2 -T -e%4-bcpout.log >> %5bcp.log
--
This makes some assumptions:
1. TRUNCATE TABLE will work on your target server, so there cannot be any
foreign key constraints for that to work. If there are FK constraints, you
will need to change to "delete table"
2. One trusted connection works on both servers. If this is not the case,
you will need to add more login information (including passwords) to the
parameter list.
3. Both servers can reach the same file share. If this is not true, then
you will need to insert a copy file step between the bcp out and the bcp in.
Etc. etc.
This is not a full solution for you, since there are many unknowns, but if
this works you then create a higher level BAT file in the form:
-- MyXfer.BAT
call bcpxfer.bat Server1 Server2 MyDatabase MyTable1 MyLogPath
call bcpxfer.bat Server1 Server2 MyDatabase MyTable2 MyLogPath
call bcpxfer.bat Server1 Server2 MyDatabase MyTable3 MyLogPath
RLF
PS - Are you the same person as Andrea Anastasescu?
"andrea" <a@.a.a> wrote in message
news:ex%23SKyB5HHA.464@.TK2MSFTNGP02.phx.gbl...
> Hi everybody,
> I have the following problem: I have a very large data base used by our
> clients for beta-testing. With prohibitions of just taking the data (using
> a backup or so)
> I can connect to this machine by accesing two terminal service - poor
> network performance so on.
> I have to take data out of this database - to have a proper "seed" for our
> load test scenarios.
> I tried bulk copy - well, I still have some problems with the inserts in
> our database, but I am wondering wether is there a better way of
> automating the task of exporting every table to a file using bcp - here
> comes the problem wether I need a format file for every table)
> Maybe I can achieve the same result in a more elegent way with DTS
> packages? Is there a way to do this disconnected import export operation
> using dts and some intermediery text/binary files that I can move between
> the machines?
> Any help is welcomed,
> Andre
>

2012年3月7日星期三

Disabling triggers with alter table, execute as?

I'm disabling some triggers in SQL Server 2000 with the following command
launched from another trigger:
ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
I want normal users to be able to run that command. Is there a kind of
"execute as" I can use in SQL Server 2000 to do it?
Thanks.Before I answer: are you sure you want to do this? The entire point of a
trigger is to fire regardless of user control. Be very careful here. I'm
going to lay out an option in 2000, but I don't endorse it's usage (I'm
presenting it simply because I don't know exactly what you're business goal
is - it may be perfectly valid).
Technically you could create a job that disables the trigger, then give
users access to the job and let them call it from within a stored procedure
or such. Be sure not to create a schedule for the job. With a SQL Agent job,
you can control (somewhat) the execution authority.
"b3nny80y" <b3nny80y@.discussions.microsoft.com> wrote in message
news:FF0D789D-3DE5-4354-B5A2-0AAE27CAFFB7@.microsoft.com...
> I'm disabling some triggers in SQL Server 2000 with the following command
> launched from another trigger:
> ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
> I want normal users to be able to run that command. Is there a kind of
> "execute as" I can use in SQL Server 2000 to do it?
> Thanks.|||Is that wise?
For the user to execute an ALTER table, they will have to be provided table
ownership privileges. That means that the users can alter the table anyway
they desire -DROP columns, ADD columns, DROP TABLE, etc.
If you are trying to stop nested Triggers, there is another way. Use
sp_configure to turn on/off the Using Nested Triggers configuration option.
(Or use Server properties in Enterprise Manager.)
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."
"b3nny80y" <b3nny80y@.discussions.microsoft.com> wrote in message
news:FF0D789D-3DE5-4354-B5A2-0AAE27CAFFB7@.microsoft.com...
> I'm disabling some triggers in SQL Server 2000 with the following command
> launched from another trigger:
> ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
> I want normal users to be able to run that command. Is there a kind of
> "execute as" I can use in SQL Server 2000 to do it?
> Thanks.|||b3nny80y wrote:
> I'm disabling some triggers in SQL Server 2000 with the following command
> launched from another trigger:
> ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
> I want normal users to be able to run that command. Is there a kind of
> "execute as" I can use in SQL Server 2000 to do it?
> Thanks.
Why would you want to do this? Please explain further what you're
trying to accomplish. If you're trying to disable the triggers for
specific users, you can accomplish the same effect by putting IF/ELSE
code in the trigger that checks the current username, and simply doesn't
execute the code in the trigger.
Tracy McKibben
MCDBA
http://www.realsqlguy.com

Disabling triggers with alter table, execute as?

I'm disabling some triggers in SQL Server 2000 with the following command
launched from another trigger:
ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
I want normal users to be able to run that command. Is there a kind of
"execute as" I can use in SQL Server 2000 to do it?
Thanks.Before I answer: are you sure you want to do this? The entire point of a
trigger is to fire regardless of user control. Be very careful here. I'm
going to lay out an option in 2000, but I don't endorse it's usage (I'm
presenting it simply because I don't know exactly what you're business goal
is - it may be perfectly valid).
Technically you could create a job that disables the trigger, then give
users access to the job and let them call it from within a stored procedure
or such. Be sure not to create a schedule for the job. With a SQL Agent job,
you can control (somewhat) the execution authority.
"b3nny80y" <b3nny80y@.discussions.microsoft.com> wrote in message
news:FF0D789D-3DE5-4354-B5A2-0AAE27CAFFB7@.microsoft.com...
> I'm disabling some triggers in SQL Server 2000 with the following command
> launched from another trigger:
> ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
> I want normal users to be able to run that command. Is there a kind of
> "execute as" I can use in SQL Server 2000 to do it?
> Thanks.|||Is that wise?
For the user to execute an ALTER table, they will have to be provided table
ownership privileges. That means that the users can alter the table anyway
they desire -DROP columns, ADD columns, DROP TABLE, etc.
If you are trying to stop nested Triggers, there is another way. Use
sp_configure to turn on/off the Using Nested Triggers configuration option.
(Or use Server properties in Enterprise Manager.)
--
Arnie Rowland*
"To be successful, your heart must accompany your knowledge."
"b3nny80y" <b3nny80y@.discussions.microsoft.com> wrote in message
news:FF0D789D-3DE5-4354-B5A2-0AAE27CAFFB7@.microsoft.com...
> I'm disabling some triggers in SQL Server 2000 with the following command
> launched from another trigger:
> ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
> I want normal users to be able to run that command. Is there a kind of
> "execute as" I can use in SQL Server 2000 to do it?
> Thanks.|||b3nny80y wrote:
> I'm disabling some triggers in SQL Server 2000 with the following command
> launched from another trigger:
> ALTER TABLE PM00300 DISABLE TRIGGER insPM00300
> I want normal users to be able to run that command. Is there a kind of
> "execute as" I can use in SQL Server 2000 to do it?
> Thanks.
Why would you want to do this? Please explain further what you're
trying to accomplish. If you're trying to disable the triggers for
specific users, you can accomplish the same effect by putting IF/ELSE
code in the trigger that checks the current username, and simply doesn't
execute the code in the trigger.
--
Tracy McKibben
MCDBA
http://www.realsqlguy.com

2012年2月19日星期日

Disable Save Changes prompt

Is there a way in SQL Mgt Studio to disable the "Save changes to the following items?" prompt that comes up every time I close a query window?

No, currently there is no way to disable the prompt to save unsaved changes in the T-SQL script editor.

You can submit suggestions for Management Studio functionality at http://connect.microsoft.com/sqlserver. We use customer feedback like this when we are prioritizing future work.

Thanks,

Steve

Disable Save Changes prompt

Is there a way in SQL Mgt Studio to disable the "Save changes to the following items?" prompt that comes up every time I close a query window?

No, currently there is no way to disable the prompt to save unsaved changes in the T-SQL script editor.

You can submit suggestions for Management Studio functionality at http://connect.microsoft.com/sqlserver. We use customer feedback like this when we are prioritizing future work.

Thanks,

Steve

2012年2月17日星期五

Disable grouping

I would like to be able to disable grouping depending on the value of parameter. At the moment I have the following expression for grouping:
=IIf(Parameters!Group2.Value.equals(""), false, Fields(Parameters!Group2.Value).Value)

What I am trying to do is if the value of the Group2 parameter = "" turn off grouping. Group2 is assigned a value from the following custom code:

Function Group2Value() As String
Dim Group As String
Group = ""
Select Case Report.Parameters!ReportType.Value
Case "1"

Group = ""

Case "2"

Group = "CategoryID"

Case "3"

Group = "StockFamilyID"

Case "4"

Group = "GroupID"

Case "5"

Group = ""

Case "6"

Group = "SaleableGLCodeID"

End Select
Return Group
End Function

However this is not working.

Can grouping be disabled and if so what am I doing wrong?

Thanks in advance.
can't you just set grouping to =1 ?

this technique can also be used in a matrix when you need an extra grouping for e.g. to display count AND amount but don't physically want to group the data|||

Yes, Grouping can be disabled.

Try doing the entire calculation in the custom code and place the name of the function in the expression for Grouping.

The Grouping expression as =Code.Group2Value()

Now based on whatever value is returned from the function Group2Value, the grouping will be done accordingly.

Regards,

Pradeep