Showing posts with label records. Show all posts
Showing posts with label records. Show all posts

Tuesday, March 27, 2012

Can i group records in an ador.recordset?

Hi,

I have the need to group records in an ador.recordset.

Is this possible and in that case how?

When I hear recordset, I have to assume that you are referring to classic ADO rather than ADO.Net. So I think it best to take this question up in the SQL Server Data Access forum. Moving the thread there.

- Danny

Can I get it back the deleted records?

Dear All,
If I used a SQL command "Delete" to delete for example 1000 records, can I
get it back after? It is because I executed the delete command and later
found out I need some records back. Thank you for your help.
DarylThere are two options:
1=2E Do a Restore (Perhaps you have a point in time backup of the
database with transaction logs)
2=2E If you capsulated the query in a transaction (which I assume you
didn=B4t) Roll it back with ROLLBACK
HTH, Jens Suessmeyer.|||Daryl
yes, if you are lucky. you have to resort to back up. when did you take last
back up?
If you have taken any back up just prior to you can apply that. Wait I
understand that is not there. so you have to depend on 'Point in time '
Recovery.
BOL Has this: But remember. It will restore back to that particulat time. So
all the oprations after that time are be done manually again. Anyway take
full back up with no_truncate option before doing anything.
To restore to a point in time BOL has this.
Expand a server group, and then expand a server.
Expand Databases, right-click the database, point to All Tasks, and then
click Restore Database.
In Restore as database, type or select the name of the database to restore,
if different from the default.
Click Database.
In the First backup to restore list, click the backup set to restore.
In the Restore list, select the database backup and one or more transaction
logs to restore.
Click Point in time restore, and then type values for Date and Time.
Click the Options tab, and then click Leave database operational. No
additional transaction logs can be restored.
--
search and read for point-in-time;point of failure and related topics before
doing anything
--
Take Preventive measures like using
1) use delete trigger to not to rollback when
@.@.rowcount >1 or some records( if it is practical for you)
2) use trigger to store in history tables if data is so crucial.
Regards
R.D
"Daryl" wrote:

> Dear All,
> If I used a SQL command "Delete" to delete for example 1000 records, can I
> get it back after? It is because I executed the delete command and later
> found out I need some records back. Thank you for your help.
>
> Daryl
>
>

Can I get back the deleted records

Dear All,
If I used a SQL command "Delete" to delete for example 1000 records, can I
get it back after? It is because I executed the delete command and later
found out I need some records back. Thank you for your help.
Daryl
Daryl,
some 3rd party tools will have this functionality eg Lumigent Log Explorer,
but there's nothing out of the box in SQL Server on a per-table basis. If
nothing else has happened, or if it is important enough, you could do a
point-in-time restore, assuming you have the relevant backup plan, however
in this case you'll lose all data changes made since this time (to all
tables). Another possibility is to do a restore but to a database of another
name, then synchronize the data between the 2 tables.
As an aside, one thing I do is use an explicit transaction before an update
or delete, and issue a commit once I've seen the rowcount, otherwise a
rollback - it has saved me more than once
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
sql

Can I get back the deleted records

Dear All,
If I used a SQL command "Delete" to delete for example 1000 records, can I
get it back after? It is because I executed the delete command and later
found out I need some records back. Thank you for your help.
DarylDaryl,
some 3rd party tools will have this functionality eg Lumigent Log Explorer,
but there's nothing out of the box in SQL Server on a per-table basis. If
nothing else has happened, or if it is important enough, you could do a
point-in-time restore, assuming you have the relevant backup plan, however
in this case you'll lose all data changes made since this time (to all
tables). Another possibility is to do a restore but to a database of another
name, then synchronize the data between the 2 tables.
As an aside, one thing I do is use an explicit transaction before an update
or delete, and issue a commit once I've seen the rowcount, otherwise a
rollback - it has saved me more than once
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Can I get back the deleted records

Dear All,
If I used a SQL command "Delete" to delete for example 1000 records, can I
get it back after? It is because I executed the delete command and later
found out I need some records back. Thank you for your help.
DarylDaryl,
some 3rd party tools will have this functionality eg Lumigent Log Explorer,
but there's nothing out of the box in SQL Server on a per-table basis. If
nothing else has happened, or if it is important enough, you could do a
point-in-time restore, assuming you have the relevant backup plan, however
in this case you'll lose all data changes made since this time (to all
tables). Another possibility is to do a restore but to a database of another
name, then synchronize the data between the 2 tables.
As an aside, one thing I do is use an explicit transaction before an update
or delete, and issue a commit once I've seen the rowcount, otherwise a
rollback - it has saved me more than once :)
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Sunday, March 25, 2012

can I export view result to excel ?

Good morning all,

I created a view that selects the rows of the records from a table that matches where condition.
I need to export the records to excel so I could send it out...
what is the best way to do?
Please tell me detail, I don't know much about SQL 2000, still learning.

Thank you,
YanorooUse the DTS wizard (import and export data in start menu->Microsoft SQL server).

The wizard will ask you the information needed in order to complete the operation. Select the MS-Excel driver as a destination (as well as the output filename), choose the first options (export tables an views) and select your view in particular.

Shouldn't be too hard.|||yes, I was able to do that!
Thank you!

Thursday, March 22, 2012

Can i debug/watch on the triggers INSERTED and DELETED records/values?

When i debug a trigger is it possible to add a WATCH
on the INSERTED or DELETED?

I think not, at least I couldn't figure out a way to do so.
Does someone have a suggestion on how I can see the values?

I did try to do something like

INSERT INTO TABLE1(NAME)
SELECT NAME FROM INSERTED

but this didn't work. When the trigger completed and I
went to see the TABLE1, there were no records in it.

Are there any documents, web links that describe ways
of debugging the trigger's INSERTED and DELETED?

Thank youOn Wed, 25 Jan 2006 13:29:59 -0500, serge wrote:

>When i debug a trigger is it possible to add a WATCH
>on the INSERTED or DELETED?

Hi Serge,

No. During debugging, it is (unfortunately) not possible to see the
contents of ANY tables.

>I think not, at least I couldn't figure out a way to do so.
>Does someone have a suggestion on how I can see the values?

You could add a SELECT to the trigger code, then test your code from
Query Analyzer. The values in the inserted and deleted pseudo-table
would go to the Query Analyzer results pane.

Or you could use SELECT INTO or INSERT ... SELECT to store the values in
a persistant table.

>I did try to do something like
>INSERT INTO TABLE1(NAME)
>SELECT NAME FROM INSERTED
>but this didn't work. When the trigger completed and I
>went to see the TABLE1, there were no records in it.

Hey, that's just what I suggested! <g
This should work. Some potential reasons for why it didn't work for you
are:
- Maybe the code never even reached the insert into statement? This
might be the case if the table TABLE1 didn;t exist at all after trigger
execution.
- Did you check that the table TABLE1 did not exist before the trigger
was executed? If it did, the command above would result in an error (and
you should have gotten an error message).
- Did you run the trigger with a zero-row operation? (I.e. an UPDATE or
DELETE, or an INSERT .. SELECT that affected 0 rows)
- Don't use a temp table for this. It will be removed when the trigger
execution finishes, as it only exists in the scope of the trigger.
- In a DELETTE trigger, the inserted table is ALWAYS empty.

All the above are just guesses, of course. I'd have to see the actual
code to help you further.

>Are there any documents, web links that describe ways
>of debugging the trigger's INSERTED and DELETED?
>Thank you

--
Hugo Kornelis, SQL Server MVP|||serge (sergea@.nospam.ehmail.com) writes:
> When i debug a trigger is it possible to add a WATCH
> on the INSERTED or DELETED?
> I think not, at least I couldn't figure out a way to do so.
> Does someone have a suggestion on how I can see the values?
> I did try to do something like
> INSERT INTO TABLE1(NAME)
> SELECT NAME FROM INSERTED
> but this didn't work. When the trigger completed and I
> went to see the TABLE1, there were no records in it.

In additions to Hugo's suggestions, keep in mind that if the trigger
fails, then the statement will be rolled back, and that includs the
data insertedvinto Table1

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||On Wed, 25 Jan 2006 22:27:44 +0000 (UTC), Erland Sommarskog wrote:

>serge (sergea@.nospam.ehmail.com) writes:
>> When i debug a trigger is it possible to add a WATCH
>> on the INSERTED or DELETED?
>>
>> I think not, at least I couldn't figure out a way to do so.
>> Does someone have a suggestion on how I can see the values?
>>
>> I did try to do something like
>>
>> INSERT INTO TABLE1(NAME)
>> SELECT NAME FROM INSERTED
>>
>> but this didn't work. When the trigger completed and I
>> went to see the TABLE1, there were no records in it.
>In additions to Hugo's suggestions, keep in mind that if the trigger
>fails, then the statement will be rolled back, and that includs the
>data insertedvinto Table1

Ah, of course. How could I forget it?

Time for bed, I guess :-)

Thanks, Erland!

--
Hugo Kornelis, SQL Server MVP|||Thanks Hugo, Erland.

Hugo,

>This should work. Some potential reasons for why it didn't work for you
>are:
>- Did you run the trigger with a zero-row operation? (I.e. an UPDATE or
>DELETE, or an INSERT .. SELECT that affected 0 rows)

I believe I was running an UPDATE statement with a zero-row operation.
But let's ignore that statement as now I've tested it again using a new
UPDATE statement that updates rows for sure. After testing the last 30
minutes I now understand things better.

I am able to INSERT the records from the trigger's INSERTED table
to the permanent table I created before running the update statement.

I also realized that when running in DEBUG mode I should make sure
to uncheck the DEBUG PROCEDURE's AUTO ROLL BACK check
box. This problem until I realized it kept me puzzled for 10 minutes.

>You could add a SELECT to the trigger code, then test your code from
>Query Analyzer. The values in the inserted and deleted pseudo-table
>would go to the Query Analyzer results pane.

Too bad ADD WATCH isn't available.
Anyone knows if SQL 2005 allows to add watches and monitor the
contents of the inserted and deleted when debugging triggers?

Thank you|||serge (sergea@.nospam.ehmail.com) writes:
> Anyone knows if SQL 2005 allows to add watches and monitor the
> contents of the inserted and deleted when debugging triggers?

I haven't tried debugging in SQL 2005, as it you only can debug from
Visual Studio. But I would not really expect so.

Personally, I have more or less stopped using the debugger. It usually
works when you want to debug your local server, but when connecting to
another, there is so much red tape. Debug PRINTs and SELECTs are easier
to handle.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||> Personally, I have more or less stopped using the debugger. It usually
> works when you want to debug your local server, but when connecting to
> another, there is so much red tape.

Sometimes I do debug remotely (maybe often). Are you saying it is not always
a
safe approach to debug remotely? "There is so much red tape": these
are known issues that happen frequently or in the very rare cases?
Would you know if there are MS KB on these problems or personal
experiences led you to stop debugging remotely?

Can you please list some situations where debugging remotely is not safe
or the problems you ran into are complicated to explain?

If this is the case then I should avoid debugging remotely and end up
using Terminal Services to connect to the SQL Server and debug locally?

> Debug PRINTs and SELECTs are easier to handle.

I just tried "SELECT * FROM INSERTED" and I saw the result
in the results pane so I am not sure why I had not tried this before.
Well, at least now I know and I won't need to create a table if I am
only interested in seeing the result during the debugging only.

Thanks Erland.|||On Thu, 26 Jan 2006 01:19:30 -0500, serge wrote:

(snip)
>>You could add a SELECT to the trigger code, then test your code from
>>Query Analyzer. The values in the inserted and deleted pseudo-table
>>would go to the Query Analyzer results pane.
>Too bad ADD WATCH isn't available.
>Anyone knows if SQL 2005 allows to add watches and monitor the
>contents of the inserted and deleted when debugging triggers?

Hi Serge,

I don't know. I haven't seen the debugging capabilities in SQL 2005 yet.

In SQL 2000, the debugger was integral part of the product. But that has
been removed from SQL 2005 - you can now only debug triggers and stored
procedures if you also have Visual Studio installed.

http://lab.msdn.microsoft.com/Produ...06-f50123f6d235

--
Hugo Kornelis, SQL Server MVP|||serge (sergea@.nospam.ehmail.com) writes:
> Sometimes I do debug remotely (maybe often). Are you saying it is not
> always a safe approach to debug remotely? "There is so much red tape":
> these are known issues that happen frequently or in the very rare cases?
> Would you know if there are MS KB on these problems or personal
> experiences led you to stop debugging remotely?

Unsafe? Yes, a little, although that was not really what I meant with
red tape. What I mean is simply that there are so many things have to
be aligned for it to work, that I don't find it worth the hassle.

Some time back, we found that debugging did not work when you had Windows
XP SP2 installed. I did some investigation, and found that hotfix
8.00.944 addressed this problem. (This hotfix is included in SP4.) I
installed hotfix on client and server. I also had to open port 135 in
Windows firewall. Now, port 135 is not any port: this is RPC, and a
prime attack surfaces for viruses. So opening port 135 is a little unsafe,
so there is all reason to only open it for the SQL Servers you want to
debug. (If is possible to open a port only for a certain IP address in
Windows firewall.) Eventually I got it working.

Then some months later, I felt like debugging again, but now I was out
of luck again. I did some inquires, and apparently our Windows admin had
decided to cut the number of permissions for the SQL Server service
account. I don't know exactly what permissions that are required, but
as it writes back to the client, it needs more than plain-user rights.

At this point, I just gave it up. These are not the only thing that
can stop debugging from working. And after all, what you can dig out
from the debugger can easily be achieved in other ways. Of course,
code that uses iterative approaches can be painful to debug that
way. But good SQL should not have much such code anyway. :-)

And, oh, there is one more possible issue with the debugger. Single-
stepping through a transaction is not that friendly if other users
needs to access the data.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||> Unsafe? Yes, a little, although that was not really what I meant with
> red tape. What I mean is simply that there are so many things have to
> be aligned for it to work, that I don't find it worth the hassle.
> Some time back, we found that debugging did not work when you had Windows
> XP SP2 installed. I did some investigation, and found that hotfix
> 8.00.944 addressed this problem. (This hotfix is included in SP4.) I
> installed hotfix on client and server. I also had to open port 135 in
> Windows firewall. Now, port 135 is not any port: this is RPC, and a
> prime attack surfaces for viruses. So opening port 135 is a little unsafe,
> so there is all reason to only open it for the SQL Servers you want to
> debug. (If is possible to open a port only for a certain IP address in
> Windows firewall.) Eventually I got it working.
> Then some months later, I felt like debugging again, but now I was out
> of luck again. I did some inquires, and apparently our Windows admin had
> decided to cut the number of permissions for the SQL Server service
> account. I don't know exactly what permissions that are required, but
> as it writes back to the client, it needs more than plain-user rights.
> At this point, I just gave it up. These are not the only thing that
> can stop debugging from working. And after all, what you can dig out
> from the debugger can easily be achieved in other ways. Of course,
> code that uses iterative approaches can be painful to debug that
> way. But good SQL should not have much such code anyway. :-)
> And, oh, there is one more possible issue with the debugger. Single-
> stepping through a transaction is not that friendly if other users
> needs to access the data.

Thanks for the detailed explanation. Some interesting information
that I'll keep in mind.|||> In SQL 2000, the debugger was integral part of the product. But that has
> been removed from SQL 2005 - you can now only debug triggers and stored
> procedures if you also have Visual Studio installed.
> http://lab.msdn.microsoft.com/Produ...06-f50123f6d235

Then I presume SQL 2005 Studio Management that comes with SQL 2005
is not a flavor of Visual Studio that can debug triggers.

Thanks Hugo.|||On Thu, 26 Jan 2006 22:57:53 -0500, serge wrote:

>> In SQL 2000, the debugger was integral part of the product. But that has
>> been removed from SQL 2005 - you can now only debug triggers and stored
>> procedures if you also have Visual Studio installed.
>>
>> http://lab.msdn.microsoft.com/Produ...06-f50123f6d235
>Then I presume SQL 2005 Studio Management that comes with SQL 2005
>is not a flavor of Visual Studio that can debug triggers.

Hi Serge,

That's correct. Management Studio is replacement for Enterprise Manager
plus Query Analyzer, but doesn't have the debugger.

--
Hugo Kornelis, SQL Server MVP

Monday, March 19, 2012

Can I add records to or delete them from an sql database throught Crystal Report

Hello. I would like to know if its possible to add records to an sql database field or delete from it through Crystal Reports? Basically, I wish to setup a html fill in form configured to crystal reports whereby I can pull out results and then if required I could add or delete any record.

Is this possible?

Please help.I dont think it is possible in CR
See if you find solution here
www.businessobjects.com|||Hello, Madhi. Thank you for your reply to my question (and any other questions I posted on the forum). I have found a way I can add and delete records from crystal reports to an sql database using sql commands and crystal formulas (via the business objects website). But its all very basic stuff as yet - good stuff, nevertheless.

I will look begin to look further into this. Thank you for you help.

Regards
Saf|||saf,
if you can please walk me throught how did you get it from that website. There is no forums or anything right? Thanks|||Here is the link for the Business Objects tutorial that I followed:

http://support.businessobjects.com/library/kbase/articles/c2011950.asp

It works. Please follow up on the link.

Can I achieve WITH(NOLOCK) on all joins in a stored procedure with a single command?

I have a number of reporting stored procedures that purely list
records and make no changes to the data. I have noticed that some of
these SPs are causing blocks so I am adding the WITH(NOLOCK) hint. For
a simple example :-
Select * from table1 WITH(NOLOCK)
INNER JOIN table2 WITH(NOLOCK) ON table1.UID=table2.UID
INNER JOIN table3 WITH(NOLOCK) ON table1.AnotherID=table3.AnotherID
LEFT OUTER JOIN table4 WITH(NOLOCK) ON table3.ThisID=table4.ThisID
There lots of these and many of them have lots of joins so I'm looking
for a way to apply WITH(NOLOCK) to the whole procedure and save myself
the time it takes to add the hint to each table/join. I know that it
is possible to use SET DEADLOCK_PRIORITY LOW, forcing the procedure to
volunteer as the deadlock victim, but this isn't suitable as I need
the procedure to return it's records.
Does anybody have a suggestion or am I looking ata couple of days of
ctrl-v'ing WITH(NOLOCK) everywhere?
Thanks,
LiamHow about below?
SET STRANSACTION ISOLATION LEVEL READ UNCOMMITTED
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Liam Weston" <liam_weston@.hotmail.com> wrote in message
news:5f9a8c3b.0310310227.436b158b@.posting.google.com...
> I have a number of reporting stored procedures that purely list
> records and make no changes to the data. I have noticed that some of
> these SPs are causing blocks so I am adding the WITH(NOLOCK) hint. For
> a simple example :-
> Select * from table1 WITH(NOLOCK)
> INNER JOIN table2 WITH(NOLOCK) ON table1.UID=table2.UID
> INNER JOIN table3 WITH(NOLOCK) ON table1.AnotherID=table3.AnotherID
> LEFT OUTER JOIN table4 WITH(NOLOCK) ON table3.ThisID=table4.ThisID
> There lots of these and many of them have lots of joins so I'm looking
> for a way to apply WITH(NOLOCK) to the whole procedure and save myself
> the time it takes to add the hint to each table/join. I know that it
> is possible to use SET DEADLOCK_PRIORITY LOW, forcing the procedure to
> volunteer as the deadlock victim, but this isn't suitable as I need
> the procedure to return it's records.
> Does anybody have a suggestion or am I looking ata couple of days of
> ctrl-v'ing WITH(NOLOCK) everywhere?
> Thanks,
> Liam|||Thanks, that's just what I was looking for.
Liam
"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@.cornerstone.se> wrote in message news:<uvCEm35nDHA.2312@.TK2MSFTNGP12.phx.gbl>...
> How about below?
> SET STRANSACTION ISOLATION LEVEL READ UNCOMMITTED
> --
> Tibor Karaszi, SQL Server MVP
> Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Liam Weston" <liam_weston@.hotmail.com> wrote in message
> news:5f9a8c3b.0310310227.436b158b@.posting.google.com...
> > I have a number of reporting stored procedures that purely list
> > records and make no changes to the data. I have noticed that some of
> > these SPs are causing blocks so I am adding the WITH(NOLOCK) hint. For
> > a simple example :-
> >
> > Select * from table1 WITH(NOLOCK)
> > INNER JOIN table2 WITH(NOLOCK) ON table1.UID=table2.UID
> > INNER JOIN table3 WITH(NOLOCK) ON table1.AnotherID=table3.AnotherID
> > LEFT OUTER JOIN table4 WITH(NOLOCK) ON table3.ThisID=table4.ThisID
> >
> > There lots of these and many of them have lots of joins so I'm looking
> > for a way to apply WITH(NOLOCK) to the whole procedure and save myself
> > the time it takes to add the hint to each table/join. I know that it
> > is possible to use SET DEADLOCK_PRIORITY LOW, forcing the procedure to
> > volunteer as the deadlock victim, but this isn't suitable as I need
> > the procedure to return it's records.
> >
> > Does anybody have a suggestion or am I looking ata couple of days of
> > ctrl-v'ing WITH(NOLOCK) everywhere?
> >
> > Thanks,
> >
> > Liam

Wednesday, March 7, 2012

Can anyone tell me why this returns an empty value?

@.Names is a query string passed in, I need to count the number of records as a result of the below query/

Dim

testAsStringDim sqlConnection3AsNew SqlConnection("data Source=EQ-520-WEB\SQLEXPRESS;Initial Catalog=CRDB.MDF;Integrated Security=True")Dim cmdAsNew SqlCommand

Dim returnValueAsObject

cmd.CommandText =

"SELECT COUNT(ReqID) AS Expr1, LineManager FROM TblReqMain GROUP BY LineManager HAVING (LineManager = @.Names)"

cmd.CommandType = Data.CommandType.Text

cmd.Connection = sqlConnection3

cmd.Parameters.Add(

"@.Names", Data.SqlDbType.NVarChar)

sqlConnection3.Open()

cmd.Parameters(

"@.Names").Value = testIf test =""ThenResponse.Write("An error occured")ExitSubElsereturnValue = cmd.ExecuteScalar()

sqlConnection3.Close()

Label6.Text =

"Number " & returnValue

Hi.

your steps is right but you must to be sure the (test) value that have the correct value.

also you must be sure if there is data in the specific value.for example if you trace that test=7 check if there is data must retrive in the query

SELECT COUNT(ReqID) AS Expr1, LineManager FROM TblReqMain GROUP BY LineManager HAVING (LineManager =7)

Hopes that help.

Friday, February 24, 2012

can any body tell my why this page does´t uppdate into sql

can any body tell my why this page does´t uppdate into my sql
i get no error but it does´t uppdate the records :(


<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Updating a Row of Data with Validation</title>
<style type="text/css">
#editPanel {
width:90%; padding:10; background:khaki;
border:thin outset}
#posted {
background:lightgreen; border:thin inset}
</style
<script language="C#" runat="server">
/* *********** Data base config ************ */

string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

/* *********** define DataBase Sql/Access data ************ */

string TheID;

protected void Page_Load ( object src, EventArgs e )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ("SELECT * FROM cars ORDER BY MessageDate desc",myConn);
myCmd.Connection = myConn;
TheID = Request.QueryString [ "TheID" ] ;
if ( !IsPostBack )
{
if ( TheID == null )
{
bindGrid ( );
loadPanel.Visible = true;
editPanel.Visible = false;
postPanel.Visible = false;
}
else
{
getMessage ( Request.QueryString [ "TheID" ] );
loadPanel.Visible = false;
editPanel.Visible = true;
postPanel.Visible = false;
}
}
else
{
loadPanel.Visible = false;
editPanel.Visible = false;
postPanel.Visible = true;
}
}

public void bindGrid ( )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ("SELECT TOP 10 * FROM cars",myConn);
SqlDataReader rdr;

myCmd.CommandText = "SELECT TOP 10 * FROM cars";

myConn.Open();

rdr = myCmd.ExecuteReader ( );
myGrid.DataSource = rdr;
myGrid.DataBind ( );
rdr.Close();
myConn.Close();

/*
myCmd.CommandText = "SELECT * FROM cars";
myConn.Open();

myGrid.DataSource=myCmd.ExecuteReader ( );
myGrid.DataSource = myCmd.ExecuteReader ( CommandBehavior.CloseConnection );
myGrid.DataBind ( );
*/
}

public void getMessage ( String TheID )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ( );
SqlDataAdapter myAdapter = new SqlDataAdapter ("select * from cars where ID=" + TheID, myConn );
DataTable msgDetails = new DataTable ( );
myAdapter.Fill ( msgDetails );
DataRowView myRow = msgDetails.DefaultView [ 0 ] ;

msgFastnumer.Value = myRow [ "Fastnumer" ].ToString ( );
msgTegund.Value = myRow [ "Tegund" ].ToString ( );
editPanel.DataBind ( );
}

public void updateMessage ( object src, EventArgs e )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ( );

myCmd.Connection = myConn;

SqlDataAdapter myAdapter = new SqlDataAdapter ("select * from cars where ID=" + TheID, myConn );
DataTable msgDetails = new DataTable ( );
myAdapter.Fill ( msgDetails );
DataRowView myRow = msgDetails.DefaultView [ 0 ] ;

SqlDataReader rdr;

if ( Page.IsValid )
{
myCmd.CommandText = "UPDATE cars SET Fastnumer=@.Fastnumer, Tegund=@.Tegund where id=" + TheID;

msgFastnumer.Value = myRow [ "Fastnumer" ].ToString ( );
msgTegund.Value = myRow [ "Tegund" ].ToString ( );

myCmd.Parameters.Add ( "@.Fastnumer", SqlDbType.NVarChar ).Value = msgFastnumer.Value;
myCmd.Parameters.Add ( "@.Tegund", SqlDbType.NVarChar ).Value = msgTegund.Value;

myConn.Open ( );
rdr = myCmd.ExecuteReader ( );
myGrid.DataSource = rdr;
myGrid.DataBind ( );
rdr.Close();
myConn.Close ( );

}
bindPostPanel ( TheID );
}

public void bindPostPanel ( String TheID )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ( );
SqlDataReader rdr;
myCmd.CommandText = "SELECT * FROM cars WHERE Id='" + TheID + "'";

myCmd.Connection = myConn;

myConn.Open();

rdr = myCmd.ExecuteReader ( CommandBehavior.SingleRow );
listDetails.DataSource = rdr;
listDetails.DataBind ( );
rdr.Close();
myConn.Close();

/*
myConn.Open ( );
listDetails.DataSource = myCmd.ExecuteReader ( CommandBehavior.SingleRow );
listDetails.DataBind ( );
myConn.Dispose ( );
*/

}
</script>
</head>
<body>
<div class="header"><h3>ADO.NET Primer:
<span class="hilite">Editing an Existing Record</span></h3>
</div>
<hr size="1" width="90%">
<br>
<center>
<asp:panel id="loadPanel" runat="server">
<h5>Select a Record to Edit</h5>
<asp:datagrid id="myGrid" runat="server" width="90%" cellpadding="5" gridlines="vertical" bordercolor="black"
borderwidth="1" font-size="8pt" backcolor="ghostwhite" alternatingitemstyle-backcolor="lightgray"
autogeneratecolumns="false">
<headerstyle backcolor="darkslategray" forecolor="khaki" height="25" font-bold />
<columns>
<asp:boundcolumn headertext="Date" datafield="Innsett" dataformatstring="{0:d}" />
<asp:hyperlinkcolumn headertext="Fastnumer" datanavigateurlfield="id" datanavigateurlformatstring="aspxtest.aspx?TheID={0}"
datatextfield="Fastnumer" />
<asp:boundcolumn headertext="Tegund" datafield="Tegund" />
</columns>
</asp:datagrid>
<p align="center">Back to top</p>
</asp:panel
<asp:panel id="editPanel" runat="server">
<h5>To save changes to the database, press Update.</h5>
<form runat="server">
<input type="hidden" id='msgDate' runat="server">
<table width="85%" cellspacing="1" cellpadding="3" border="0">
<col width="40%" align="right">
<col width="60%">
<tr>
<td>Fastnumer:</td>
<td><input id="msgFastnumer" runat="server">
<asp:requiredfieldvalidator runat="server" controltovalidate="msgFastnumer" errormessage="Sender's name cannot be blank. "
display="none" /></td>
</tr>
<tr>
<td>Your email address:</td>
<td><input id="msgEmail" runat="server">
<asp:regularexpressionvalidator runat="server" controltovalidate="msgEmail" validationexpression="^[\w-]+@.[\w-]+\.(com|net|org|edu|mil)$"
errormessage="Please enter a valid e-mail address. " display="none" /></td>
</tr>
<tr>
<td>Tegund:</td>
<td><input id="msgTegund" runat="server"></td>
</tr>
<tr>
<td>Your message:</td>
<td><textarea id="msgBody" rows="5" cols="35" runat="server"></textarea></td>
</tr>
</table>
<p>
<input type="submit" value="Update" runat="server" onServerClick="updateMessage">
<input type="reset" value="Cancel" onClick="self.location.replace ( 'aspxtest.aspx' ) "></p>
<asp:validationsummary runat="server" displaymode="SingleParagraph" showmessagebox="true" showsummary="false" />
</form>
</asp:panel>
<asp:panel id="postPanel" runat="server">
<h5>Thank you for editing your comments. This record has been updated.</h5>
<asp:datalist id="listDetails" width="85%" runat="server">
<itemtemplate>
<table id="posted" width="100%" cellspacing="1" cellpadding="5" border="0">
<col width="35%" align="right">
<tr>
<td>Date:</td>
<td><%# DataBinder.Eval ( Container.DataItem, "Innsett", "{0:d}" ) %></td>
</tr>
<tr>
<td>Name:</td>
<td><%# ( ( IDataRecord ) Container.DataItem ) [ "Fastnumer" ] %></td>
</tr>
<tr>
<td>Tegund:</td>
<td><%# ( ( IDataRecord ) Container.DataItem ) [ "Tegund" ] %></td>
</tr>
</table>
</itemtemplate>
</asp:datalist>
<p>
Back to Edit View
Select Another Record
</p>
</asp:panel>
</center>
<br>
<hr size="1" width="90%">
</body>
</html>

um.. this is unreadable. Are you sure you're returning any data?|||yes it does read the data out of the sql but it doesn´t uppdate the records
i am very new in asp.net i got this code from some tutorial page i dont remember where be cose i have been reading so many tutorial websites.

here you can see the code in action
http://demo.xodus.is/xman-manager/aspxTest.aspx|||why are you doing a "select * from ..." and then an update...why not just an update and call the bindgrid sub at the end..

hth|||i am very new in asp.net can you show me how that is done|||just build your sql stmt use parameterized query and execute it..
sample code:


dim mysql as string
'set up your connection string
Dim oCmd As New OledbCommand(sSQL, oCnn)
mysql="update <table> set col1=@.colval,col2=@.colval where Id=@.Id"
'Add up the parameter, associated it with its value
oCmd.Parameters.Add("col1",value1 )
oCmd.Parameters.Add("col2",value2 )
oCmd.Parameters.Add("id",Idvalue )
oCnn.Open()
oCmd.ExecutenonQuery()
oCnn.Close()

you need to modify the above code with your table names, col names and values from textboxes ..etc and as i said earlier call the bindgrid() again when done.

hth|||thx allot it does work now

Sunday, February 19, 2012

Can a stored procedure be viewed with trace?

Ok this should be easy but I haven't found an aswer.

I have a stored procedure in a SQL Server database I use it to add new records to a table. I assign values to parameters and ExecuteNonQuery();

I'm getting an error input string invalid. I'm sure its due to null values which I can troubleshoot on my own.

I know how to view the contents of an inline sql statement in classic ASP such as mySQL = "Select authors from pubs" and then Response.Write mySQL. But how do I do this for a stored procedure in .NET?

Tracing for the page is on. I've tried Trace.Write (sqlCommand1.CommandText); but I don't see the command text.

What am I missing?OK Got It. Went into SQL Server and used SQL Server Profiler.

Thursday, February 16, 2012

Can a field be made mandatory for just new records?

Hi,
Is there any way in SQL server 2000, of making a field mandatory in an
existing table (which already contains thousands of records), without
having to update all of the existing records?
In otherwords, can a field be made mandatory for just new records?
If not, is the only solution to code it into my front end application?
Thanks
ColinThis doesn't really make much sense to me, so far. What is the point of
making the column mandatory if you're not going to update the existing rows?
Is there some application limitation that requires a value? If so, why
would the limitation only be relevant on new rows? Can the application not
look at old rows? Why is it okay for an old row to be NULL and not for a
new row? Just trying to understand the logistics.
If you want only new rows to contain a value, then it is fairly trivial to
have your insert stored procedure (you are using stored procedures, right?)
make that parameter NOT optional, and return an error if it is NULL. (You
will probably want to slightly change your form appearance and/or
validation.) But you're not going to be able to enforce this at the table
level, as far as I can tell (but maybe if you detail your reasoning it may
spawn additional thought).
A
"Bobby" <bobby2@.blueyonder.co.uk> wrote in message
news:1189685999.863746.93220@.g4g2000hsf.googlegroups.com...
> Hi,
> Is there any way in SQL server 2000, of making a field mandatory in an
> existing table (which already contains thousands of records), without
> having to update all of the existing records?
> In otherwords, can a field be made mandatory for just new records?
> If not, is the only solution to code it into my front end application?
> Thanks
> Colin
>|||On 13 Sep, 13:31, "Aaron Bertrand [SQL Server MVP]"
<ten...@.dnartreb.noraa> wrote:
> This doesn't really make much sense to me, so far. What is the point of
> making the column mandatory if you're not going to update the existing rows?
> Is there some application limitation that requires a value? If so, why
> would the limitation only be relevant on new rows? Can the application not
> look at old rows? Why is it okay for an old row to be NULL and not for a
> new row? Just trying to understand the logistics.
>
My FE application is written in Access 2003. I have a form which I use
to create Purchase Orders. This form has a sub form for PO Items. Due
to a change in company procedures, I need to add four fields to the
sub form which all require user input. However, this only applies to
new POs. There is no sense in going back through five years worth of
(20,000) existing POs to make sure that all four columns conform and
have the correct data.
> If you want only new rows to contain a value, then it is fairly trivial to
> have your insert stored procedure (you are using stored procedures, right?)
> make that parameter NOT optional, and return an error if it is NULL. (You
> will probably want to slightly change your form appearance and/or
> validation.) But you're not going to be able to enforce this at the table
> level, as far as I can tell (but maybe if you detail your reasoning it may
> spawn additional thought).
>
I'm not using a stored procedure on this form, but perhaps that's the
answer.
Thanks for your help
Colin|||> new POs. There is no sense in going back through five years worth of
> (20,000) existing POs to make sure that all four columns conform and
> have the correct data.
No, but you could update them all in one shot with some token value (e.g.
N/A) and then you could apply your constraint and prevent further rows from
being un-populated.
A|||<snip>
> to a change in company procedures, I need to add four fields to the
> sub form which all require user input. However, this only applies to
> new POs. There is no sense in going back through five years worth of
> (20,000) existing POs to make sure that all four columns conform and
> have the correct data.
Before you go further, why don't you step through the process of what is
expected when someone modifies a PO created before your change (regardless
of how it is accomplished). Will your front-end somehow "know" that the PO
was created before the requirement and will correctly "adjust" its
appearance and logic to account for this not-present and not-required data?
If you have difficulty answering that question, then you are in a bit of a
cart-before-horse situation since you need to define the business logic
first.
There is an alternative that will support your stated goal. Create a
dependent table (in a 1-0/1) relationship that contains your new columns.
Your existing rows will have no associated row in this new table, while any
orders created (and, perhaps, modified) after this change will (or at least
can) have a row.|||On Sep 13, 7:19 am, Bobby <bob...@.blueyonder.co.uk> wrote:
> Hi,
> Is there any way in SQL server 2000, of making a field mandatory in an
> existing table (which already contains thousands of records), without
> having to update all of the existing records?
> In otherwords, can a field be made mandatory for just new records?
> If not, is the only solution to code it into my front end application?
> Thanks
> Colin
I agree with Aaron - you most likely don't want do it. Yet it is
doable:
CREATE TABLE a(i INT)
INSERT a(i) VALUES(NULL)
GO
ALTER TABLE a WITH NOCHECK ADD CONSTRAINT a_i_notnull CHECK(i IS NOT
NULL)
-- creates OK
GO
INSERT a(i) VALUES(NULL)
/*
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the CHECK constraint
"a_i_notnull". The conflict occurred in database "FinancialDW", table
"dbo.a", column 'i'.
The statement has been terminated.
*/|||> I agree with Aaron - you most likely don't want do it. Yet it is
> doable:
Yes, of course. Why do I always forget NOCHECK? Probably because it's not
a very good practice for this kind of situation. :-)
A

Tuesday, February 14, 2012

Can a burrito corrupt a single user's records?

I have a user of SQL-based CRM application. She is the only one who is
unable to see her associated contact records. She is also the only user on
the same electrical circuit as the kitchen at one of our offices. One day
someone was microwaving a frozen burrito and blew the circuit breaker. The
lights in the kitchen went out, the fridge and microwave stopped, and the PC
which had the application open, lost power. Has anyone else seen incidents
where power loss corrupts not an entire DB but an individual's records? Is
there a burrito brand that can prevent this from recurring (jk). Thanks,
Pancho.The important question is, was this a plain burrito, or was there cheese
involved? Oh, and I should probably also ask, black beans or pintos?
While you're figuring out the answer to that one, run DBCC CHECKDB on your
database and see if you can repair the issues. There may be more corruption
you're not seeing simply because no one else has retrieved the rows -- yet.
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> I have a user of SQL-based CRM application. She is the only one who is
> unable to see her associated contact records. She is also the only user
on
> the same electrical circuit as the kitchen at one of our offices. One day
> someone was microwaving a frozen burrito and blew the circuit breaker.
The
> lights in the kitchen went out, the fridge and microwave stopped, and the
PC
> which had the application open, lost power. Has anyone else seen
incidents
> where power loss corrupts not an entire DB but an individual's records?
Is
> there a burrito brand that can prevent this from recurring (jk). Thanks,
> Pancho.|||If the burrito is the culprit, I would like to suggest that it be called
Bandito Burrito... ;-)
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
>I have a user of SQL-based CRM application. She is the only one who is
> unable to see her associated contact records. She is also the only user
> on
> the same electrical circuit as the kitchen at one of our offices. One day
> someone was microwaving a frozen burrito and blew the circuit breaker.
> The
> lights in the kitchen went out, the fridge and microwave stopped, and the
> PC
> which had the application open, lost power. Has anyone else seen
> incidents
> where power loss corrupts not an entire DB but an individual's records?
> Is
> there a burrito brand that can prevent this from recurring (jk). Thanks,
> Pancho.|||MSDN has covered this topic in depth:
http://msdn.microsoft.com/products/...px?item=burrito
(ok, so I was having a little querystring fun... it's Friday, sue me.)
Pancho wrote:
>I have a user of SQL-based CRM application. She is the only one who is
>unable to see her associated contact records. She is also the only user on
>the same electrical circuit as the kitchen at one of our offices. One day
>someone was microwaving a frozen burrito and blew the circuit breaker. The
>lights in the kitchen went out, the fridge and microwave stopped, and the P
C
>which had the application open, lost power. Has anyone else seen incidents
>where power loss corrupts not an entire DB but an individual's records? Is
>there a burrito brand that can prevent this from recurring (jk). Thanks,
>Pancho.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forum...server/200508/1|||Can u send that burrito ,me i want to test on my production database
with 200 users.
They all are hungry
thanx this helps u
from
killer|||You got the path wrong:
http://msdn.microsoft.com/products/...px?item=burrito
:D
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Frefaln via droptable.com" <forum@.droptable.com> wrote in message
news:52BE5071FF4C0@.droptable.com...
> MSDN has covered this topic in depth:
>
http://msdn.microsoft.com/products/...burrito

>
> (ok, so I was having a little querystring fun... it's Friday, sue me.)
>
> Pancho wrote:
on[vbcol=seagreen]
day[vbcol=seagreen]
The[vbcol=seagreen]
PC[vbcol=seagreen]
incidents[vbcol=seagreen]
Is[vbcol=seagreen]
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200508/1|||I like it when somebody add a little bit of humor to our everyday problems.
Adding to what Adam said, check if the property "TORN_PAGE_DETECTION" is on
in this db.
AMB
"Adam Machanic" wrote:

> The important question is, was this a plain burrito, or was there cheese
> involved? Oh, and I should probably also ask, black beans or pintos?
> While you're figuring out the answer to that one, run DBCC CHECKDB on your
> database and see if you can repair the issues. There may be more corrupti
on
> you're not seeing simply because no one else has retrieved the rows -- yet
.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> on
> The
> PC
> incidents
> Is
>
>|||Perhaps a variant of Montezuma's Revenge?
"ChrisR" wrote:

> If the burrito is the culprit, I would like to suggest that it be called
> Bandito Burrito... ;-)
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
>
>|||Me too. But it really did happen!
"Frefaln via droptable.com" wrote:

> MSDN has covered this topic in depth:
> http://msdn.microsoft.com/products/...px?item=burrito
>
> (ok, so I was having a little querystring fun... it's Friday, sue me.)
>
> Pancho wrote:
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forum...server/200508/1
>|||Adam:
1. Thanks for the DBCC suggestion.
2. Early reports are that it was beef, bean and cheese. It may have been
the Tina's brand which are cheap but good.
3. Our engineers are attempting a workaround by running the microwave in
"Thaw" mode first to soften the burrito, then zapping it at full power to
heat before eating, for a briefer time period.

"Adam Machanic" wrote:

> The important question is, was this a plain burrito, or was there cheese
> involved? Oh, and I should probably also ask, black beans or pintos?
> While you're figuring out the answer to that one, run DBCC CHECKDB on your
> database and see if you can repair the issues. There may be more corrupti
on
> you're not seeing simply because no one else has retrieved the rows -- yet
.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> on
> The
> PC
> incidents
> Is
>
>

Can a burrito corrupt a single user's records?

I have a user of SQL-based CRM application. She is the only one who is
unable to see her associated contact records. She is also the only user on
the same electrical circuit as the kitchen at one of our offices. One day
someone was microwaving a frozen burrito and blew the circuit breaker. The
lights in the kitchen went out, the fridge and microwave stopped, and the PC
which had the application open, lost power. Has anyone else seen incidents
where power loss corrupts not an entire DB but an individual's records? Is
there a burrito brand that can prevent this from recurring (jk). Thanks,
Pancho.
The important question is, was this a plain burrito, or was there cheese
involved? Oh, and I should probably also ask, black beans or pintos?
While you're figuring out the answer to that one, run DBCC CHECKDB on your
database and see if you can repair the issues. There may be more corruption
you're not seeing simply because no one else has retrieved the rows -- yet.
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> I have a user of SQL-based CRM application. She is the only one who is
> unable to see her associated contact records. She is also the only user
on
> the same electrical circuit as the kitchen at one of our offices. One day
> someone was microwaving a frozen burrito and blew the circuit breaker.
The
> lights in the kitchen went out, the fridge and microwave stopped, and the
PC
> which had the application open, lost power. Has anyone else seen
incidents
> where power loss corrupts not an entire DB but an individual's records?
Is
> there a burrito brand that can prevent this from recurring (jk). Thanks,
> Pancho.
|||If the burrito is the culprit, I would like to suggest that it be called
Bandito Burrito... ;-)
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
>I have a user of SQL-based CRM application. She is the only one who is
> unable to see her associated contact records. She is also the only user
> on
> the same electrical circuit as the kitchen at one of our offices. One day
> someone was microwaving a frozen burrito and blew the circuit breaker.
> The
> lights in the kitchen went out, the fridge and microwave stopped, and the
> PC
> which had the application open, lost power. Has anyone else seen
> incidents
> where power loss corrupts not an entire DB but an individual's records?
> Is
> there a burrito brand that can prevent this from recurring (jk). Thanks,
> Pancho.
|||MSDN has covered this topic in depth:
http://msdn.microsoft.com/products/S...x?item=burrito
(ok, so I was having a little querystring fun... it's Friday, sue me.)
Pancho wrote:
>I have a user of SQL-based CRM application. She is the only one who is
>unable to see her associated contact records. She is also the only user on
>the same electrical circuit as the kitchen at one of our offices. One day
>someone was microwaving a frozen burrito and blew the circuit breaker. The
>lights in the kitchen went out, the fridge and microwave stopped, and the PC
>which had the application open, lost power. Has anyone else seen incidents
>where power loss corrupts not an entire DB but an individual's records? Is
>there a burrito brand that can prevent this from recurring (jk). Thanks,
>Pancho.
Message posted via droptable.com
http://www.droptable.com/Uwe/Forums...erver/200508/1
|||Can u send that burrito ,me i want to test on my production database
with 200 users.
They all are hungry
thanx this helps u
from
killer
|||You got the path wrong:
http://msdn.microsoft.com/products/S...x?item=burrito
:D
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
"Frefaln via droptable.com" <forum@.droptable.com> wrote in message
news:52BE5071FF4C0@.droptable.com...
> MSDN has covered this topic in depth:
>
http://msdn.microsoft.com/products/S...x?item=burrito[vbcol=seagreen]
>
> (ok, so I was having a little querystring fun... it's Friday, sue me.)
>
> Pancho wrote:
on[vbcol=seagreen]
day[vbcol=seagreen]
The[vbcol=seagreen]
PC[vbcol=seagreen]
incidents[vbcol=seagreen]
Is
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums...erver/200508/1
|||I like it when somebody add a little bit of humor to our everyday problems.
Adding to what Adam said, check if the property "TORN_PAGE_DETECTION" is on
in this db.
AMB
"Adam Machanic" wrote:

> The important question is, was this a plain burrito, or was there cheese
> involved? Oh, and I should probably also ask, black beans or pintos?
> While you're figuring out the answer to that one, run DBCC CHECKDB on your
> database and see if you can repair the issues. There may be more corruption
> you're not seeing simply because no one else has retrieved the rows -- yet.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> on
> The
> PC
> incidents
> Is
>
>
|||Perhaps a variant of Montezuma's Revenge?
"ChrisR" wrote:

> If the burrito is the culprit, I would like to suggest that it be called
> Bandito Burrito... ;-)
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
>
>
|||Me too. But it really did happen!
"Frefaln via droptable.com" wrote:

> MSDN has covered this topic in depth:
> http://msdn.microsoft.com/products/S...x?item=burrito
>
> (ok, so I was having a little querystring fun... it's Friday, sue me.)
>
> Pancho wrote:
>
> --
> Message posted via droptable.com
> http://www.droptable.com/Uwe/Forums...erver/200508/1
>
|||Adam:
1. Thanks for the DBCC suggestion.
2. Early reports are that it was beef, bean and cheese. It may have been
the Tina's brand which are cheap but good.
3. Our engineers are attempting a workaround by running the microwave in
"Thaw" mode first to soften the burrito, then zapping it at full power to
heat before eating, for a briefer time period.

"Adam Machanic" wrote:

> The important question is, was this a plain burrito, or was there cheese
> involved? Oh, and I should probably also ask, black beans or pintos?
> While you're figuring out the answer to that one, run DBCC CHECKDB on your
> database and see if you can repair the issues. There may be more corruption
> you're not seeing simply because no one else has retrieved the rows -- yet.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> on
> The
> PC
> incidents
> Is
>
>

Can a burrito corrupt a single user's records?

I have a user of SQL-based CRM application. She is the only one who is
unable to see her associated contact records. She is also the only user on
the same electrical circuit as the kitchen at one of our offices. One day
someone was microwaving a frozen burrito and blew the circuit breaker. The
lights in the kitchen went out, the fridge and microwave stopped, and the PC
which had the application open, lost power. Has anyone else seen incidents
where power loss corrupts not an entire DB but an individual's records? Is
there a burrito brand that can prevent this from recurring (jk). Thanks,
Pancho.The important question is, was this a plain burrito, or was there cheese
involved? Oh, and I should probably also ask, black beans or pintos?
While you're figuring out the answer to that one, run DBCC CHECKDB on your
database and see if you can repair the issues. There may be more corruption
you're not seeing simply because no one else has retrieved the rows -- yet.
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> I have a user of SQL-based CRM application. She is the only one who is
> unable to see her associated contact records. She is also the only user
on
> the same electrical circuit as the kitchen at one of our offices. One day
> someone was microwaving a frozen burrito and blew the circuit breaker.
The
> lights in the kitchen went out, the fridge and microwave stopped, and the
PC
> which had the application open, lost power. Has anyone else seen
incidents
> where power loss corrupts not an entire DB but an individual's records?
Is
> there a burrito brand that can prevent this from recurring (jk). Thanks,
> Pancho.|||If the burrito is the culprit, I would like to suggest that it be called
Bandito Burrito... ;-)
"Pancho" <Pancho@.discussions.microsoft.com> wrote in message
news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
>I have a user of SQL-based CRM application. She is the only one who is
> unable to see her associated contact records. She is also the only user
> on
> the same electrical circuit as the kitchen at one of our offices. One day
> someone was microwaving a frozen burrito and blew the circuit breaker.
> The
> lights in the kitchen went out, the fridge and microwave stopped, and the
> PC
> which had the application open, lost power. Has anyone else seen
> incidents
> where power loss corrupts not an entire DB but an individual's records?
> Is
> there a burrito brand that can prevent this from recurring (jk). Thanks,
> Pancho.|||MSDN has covered this topic in depth:
http://msdn.microsoft.com/products/SQL2k/errors/delicacies/mexican/highcarb/food.aspx?item=burrito
(ok, so I was having a little querystring fun... it's Friday, sue me.)
Pancho wrote:
>I have a user of SQL-based CRM application. She is the only one who is
>unable to see her associated contact records. She is also the only user on
>the same electrical circuit as the kitchen at one of our offices. One day
>someone was microwaving a frozen burrito and blew the circuit breaker. The
>lights in the kitchen went out, the fridge and microwave stopped, and the PC
>which had the application open, lost power. Has anyone else seen incidents
>where power loss corrupts not an entire DB but an individual's records? Is
>there a burrito brand that can prevent this from recurring (jk). Thanks,
>Pancho.
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1|||Can u send that burrito ,me i want to test on my production database
with 200 users.
They all are hungry
thanx this helps u
from
killer|||You got the path wrong:
http://msdn.microsoft.com/products/SQL2k/errors/delicacies/highcarb/mexican/food.aspx?item=burrito
:D
--
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Frefaln via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:52BE5071FF4C0@.SQLMonster.com...
> MSDN has covered this topic in depth:
>
http://msdn.microsoft.com/products/SQL2k/errors/delicacies/mexican/highcarb/food.aspx?item=burrito
>
> (ok, so I was having a little querystring fun... it's Friday, sue me.)
>
> Pancho wrote:
> >I have a user of SQL-based CRM application. She is the only one who is
> >unable to see her associated contact records. She is also the only user
on
> >the same electrical circuit as the kitchen at one of our offices. One
day
> >someone was microwaving a frozen burrito and blew the circuit breaker.
The
> >lights in the kitchen went out, the fridge and microwave stopped, and the
PC
> >which had the application open, lost power. Has anyone else seen
incidents
> >where power loss corrupts not an entire DB but an individual's records?
Is
> >there a burrito brand that can prevent this from recurring (jk). Thanks,
> >Pancho.
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1|||I like it when somebody add a little bit of humor to our everyday problems.
Adding to what Adam said, check if the property "TORN_PAGE_DETECTION" is on
in this db.
AMB
"Adam Machanic" wrote:
> The important question is, was this a plain burrito, or was there cheese
> involved? Oh, and I should probably also ask, black beans or pintos?
> While you're figuring out the answer to that one, run DBCC CHECKDB on your
> database and see if you can repair the issues. There may be more corruption
> you're not seeing simply because no one else has retrieved the rows -- yet.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> > I have a user of SQL-based CRM application. She is the only one who is
> > unable to see her associated contact records. She is also the only user
> on
> > the same electrical circuit as the kitchen at one of our offices. One day
> > someone was microwaving a frozen burrito and blew the circuit breaker.
> The
> > lights in the kitchen went out, the fridge and microwave stopped, and the
> PC
> > which had the application open, lost power. Has anyone else seen
> incidents
> > where power loss corrupts not an entire DB but an individual's records?
> Is
> > there a burrito brand that can prevent this from recurring (jk). Thanks,
> > Pancho.
>
>|||Perhaps a variant of Montezuma's Revenge?
"ChrisR" wrote:
> If the burrito is the culprit, I would like to suggest that it be called
> Bandito Burrito... ;-)
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> >I have a user of SQL-based CRM application. She is the only one who is
> > unable to see her associated contact records. She is also the only user
> > on
> > the same electrical circuit as the kitchen at one of our offices. One day
> > someone was microwaving a frozen burrito and blew the circuit breaker.
> > The
> > lights in the kitchen went out, the fridge and microwave stopped, and the
> > PC
> > which had the application open, lost power. Has anyone else seen
> > incidents
> > where power loss corrupts not an entire DB but an individual's records?
> > Is
> > there a burrito brand that can prevent this from recurring (jk). Thanks,
> > Pancho.
>
>|||Me too. But it really did happen!
"Frefaln via SQLMonster.com" wrote:
> MSDN has covered this topic in depth:
> http://msdn.microsoft.com/products/SQL2k/errors/delicacies/mexican/highcarb/food.aspx?item=burrito
>
> (ok, so I was having a little querystring fun... it's Friday, sue me.)
>
> Pancho wrote:
> >I have a user of SQL-based CRM application. She is the only one who is
> >unable to see her associated contact records. She is also the only user on
> >the same electrical circuit as the kitchen at one of our offices. One day
> >someone was microwaving a frozen burrito and blew the circuit breaker. The
> >lights in the kitchen went out, the fridge and microwave stopped, and the PC
> >which had the application open, lost power. Has anyone else seen incidents
> >where power loss corrupts not an entire DB but an individual's records? Is
> >there a burrito brand that can prevent this from recurring (jk). Thanks,
> >Pancho.
>
> --
> Message posted via SQLMonster.com
> http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200508/1
>|||Adam:
1. Thanks for the DBCC suggestion.
2. Early reports are that it was beef, bean and cheese. It may have been
the Tina's brand which are cheap but good.
3. Our engineers are attempting a workaround by running the microwave in
"Thaw" mode first to soften the burrito, then zapping it at full power to
heat before eating, for a briefer time period.
:)
"Adam Machanic" wrote:
> The important question is, was this a plain burrito, or was there cheese
> involved? Oh, and I should probably also ask, black beans or pintos?
> While you're figuring out the answer to that one, run DBCC CHECKDB on your
> database and see if you can repair the issues. There may be more corruption
> you're not seeing simply because no one else has retrieved the rows -- yet.
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.datamanipulation.net
> --
>
> "Pancho" <Pancho@.discussions.microsoft.com> wrote in message
> news:0E8A27CD-039E-4892-9F7D-1CF05F878269@.microsoft.com...
> > I have a user of SQL-based CRM application. She is the only one who is
> > unable to see her associated contact records. She is also the only user
> on
> > the same electrical circuit as the kitchen at one of our offices. One day
> > someone was microwaving a frozen burrito and blew the circuit breaker.
> The
> > lights in the kitchen went out, the fridge and microwave stopped, and the
> PC
> > which had the application open, lost power. Has anyone else seen
> incidents
> > where power loss corrupts not an entire DB but an individual's records?
> Is
> > there a burrito brand that can prevent this from recurring (jk). Thanks,
> > Pancho.
>
>|||Suggest you select a pilot group of 20. Maybe 10 bean and cheese, 10 chicken
or beef. SELECT FName, Lname FROM Employees WHERE EnjoysBurritos = 1
"doller" wrote:
> Can u send that burrito ,me i want to test on my production database
> with 200 users.
> They all are hungry
>
> thanx this helps u
> from
> killer
>|||"Pancho" wrote:
> Suggest you select a pilot group of 20. Maybe 10 bean and cheese, 10 chicken
> or beef. SELECT FName, Lname FROM Employees WHERE EnjoysBurritos = 1
> "doller" wrote:
> > Can u send that burrito ,me i want to test on my production database
> > with 200 users.
> > They all are hungry
> >
> >
> > thanx this helps u
> >
> > from
> > killer
> >
> >
Im killing it man - the funniest sql thread I have ever seen :-)
(btw - your burrito is being put in as Nvarchar right?)|||Yep, time to let it. Go. Thanks everyone for a good thread. Yes, it was
Nvarchar!
pancho
"badlydressedboy" wrote:
>
> "Pancho" wrote:
> > Suggest you select a pilot group of 20. Maybe 10 bean and cheese, 10 chicken
> > or beef. SELECT FName, Lname FROM Employees WHERE EnjoysBurritos = 1
> >
> > "doller" wrote:
> >
> > > Can u send that burrito ,me i want to test on my production database
> > > with 200 users.
> > > They all are hungry
> > >
> > >
> > > thanx this helps u
> > >
> > > from
> > > killer
> > >
> > >
> Im killing it man - the funniest sql thread I have ever seen :-)
> (btw - your burrito is being put in as Nvarchar right?)