Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Thursday, March 29, 2012

Basic Question: Setting a varaiable to a datasource.select value

Hi!


I am trying to do something that I would think should be rather simple.

I have a SQLDataSource that has a simple select statement.

I have a String Variable st_temp

I know my SQLDataSource returns only one value, and it's a string.

HOW DO I DO somehitng like st_temp=SQLDataSource.Select;

I am getting nothing but errorrs

Thanks in advance

Dan

What errors are you getting?|||

If you are using just a single value then there is no need for SQLDataSource object. You can directly use SQLCommand.ExecuteScalar() method.

|||

2 things:

1. sorry to be so dense but how do I use SQLCommand.ExecuteScalar() method. in C#?

2. Errors are

":CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement" when I call SDSSelect.Select;

and

":CS0428: Cannot convert method group 'Select' to non-delegate type 'string'. Did you intend to invoke the method?" when I call Label1.Text= SDSSelect.Select;



Thanks again for the help...i shouldda stayed in Java land!|||

Thanks for all the HELP!!!

Dan

Sunday, March 25, 2012

Basic Connection String

Could someone please show me a basic connection string, please?Tryhttp://www.connectionstrings.com as a resource.|||

I did, it can't connect.

|||We need your code and the exact error information in order to provide any meaningful assistance.|||

Ok, I've figured out the problem. I need a username and password. How would I find that?

|||You need a username and password if you are using SQL Authentication (typical when your database is hosted remotely); they are not needed if you are using Windows Authentication (typical when your database is on your network).

The system administrator should be able to provide you the required username and password credentials for SQL Authentication.|||

Thanks I got it to work.

barcode to image function does not work...

I have built a custom function in my report to convert my barcode data into a
barcode image. The data is a string from the database my images are made
just fine but they are not made as barcodes but as numbers (i.e. 1432808734).
The following is the code I am using:
Public Function CreateBarCodeImage(ByVal sText As String) As Byte()
Dim textLength As Integer = sText.Length
Dim fontSize As Integer = 20
Dim Width As Integer = (fontSize * textLength) - ((fontSize *
textLength) / 3)
Dim Height As Integer = fontSize + 2
'Initialize Graphics
Dim rectF As System.Drawing.RectangleF = New
System.Drawing.RectangleF(0, 0, Width, Height)
Dim pic As System.Drawing.Bitmap = New System.Drawing.Bitmap(Width,
Height, Drawing.Imaging.PixelFormat.Format16bppRgb555)
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(pic)
g.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
'Set Colors
Dim fontColor As System.Drawing.Color = System.Drawing.Color.FromName("Black")
Dim rectColor As System.Drawing.Color = System.Drawing.Color.FromName("White")
Dim fgBrush As System.Drawing.SolidBrush = New
System.Drawing.SolidBrush(fontColor)
Dim bgBrush As System.Drawing.SolidBrush = New
System.Drawing.SolidBrush(rectColor)
g.FillRectangle(New
System.Drawing.SolidBrush(System.Drawing.Color.White), rectF)
Dim fontName As String = "mrvcode39m.ttf"
Dim style As System.Drawing.FontStyle = Drawing.FontStyle.Regular
Dim font As System.Drawing.Font = New System.Drawing.Font(fontName,
20, style)
Dim format As System.Drawing.StringFormat = New
System.Drawing.StringFormat
g.DrawString(sText, font, fgBrush, rectF, format)
Dim imageBytes() As Byte = Nothing
Dim memoryStream As System.IO.MemoryStream = New
System.IO.MemoryStream
pic.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Bmp)
pic.Dispose()
imageBytes = memoryStream.ToArray()
memoryStream.Close()
Return (imageBytes)
End Function
Can anyone tell me what I am doing wrong? I would like to avoid having to by
something to do this. But I will even do that if someone can help me make it
work.If you're format is CODE 3 of 9 then I suggest that you can use the font for
this.
"CarrieWells" wrote:
> I have built a custom function in my report to convert my barcode data into a
> barcode image. The data is a string from the database my images are made
> just fine but they are not made as barcodes but as numbers (i.e. 1432808734).
> The following is the code I am using:
> Public Function CreateBarCodeImage(ByVal sText As String) As Byte()
> Dim textLength As Integer = sText.Length
> Dim fontSize As Integer = 20
> Dim Width As Integer = (fontSize * textLength) - ((fontSize *
> textLength) / 3)
> Dim Height As Integer = fontSize + 2
> 'Initialize Graphics
> Dim rectF As System.Drawing.RectangleF = New
> System.Drawing.RectangleF(0, 0, Width, Height)
> Dim pic As System.Drawing.Bitmap = New System.Drawing.Bitmap(Width,
> Height, Drawing.Imaging.PixelFormat.Format16bppRgb555)
> Dim g As System.Drawing.Graphics => System.Drawing.Graphics.FromImage(pic)
> g.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
> g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
> 'Set Colors
> Dim fontColor As System.Drawing.Color => System.Drawing.Color.FromName("Black")
> Dim rectColor As System.Drawing.Color => System.Drawing.Color.FromName("White")
> Dim fgBrush As System.Drawing.SolidBrush = New
> System.Drawing.SolidBrush(fontColor)
> Dim bgBrush As System.Drawing.SolidBrush = New
> System.Drawing.SolidBrush(rectColor)
> g.FillRectangle(New
> System.Drawing.SolidBrush(System.Drawing.Color.White), rectF)
> Dim fontName As String = "mrvcode39m.ttf"
> Dim style As System.Drawing.FontStyle = Drawing.FontStyle.Regular
> Dim font As System.Drawing.Font = New System.Drawing.Font(fontName,
> 20, style)
> Dim format As System.Drawing.StringFormat = New
> System.Drawing.StringFormat
> g.DrawString(sText, font, fgBrush, rectF, format)
> Dim imageBytes() As Byte = Nothing
> Dim memoryStream As System.IO.MemoryStream = New
> System.IO.MemoryStream
> pic.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Bmp)
> pic.Dispose()
> imageBytes = memoryStream.ToArray()
> memoryStream.Close()
> Return (imageBytes)
> End Function
> Can anyone tell me what I am doing wrong? I would like to avoid having to by
> something to do this. But I will even do that if someone can help me make it
> work.|||I tried that first but the fields using the 3 of 9 font won't export to
Adobe; the field just shows up blank. My customer has to have that piece of
functionality. All the other posts that talked about this issue said the
solution was to turn the barcoded text into an image. But I can't get my
funtion to work.
I'm sure I've either left soemthing it needs out, I just can't figure out
what.
"Jon Gonzales" wrote:
> If you're format is CODE 3 of 9 then I suggest that you can use the font for
> this.
> "CarrieWells" wrote:
> > I have built a custom function in my report to convert my barcode data into a
> > barcode image. The data is a string from the database my images are made
> > just fine but they are not made as barcodes but as numbers (i.e. 1432808734).
> > The following is the code I am using:
> >
> > Public Function CreateBarCodeImage(ByVal sText As String) As Byte()
> > Dim textLength As Integer = sText.Length
> > Dim fontSize As Integer = 20
> > Dim Width As Integer = (fontSize * textLength) - ((fontSize *
> > textLength) / 3)
> > Dim Height As Integer = fontSize + 2
> >
> > 'Initialize Graphics
> > Dim rectF As System.Drawing.RectangleF = New
> > System.Drawing.RectangleF(0, 0, Width, Height)
> > Dim pic As System.Drawing.Bitmap = New System.Drawing.Bitmap(Width,
> > Height, Drawing.Imaging.PixelFormat.Format16bppRgb555)
> > Dim g As System.Drawing.Graphics => > System.Drawing.Graphics.FromImage(pic)
> >
> > g.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
> > g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
> >
> > 'Set Colors
> > Dim fontColor As System.Drawing.Color => > System.Drawing.Color.FromName("Black")
> > Dim rectColor As System.Drawing.Color => > System.Drawing.Color.FromName("White")
> > Dim fgBrush As System.Drawing.SolidBrush = New
> > System.Drawing.SolidBrush(fontColor)
> > Dim bgBrush As System.Drawing.SolidBrush = New
> > System.Drawing.SolidBrush(rectColor)
> >
> > g.FillRectangle(New
> > System.Drawing.SolidBrush(System.Drawing.Color.White), rectF)
> >
> > Dim fontName As String = "mrvcode39m.ttf"
> > Dim style As System.Drawing.FontStyle = Drawing.FontStyle.Regular
> > Dim font As System.Drawing.Font = New System.Drawing.Font(fontName,
> > 20, style)
> >
> > Dim format As System.Drawing.StringFormat = New
> > System.Drawing.StringFormat
> >
> > g.DrawString(sText, font, fgBrush, rectF, format)
> >
> > Dim imageBytes() As Byte = Nothing
> >
> > Dim memoryStream As System.IO.MemoryStream = New
> > System.IO.MemoryStream
> >
> > pic.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Bmp)
> > pic.Dispose()
> >
> > imageBytes = memoryStream.ToArray()
> > memoryStream.Close()
> >
> > Return (imageBytes)
> > End Function
> >
> > Can anyone tell me what I am doing wrong? I would like to avoid having to by
> > something to do this. But I will even do that if someone can help me make it
> > work.|||When I look into your code, It seems that you use the font also but whats the
code for? Are you aware that you can use the font in design time, as long as
the font was installed in your system. You can just have a TextBox control
with a font of that and set the border and readonly property of the control.
Remember, every computer that uses your system must have the font of code 39
installed on each.
Regards.|||Were you able to get it running? I am having the same problem with
Code 3 of 9.
What is happening on my app. is that in RS it looks fine but when
exporting to PDF, I get the values not converted to C39, just numbers.
this is also happening on zipcode fonts and OCR-A fonts.
"CarrieWells" <CarrieWells@.discussions.microsoft.com> wrote in message news:<F34A7BBB-94D4-47D9-BB9E-706F1AF6C5CB@.microsoft.com>...
> I tried that first but the fields using the 3 of 9 font won't export to
> Adobe; the field just shows up blank. My customer has to have that piece of
> functionality. All the other posts that talked about this issue said the
> solution was to turn the barcoded text into an image. But I can't get my
> funtion to work.
> I'm sure I've either left soemthing it needs out, I just can't figure out
> what.
>
> "Jon Gonzales" wrote:
> > If you're format is CODE 3 of 9 then I suggest that you can use the font for
> > this.
> >
> > "CarrieWells" wrote:
> >
> > > I have built a custom function in my report to convert my barcode data into a
> > > barcode image. The data is a string from the database my images are made
> > > just fine but they are not made as barcodes but as numbers (i.e. 1432808734).
> > > The following is the code I am using:
> > >
> > > Public Function CreateBarCodeImage(ByVal sText As String) As Byte()
> > > Dim textLength As Integer = sText.Length
> > > Dim fontSize As Integer = 20
> > > Dim Width As Integer = (fontSize * textLength) - ((fontSize *
> > > textLength) / 3)
> > > Dim Height As Integer = fontSize + 2
> > >
> > > 'Initialize Graphics
> > > Dim rectF As System.Drawing.RectangleF = New
> > > System.Drawing.RectangleF(0, 0, Width, Height)
> > > Dim pic As System.Drawing.Bitmap = New System.Drawing.Bitmap(Width,
> > > Height, Drawing.Imaging.PixelFormat.Format16bppRgb555)
> > > Dim g As System.Drawing.Graphics => > > System.Drawing.Graphics.FromImage(pic)
> > >
> > > g.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
> > > g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
> > >
> > > 'Set Colors
> > > Dim fontColor As System.Drawing.Color => > > System.Drawing.Color.FromName("Black")
> > > Dim rectColor As System.Drawing.Color => > > System.Drawing.Color.FromName("White")
> > > Dim fgBrush As System.Drawing.SolidBrush = New
> > > System.Drawing.SolidBrush(fontColor)
> > > Dim bgBrush As System.Drawing.SolidBrush = New
> > > System.Drawing.SolidBrush(rectColor)
> > >
> > > g.FillRectangle(New
> > > System.Drawing.SolidBrush(System.Drawing.Color.White), rectF)
> > >
> > > Dim fontName As String = "mrvcode39m.ttf"
> > > Dim style As System.Drawing.FontStyle = Drawing.FontStyle.Regular
> > > Dim font As System.Drawing.Font = New System.Drawing.Font(fontName,
> > > 20, style)
> > >
> > > Dim format As System.Drawing.StringFormat = New
> > > System.Drawing.StringFormat
> > >
> > > g.DrawString(sText, font, fgBrush, rectF, format)
> > >
> > > Dim imageBytes() As Byte = Nothing
> > >
> > > Dim memoryStream As System.IO.MemoryStream = New
> > > System.IO.MemoryStream
> > >
> > > pic.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Bmp)
> > > pic.Dispose()
> > >
> > > imageBytes = memoryStream.ToArray()
> > > memoryStream.Close()
> > >
> > > Return (imageBytes)
> > > End Function
> > >
> > > Can anyone tell me what I am doing wrong? I would like to avoid having to by
> > > something to do this. But I will even do that if someone can help me make it
> > > work.

Tuesday, March 20, 2012

Bad Syntax

I just cannot get the syntax right for this: (The problem is in my TSart and TEnd)

Dim SQL As String = "Select DateEntered FROM tblTasks Where [DateEntered] Between " '" & TStart & "'" And "'" & TEnd & "'" And [ID] = " & _
IDSent

Thank you for any help,Thanks anyway, I got it. Long Day.

Sunday, March 11, 2012

Bad Connection

I am getting the following error when I attempt to connect to SqlServer with the following connection string from my Web.config file:

<add name="LeanPathConnection" connectionString="Data Source=(local);Initial Catalog=VWOA1.DB;User Id=LeanPath;Password=jesus" />

I have made LeanPath a user at the Security level of the server. His default database is VWOA1.DB. I have given him db_owner rights. The following contains the exception detail I get. I don't see how he could NOT have a trusted SQL Server connection!!!!!!

System.Data.SqlClient.SqlException was unhandled by user code
Message="Login failed for user 'LeanPath'. The user is not associated with a trusted SQL Server connection."
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=14
LineNumber=65536
Number=18452
Procedure=""
Server="localhost"
State=1
StackTrace:
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.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at DbConnection.Open() in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbConnection.cs:line 21
at MyBase.Execute() in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbStoredProc.cs:line 63
at MyReturn.RetValParamInt(String ParamName) in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbStoredProc.cs:line 328
at DbStoredProc.PER_Validate(String LoginName, String Password) in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\App_Code\DbStoredProc.cs:line 1215
at Login.btnLogin_Click(Object sender, EventArgs e) in c:\Documents and Settings\sarogers\My Documents\Visual Studio 2005\Projects\VWOA\LRS\Login.aspx.cs:line 43
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Hi,

you only have Windows Authentication enabled at your server, therefore the SQL Server tries to logon the user with WIndows Authentication. I guess that the LeanUser is a SQL Server User right ? Therefore you will have to use and enable SQL Server authentication first. See my Screencast on my site for more information how to switch from Windows Auth. to Mixed Auth. (SQL Server & Windows Auth).

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

Thursday, March 8, 2012

backups...

Hello all I have this T-SQL string.
Use master
Exec sp_addumpdevice 'disk', 'dbEvents_backup',
'\\pmafiles\X$\SQL\TMS\dbEvents\eventsba
ckup'
Backup Database dbEvents to dbEvents_backup
Exec sp_dropdevice 'dbEvents_backup'
I have two questions
When the backup runs it isn't writing over the existing backup. It
seems to be appending the information.
Secondly, is it this an effective approach in:
adding the dumpdevice
backing it up
and then deleting the device
thanksvncntj@.hotmail.com wrote:
> Hello all I have this T-SQL string.
>
> Use master
> Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> '\\pmafiles\X$\SQL\TMS\dbEvents\eventsba
ckup'
> Backup Database dbEvents to dbEvents_backup
> Exec sp_dropdevice 'dbEvents_backup'
>
> I have two questions
> When the backup runs it isn't writing over the existing backup. It
> seems to be appending the information.
> Secondly, is it this an effective approach in:
> adding the dumpdevice
> backing it up
> and then deleting the device
> thanks
>
You can skip the creation/deletion of the backup device by using TO DISK
in your backup command. To overwrite the existing backup, add WITH INIT
to the backup command. See Books Online for details.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||vncntj@.hotmail.com wrote:
> Hello all I have this T-SQL string.
>
> Use master
> Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> '\\pmafiles\X$\SQL\TMS\dbEvents\eventsba
ckup'
> Backup Database dbEvents to dbEvents_backup
> Exec sp_dropdevice 'dbEvents_backup'
>
> I have two questions
> When the backup runs it isn't writing over the existing backup. It
> seems to be appending the information.
> Secondly, is it this an effective approach in:
> adding the dumpdevice
> backing it up
> and then deleting the device
> thanks
>
Hi
Like mentioned by Tracy, you can skip creation of the device by backing
up to disk, but I wonder why you drop the device after every backup if
it's the same device you add again next time?
Regards
Steen Schlter Persson
Databaseadministrator / Systemadministrator|||YOU GUYS ROCK!!!!!!!!!!
Steen Persson (DK) wrote:
> vncntj@.hotmail.com wrote:
> Hi
> Like mentioned by Tracy, you can skip creation of the device by backing
> up to disk, but I wonder why you drop the device after every backup if
> it's the same device you add again next time?
>
> --
> Regards
> Steen Schl=FCter Persson
> Databaseadministrator / Systemadministrator
> --020001090101040705090406
> Content-Type: text/html; charset=3DISO-8859-1
> X-Google-AttachSize: 1287
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content=3D"text/html;charset=3DISO-8859-1" http-equiv=3D"Content-=
Type">
> </head>
> <body bgcolor=3D"#ffffff" text=3D"#000000">
> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:vncntj@.hotmail.com">=
vncntj@.hotmail.com</a> wrote:
> <blockquote
> cite=3D"mid1152217677.737502.210350@.m73g2000cwd.googlegroups.com"
> type=3D"cite">
> <pre wrap=3D"">Hello all I have this T-SQL string.
>
> Use master
> Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> '\\pmafiles\X$\SQL\TMS\dbEvents\eventsba
ckup'
> Backup Database dbEvents to dbEvents_backup
> Exec sp_dropdevice 'dbEvents_backup'
>
> I have two questions
> When the backup runs it isn't writing over the existing backup. It
> seems to be appending the information.
> Secondly, is it this an effective approach in:
> adding the dumpdevice
> backing it up
> and then deleting the device
> thanks
> </pre>
> </blockquote>
> <font size=3D"-1"><font face=3D"Arial">Hi<br>
> <br>
> Like mentioned by Tracy, you can skip creation of the device by backing
> up to disk, but I wonder why you drop the device after every backup if
> it's the same device you add again next time?<br>
> <br>
> <br>
> -- <br>
> Regards<br>
> Steen Schlüter Persson<br>
> Databaseadministrator / Systemadministrator<br>
> </font></font>
> </body>
> </html>
>=20
> --020001090101040705090406--

backups...

Hello all I have this T-SQL string.
Use master
Exec sp_addumpdevice 'disk', 'dbEvents_backup',
'\\pmafiles\X$\SQL\TMS\dbEvents\eventsbackup'
Backup Database dbEvents to dbEvents_backup
Exec sp_dropdevice 'dbEvents_backup'
I have two questions
When the backup runs it isn't writing over the existing backup. It
seems to be appending the information.
Secondly, is it this an effective approach in:
adding the dumpdevice
backing it up
and then deleting the device
thanksvncntj@.hotmail.com wrote:
> Hello all I have this T-SQL string.
>
> Use master
> Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> '\\pmafiles\X$\SQL\TMS\dbEvents\eventsbackup'
> Backup Database dbEvents to dbEvents_backup
> Exec sp_dropdevice 'dbEvents_backup'
>
> I have two questions
> When the backup runs it isn't writing over the existing backup. It
> seems to be appending the information.
> Secondly, is it this an effective approach in:
> adding the dumpdevice
> backing it up
> and then deleting the device
> thanks
>
You can skip the creation/deletion of the backup device by using TO DISK
in your backup command. To overwrite the existing backup, add WITH INIT
to the backup command. See Books Online for details.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||This is a multi-part message in MIME format.
--020001090101040705090406
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
vncntj@.hotmail.com wrote:
> Hello all I have this T-SQL string.
>
> Use master
> Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> '\\pmafiles\X$\SQL\TMS\dbEvents\eventsbackup'
> Backup Database dbEvents to dbEvents_backup
> Exec sp_dropdevice 'dbEvents_backup'
>
> I have two questions
> When the backup runs it isn't writing over the existing backup. It
> seems to be appending the information.
> Secondly, is it this an effective approach in:
> adding the dumpdevice
> backing it up
> and then deleting the device
> thanks
>
Hi
Like mentioned by Tracy, you can skip creation of the device by backing
up to disk, but I wonder why you drop the device after every backup if
it's the same device you add again next time?
Regards
Steen Schlüter Persson
Databaseadministrator / Systemadministrator
--020001090101040705090406
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<a class="moz-txt-link-abbreviated" href="http://links.10026.com/?link=mailto:vncntj@.hotmail.com">vncntj@.hotmail.com</a> wrote:
<blockquote
cite="mid1152217677.737502.210350@.m73g2000cwd.googlegroups.com"
type="cite">
<pre wrap="">Hello all I have this T-SQL string.
Use master
Exec sp_addumpdevice 'disk', 'dbEvents_backup',
'\\pmafiles\X$\SQL\TMS\dbEvents\eventsbackup'
Backup Database dbEvents to dbEvents_backup
Exec sp_dropdevice 'dbEvents_backup'
I have two questions
When the backup runs it isn't writing over the existing backup. It
seems to be appending the information.
Secondly, is it this an effective approach in:
adding the dumpdevice
backing it up
and then deleting the device
thanks
</pre>
</blockquote>
<font size="-1"><font face="Arial">Hi<br>
<br>
Like mentioned by Tracy, you can skip creation of the device by backing
up to disk, but I wonder why you drop the device after every backup if
it's the same device you add again next time?<br>
<br>
<br>
-- <br>
Regards<br>
Steen Schlüter Persson<br>
Databaseadministrator / Systemadministrator<br>
</font></font>
</body>
</html>
--020001090101040705090406--|||YOU GUYS ROCK!!!!!!!!!!
Steen Persson (DK) wrote:
> vncntj@.hotmail.com wrote:
> > Hello all I have this T-SQL string.
> >
> >
> > Use master
> > Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> > '\\pmafiles\X$\SQL\TMS\dbEvents\eventsbackup'
> > Backup Database dbEvents to dbEvents_backup
> > Exec sp_dropdevice 'dbEvents_backup'
> >
> >
> > I have two questions
> > When the backup runs it isn't writing over the existing backup. It
> > seems to be appending the information.
> >
> > Secondly, is it this an effective approach in:
> >
> > adding the dumpdevice
> > backing it up
> > and then deleting the device
> >
> > thanks
> >
> >
> Hi
> Like mentioned by Tracy, you can skip creation of the device by backing
> up to disk, but I wonder why you drop the device after every backup if
> it's the same device you add again next time?
>
> --
> Regards
> Steen Schl=FCter Persson
> Databaseadministrator / Systemadministrator
> --020001090101040705090406
> Content-Type: text/html; charset=3DISO-8859-1
> X-Google-AttachSize: 1287
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <meta content=3D"text/html;charset=3DISO-8859-1" http-equiv=3D"Content-=Type">
> </head>
> <body bgcolor=3D"#ffffff" text=3D"#000000">
> <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:vncntj@.hotmail.com">=vncntj@.hotmail.com</a> wrote:
> <blockquote
> cite=3D"mid1152217677.737502.210350@.m73g2000cwd.googlegroups.com"
> type=3D"cite">
> <pre wrap=3D"">Hello all I have this T-SQL string.
>
> Use master
> Exec sp_addumpdevice 'disk', 'dbEvents_backup',
> '\\pmafiles\X$\SQL\TMS\dbEvents\eventsbackup'
> Backup Database dbEvents to dbEvents_backup
> Exec sp_dropdevice 'dbEvents_backup'
>
> I have two questions
> When the backup runs it isn't writing over the existing backup. It
> seems to be appending the information.
> Secondly, is it this an effective approach in:
> adding the dumpdevice
> backing it up
> and then deleting the device
> thanks
> </pre>
> </blockquote>
> <font size=3D"-1"><font face=3D"Arial">Hi<br>
> <br>
> Like mentioned by Tracy, you can skip creation of the device by backing
> up to disk, but I wonder why you drop the device after every backup if
> it's the same device you add again next time?<br>
> <br>
> <br>
> -- <br>
> Regards<br>
> Steen Schlüter Persson<br>
> Databaseadministrator / Systemadministrator<br>
> </font></font>
> </body>
> </html>
> > --020001090101040705090406--