Showing posts with label retrieve. Show all posts
Showing posts with label retrieve. Show all posts

Monday, March 12, 2012

Question about Delete and Latency

I am in the process of returning a machine running SQL Server back to
our provider. However, I don't want them to retrieve any of our data
stored in the DB. So I have the following 2 options
a) delete the rows from tables
b) remove the MDB file
Which of the options is better?
If I just delete the rows, will the SQL Server delete them from the
MDB file immediately?
If I remove the MDB file, can anyone put it back?
For instance, the Exchange Server use SQL Server and deleting a
mailbox will retain the data for about 14 days. Is there a similar
provision in SQL Server that retains the data. I don't want our
provider to retrieve any of the data.
Many thanks for reading and looking forward to repliesOn 18.05.2007 15:40, soup_or_power@.yahoo.com wrote:
> I am in the process of returning a machine running SQL Server back to
> our provider. However, I don't want them to retrieve any of our data
> stored in the DB. So I have the following 2 options
> a) delete the rows from tables
> b) remove the MDB file
> Which of the options is better?
> If I just delete the rows, will the SQL Server delete them from the
> MDB file immediately?
> If I remove the MDB file, can anyone put it back?
> For instance, the Exchange Server use SQL Server and deleting a
> mailbox will retain the data for about 14 days. Is there a similar
> provision in SQL Server that retains the data. I don't want our
> provider to retrieve any of the data.
> Many thanks for reading and looking forward to replies
Depends in what state you have to give the machine back. If you don't
need to care for OS then the most thorough and simple is probably to
boot the machine using Knoppix or a similar CD/DVD distro and use dd
if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
Other than that there are special tools for safely erasing data, i.e.
you could overwrite your mdf and ldf files with zeros after you
deactivated your DB and before you drop the DB.
Kind regards
robert|||On May 18, 9:04 am, Robert Klemme <shortcut...@.googlemail.com> wrote:
> On 18.05.2007 15:40, soup_or_po...@.yahoo.com wrote:
>
>
> > I am in the process of returning a machine running SQL Server back to
> > our provider. However, I don't want them to retrieve any of our data
> > stored in the DB. So I have the following 2 options
> > a) delete the rows from tables
> > b) remove the MDB file
> > Which of the options is better?
> > If I just delete the rows, will the SQL Server delete them from the
> > MDB file immediately?
> > If I remove the MDB file, can anyone put it back?
> > For instance, the Exchange Server use SQL Server and deleting a
> > mailbox will retain the data for about 14 days. Is there a similar
> > provision in SQL Server that retains the data. I don't want our
> > provider to retrieve any of the data.
> > Many thanks for reading and looking forward to replies
> Depends in what state you have to give the machine back. If you don't
> need to care for OS then the most thorough and simple is probably to
> boot the machine using Knoppix or a similar CD/DVD distro and use dd
> if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
> Other than that there are special tools for safely erasing data, i.e.
> you could overwrite your mdf and ldf files with zeros after you
> deactivated your DB and before you drop the DB.
> Kind regards
> robert- Hide quoted text -
> - Show quoted text -
Hi Robert
Many thanks for your reply. Could you name the tools for safely
erasing data? Also how can I "deactive" the DB?
Regards|||On 18.05.2007 16:22, soup_or_power@.yahoo.com wrote:
> On May 18, 9:04 am, Robert Klemme <shortcut...@.googlemail.com> wrote:
>> On 18.05.2007 15:40, soup_or_po...@.yahoo.com wrote:
>>
>>
>> I am in the process of returning a machine running SQL Server back to
>> our provider. However, I don't want them to retrieve any of our data
>> stored in the DB. So I have the following 2 options
>> a) delete the rows from tables
>> b) remove the MDB file
>> Which of the options is better?
>> If I just delete the rows, will the SQL Server delete them from the
>> MDB file immediately?
>> If I remove the MDB file, can anyone put it back?
>> For instance, the Exchange Server use SQL Server and deleting a
>> mailbox will retain the data for about 14 days. Is there a similar
>> provision in SQL Server that retains the data. I don't want our
>> provider to retrieve any of the data.
>> Many thanks for reading and looking forward to replies
>> Depends in what state you have to give the machine back. If you don't
>> need to care for OS then the most thorough and simple is probably to
>> boot the machine using Knoppix or a similar CD/DVD distro and use dd
>> if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
>> Other than that there are special tools for safely erasing data, i.e.
>> you could overwrite your mdf and ldf files with zeros after you
>> deactivated your DB and before you drop the DB.
>> Kind regards
>> robert- Hide quoted text -
>> - Show quoted text -
> Hi Robert
> Many thanks for your reply. Could you name the tools for safely
> erasing data?
I don't have names. You will have to look for yourself. Sorry.
> Also how can I "deactive" the DB?
EM -> select DB -> all tasks -> detach database
robert|||"Robert Klemme" <shortcutter@.googlemail.com> wrote in message
news:5b5s08F2g0fupU1@.mid.individual.net...
> On 18.05.2007 16:22, soup_or_power@.yahoo.com wrote:
>> On May 18, 9:04 am, Robert Klemme <shortcut...@.googlemail.com> wrote:
>> On 18.05.2007 15:40, soup_or_po...@.yahoo.com wrote:
>>
>>
>> I am in the process of returning a machine running SQL Server back to
>> our provider. However, I don't want them to retrieve any of our data
>> stored in the DB. So I have the following 2 options
>> a) delete the rows from tables
>> b) remove the MDB file
>> Which of the options is better?
>> If I just delete the rows, will the SQL Server delete them from the
>> MDB file immediately?
>> If I remove the MDB file, can anyone put it back?
>> For instance, the Exchange Server use SQL Server and deleting a
>> mailbox will retain the data for about 14 days. Is there a similar
>> provision in SQL Server that retains the data. I don't want our
>> provider to retrieve any of the data.
>> Many thanks for reading and looking forward to replies
>> Depends in what state you have to give the machine back. If you don't
>> need to care for OS then the most thorough and simple is probably to
>> boot the machine using Knoppix or a similar CD/DVD distro and use dd
>> if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
>> Other than that there are special tools for safely erasing data, i.e.
>> you could overwrite your mdf and ldf files with zeros after you
>> deactivated your DB and before you drop the DB.
>> Kind regards
>> robert- Hide quoted text -
>> - Show quoted text -
>> Hi Robert
>> Many thanks for your reply. Could you name the tools for safely
>> erasing data?
> I don't have names. You will have to look for yourself. Sorry.
>> Also how can I "deactive" the DB?
> EM -> select DB -> all tasks -> detach database
>
Note that will leave the MDF and LDF files still on the server.
he's better of DELETING the database (assuming he can't format the drive or
something like that.)
> robert
--
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||On 19.05.2007 16:08, Greg D. Moore (Strider) wrote:
> "Robert Klemme" <shortcutter@.googlemail.com> wrote in message
> news:5b5s08F2g0fupU1@.mid.individual.net...
>> On 18.05.2007 16:22, soup_or_power@.yahoo.com wrote:
>> On May 18, 9:04 am, Robert Klemme <shortcut...@.googlemail.com> wrote:
>> On 18.05.2007 15:40, soup_or_po...@.yahoo.com wrote:
>>
>>
>> I am in the process of returning a machine running SQL Server back to
>> our provider. However, I don't want them to retrieve any of our data
>> stored in the DB. So I have the following 2 options
>> a) delete the rows from tables
>> b) remove the MDB file
>> Which of the options is better?
>> If I just delete the rows, will the SQL Server delete them from the
>> MDB file immediately?
>> If I remove the MDB file, can anyone put it back?
>> For instance, the Exchange Server use SQL Server and deleting a
>> mailbox will retain the data for about 14 days. Is there a similar
>> provision in SQL Server that retains the data. I don't want our
>> provider to retrieve any of the data.
>> Many thanks for reading and looking forward to replies
>> Depends in what state you have to give the machine back. If you don't
>> need to care for OS then the most thorough and simple is probably to
>> boot the machine using Knoppix or a similar CD/DVD distro and use dd
>> if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
>> Other than that there are special tools for safely erasing data, i.e.
>> you could overwrite your mdf and ldf files with zeros after you
>> deactivated your DB and before you drop the DB.
>> Kind regards
>> robert- Hide quoted text -
>> - Show quoted text -
>> Hi Robert
>> Many thanks for your reply. Could you name the tools for safely
>> erasing data?
>> I don't have names. You will have to look for yourself. Sorry.
>> Also how can I "deactive" the DB?
>> EM -> select DB -> all tasks -> detach database
> Note that will leave the MDF and LDF files still on the server.
> he's better of DELETING the database (assuming he can't format the drive or
> something like that.)
Yes, I know. That was just the explanation of *one* of the steps (see
my earlier posting).
robert

Question about Delete and Latency

I am in the process of returning a machine running SQL Server back to
our provider. However, I don't want them to retrieve any of our data
stored in the DB. So I have the following 2 options
a) delete the rows from tables
b) remove the MDB file
Which of the options is better?
If I just delete the rows, will the SQL Server delete them from the
MDB file immediately?
If I remove the MDB file, can anyone put it back?
For instance, the Exchange Server use SQL Server and deleting a
mailbox will retain the data for about 14 days. Is there a similar
provision in SQL Server that retains the data. I don't want our
provider to retrieve any of the data.
Many thanks for reading and looking forward to repliesOn 18.05.2007 15:40, soup_or_power@.yahoo.com wrote:
> I am in the process of returning a machine running SQL Server back to
> our provider. However, I don't want them to retrieve any of our data
> stored in the DB. So I have the following 2 options
> a) delete the rows from tables
> b) remove the MDB file
> Which of the options is better?
> If I just delete the rows, will the SQL Server delete them from the
> MDB file immediately?
> If I remove the MDB file, can anyone put it back?
> For instance, the Exchange Server use SQL Server and deleting a
> mailbox will retain the data for about 14 days. Is there a similar
> provision in SQL Server that retains the data. I don't want our
> provider to retrieve any of the data.
> Many thanks for reading and looking forward to replies
Depends in what state you have to give the machine back. If you don't
need to care for OS then the most thorough and simple is probably to
boot the machine using Knoppix or a similar CD/DVD distro and use dd
if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
Other than that there are special tools for safely erasing data, i.e.
you could overwrite your mdf and ldf files with zeros after you
deactivated your DB and before you drop the DB.
Kind regards
robert|||On May 18, 9:04 am, Robert Klemme <shortcut...@.googlemail.com> wrote:
> On 18.05.2007 15:40, soup_or_po...@.yahoo.com wrote:
>
>
>
>
>
>
>
>
> Depends in what state you have to give the machine back. If you don't
> need to care for OS then the most thorough and simple is probably to
> boot the machine using Knoppix or a similar CD/DVD distro and use dd
> if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
> Other than that there are special tools for safely erasing data, i.e.
> you could overwrite your mdf and ldf files with zeros after you
> deactivated your DB and before you drop the DB.
> Kind regards
> robert- Hide quoted text -
> - Show quoted text -
Hi Robert
Many thanks for your reply. Could you name the tools for safely
erasing data? Also how can I "deactive" the DB?
Regards|||On 18.05.2007 16:22, soup_or_power@.yahoo.com wrote:
> On May 18, 9:04 am, Robert Klemme <shortcut...@.googlemail.com> wrote:
> Hi Robert
> Many thanks for your reply. Could you name the tools for safely
> erasing data?
I don't have names. You will have to look for yourself. Sorry.

> Also how can I "deactive" the DB?
EM -> select DB -> all tasks -> detach database
robert|||"Robert Klemme" <shortcutter@.googlemail.com> wrote in message
news:5b5s08F2g0fupU1@.mid.individual.net...
> On 18.05.2007 16:22, soup_or_power@.yahoo.com wrote:
> I don't have names. You will have to look for yourself. Sorry.
>
> EM -> select DB -> all tasks -> detach database
>
Note that will leave the MDF and LDF files still on the server.
he's better of DELETING the database (assuming he can't format the drive or
something like that.)

> robert
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||On 19.05.2007 16:08, Greg D. Moore (Strider) wrote:
> "Robert Klemme" <shortcutter@.googlemail.com> wrote in message
> news:5b5s08F2g0fupU1@.mid.individual.net...
> Note that will leave the MDF and LDF files still on the server.
> he's better of DELETING the database (assuming he can't format the drive o
r
> something like that.)
Yes, I know. That was just the explanation of *one* of the steps (see
my earlier posting).
robert

Question about Delete and Latency

I am in the process of returning a machine running SQL Server back to
our provider. However, I don't want them to retrieve any of our data
stored in the DB. So I have the following 2 options
a) delete the rows from tables
b) remove the MDB file
Which of the options is better?
If I just delete the rows, will the SQL Server delete them from the
MDB file immediately?
If I remove the MDB file, can anyone put it back?
For instance, the Exchange Server use SQL Server and deleting a
mailbox will retain the data for about 14 days. Is there a similar
provision in SQL Server that retains the data. I don't want our
provider to retrieve any of the data.
Many thanks for reading and looking forward to replies
On 18.05.2007 15:40, soup_or_power@.yahoo.com wrote:
> I am in the process of returning a machine running SQL Server back to
> our provider. However, I don't want them to retrieve any of our data
> stored in the DB. So I have the following 2 options
> a) delete the rows from tables
> b) remove the MDB file
> Which of the options is better?
> If I just delete the rows, will the SQL Server delete them from the
> MDB file immediately?
> If I remove the MDB file, can anyone put it back?
> For instance, the Exchange Server use SQL Server and deleting a
> mailbox will retain the data for about 14 days. Is there a similar
> provision in SQL Server that retains the data. I don't want our
> provider to retrieve any of the data.
> Many thanks for reading and looking forward to replies
Depends in what state you have to give the machine back. If you don't
need to care for OS then the most thorough and simple is probably to
boot the machine using Knoppix or a similar CD/DVD distro and use dd
if=/dev/zero of=/dev/hda (for all disks) to erase all your hard disks.
Other than that there are special tools for safely erasing data, i.e.
you could overwrite your mdf and ldf files with zeros after you
deactivated your DB and before you drop the DB.
Kind regards
robert

Saturday, February 25, 2012

question about "System.Data.SqlClient.SqlException"

I'm trying to retrieve an image from my ms sql server 2005, and i'm using VS2005...however, i have the following error during the compilation process

Code in webform2.aspx.vb:

Partial Class webform2
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim connstr As String = "Data Source=DCPRJ007\SQLEXPRESS;Initial Catalog=mydatabase;Integrated Security=True"
Dim cnn As New Data.SqlClient.SqlConnection(connstr)
Dim cmd As New Data.SqlClient.SqlCommand("select * from dbo.images where id=" & Request.QueryString("id"), cnn)
cnn.Open()
Dim dr As Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
Dim bindata() As Byte = dr.GetValue(1)
Response.BinaryWrite(bindata)
End Sub
End Class

System.Data.SqlClient.SqlException was unhandled by user code
Class=15
ErrorCode=-2146232060
LineNumber=1
Message="Incorrect syntax near '='."
Number=102
Procedure=""
Server="DCPRJ007\SQLEXPRESS"
Source=".Net SqlClient Data Provider"
State=1
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at webform2.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite7\webform2.aspx.vb:line 10
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Are you sure you are getting value in the Request.QueryString("id") ? If not, your select statement will have an incorrect syntax and so is the exception. keep a break point and debug to find out.

Thanks

|||

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim connstr As String = "Data Source=DCPRJ007\SQLEXPRESS;Initial Catalog=mydatabase;Integrated Security=True"
Dim cnn As New Data.SqlClient.SqlConnection(connstr)
Dim cmd As New Data.SqlClient.SqlCommand("select * from dbo.images where id=" & Request.QueryString("id"), cnn)
cnn.Open()
Dim dr As Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
Dim bindata() As Byte = dr.GetValue(1)
Response.BinaryWrite(bindata)
End Sub
End Class

i found that...this line is highlighted during debugging, what is problem with this statement?

error message is : Incorrect syntax near '='.

thx a lot!!

|||

Are you sure, you have some value in Request.QueryString("id") ?

Thanks

|||

gaze:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim connstr As String = "Data Source=DCPRJ007\SQLEXPRESS;Initial Catalog=mydatabase;Integrated Security=True"
Dim cnn As New Data.SqlClient.SqlConnection(connstr)
Dim cmd As New Data.SqlClient.SqlCommand("select * from dbo.images where id=" & Request.QueryString("id"), cnn)
cnn.Open()
Dim dr As Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
Dim bindata() As Byte = dr.GetValue(1)
Response.BinaryWrite(bindata)
End Sub
End Class

i found that...this line is highlighted during debugging, what is problem with this statement?

error message is : Incorrect syntax near '='.

thx a lot!!

Dim cmd As New Data.SqlClient.SqlCommand("select * from dbo.images where id=" & Request.QueryString("id"), cnn)

try

Dim cmd As New Data.SqlClient.SqlCommand("select * from dbo.images where id='" & Request.QueryString("id") & "'", cnn)

means ... use single cote before and after the your id.

If you think this post helped you marked as read.