Choosing Data Type

Apr 15, 2006

Hi ... I have question on datatype on SQL Server 2005 EE





What is a good data type for email, password, Phone Number and ISBN number?





Thanks!

View 3 Replies


ADVERTISEMENT

Choosing Data Types Correctly

Sep 18, 2004

Hello, I am really dripping wet behind the ears on this and would really appreciate some help. I am setting up my first SQL table and am lost at trying to choose data types for my fields. Basically, all I am doing is setting up a contact form. It is going to ask for phone number, name, address, city, state, zip, etc. I will also have two fields which if I were using an Access db, would be "memo" with say, 500 characters. So in researching SQL data types, I came across the following:

char
Fixed-length non-Unicode character data with a maximum length of 8,000 characters.

varchar
variable-length non-Unicode data with a maximum of 8,000 characters.

text
Variable-length non-Unicode data with a maximum length of 2^31 - 1 (2,147,483,647) characters.

nchar
Fixed-length Unicode data with a maximum length of 4,000 characters.

Can someone shed some light on what I need for simple fields like street, name, city, and more importantly, description? I will also have a "premium" field which should be a "yes" or "no". I am thinking a data type of bit, which is set to 1 or 0? Thanks for any help, I appreciate it so much.
TOm

View 1 Replies View Related

Spreading Data Choosing A Determined NDF???

Jan 12, 2007

Hi everyone

Primary platform is 2005 on 64-bit.

I've got a couple of questions linked to partitionating tables.

-What sort of criteria follows Database Engine when you have two NDF assigned to one filegroup and this filegroup is part of partition
What's more: Could I force that Sql will use one by default?

I mean, my first partition encompass from 20020101 till 20030101. When I add data for example March or June, could I decide that these months belong to NDF1 rather than NDF2?

Let me know if you need further details.

Thanks in advance for your time,

View 4 Replies View Related

Index Creation Causes Error The Conversion Of A Char Data Type To A Datetime Data Type Resulted...

Jul 23, 2005

Hi all,I have a table called PTRANS with few columns (see create script below).I have created a view on top that this table VwTransaction (See below)I can now run this query without a problem:select * from dbo.VwTransactionwhereAssetNumber = '101001' andTransactionDate <= '7/1/2003'But when I create an index on the PTRANS table using the command below:CREATE INDEX IDX_PTRANS_CHL# ON PTRANS(CHL#)The same query that ran fine before, fails with the error:Server: Msg 242, Level 16, State 3, Line 1The conversion of a char data type to a datetime data type resulted inan out-of-range datetime value.I can run the same query by commeting out the AssetNumber clause and itworks fine. I can also run the query commenting out the TransactionDatecolumn and it works fine. But when I have both the conditions in theWHERE clause, it gives me this error. Dropping the index solves theproblem.Can anyone tell me why an index would cause a query to fail?Thanks a lot in advance,AmirCREATE TABLE [PTRANS] ([CHL#] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,[CHCENT] [numeric](2, 0) NOT NULL ,[CHYYMM] [numeric](4, 0) NOT NULL ,[CHDAY] [numeric](2, 0) NOT NULL ,[CHTC] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL) ON [PRIMARY]GOCREATE VIEW dbo.vwTransactionsASSELECT CONVERT(datetime, dbo.udf_AddDashes(REPLICATE('0', 2 -LEN(CHCENT)) + CONVERT(varchar, CHCENT) + REPLICATE('0', 4 -LEN(CHYYMM))+ CONVERT(varchar, CHYYMM) + REPLICATE('0', 2 -LEN(CHDAY)) + CONVERT(varchar, CHDAY)), 20) AS TransactionDate,CHL# AS AssetNumber,CHTC AS TransactionCodeFROM dbo.PTRANSWHERE (CHCENT <> 0) AND (CHTC <> 'RA')*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View 1 Replies View Related

System.Data.SqlClient.SqlException: The Conversion Of A Char Data Type To A Datetime Data Type Resulted In An Out-of-range Datetime Value.

Dec 14, 2005

After testing out the application i write on the local pc. I deploy it to the webserver to test it out. I get this error.

System.Data.SqlClient.SqlException: The conversion of a char data type to a
datetime data type resulted in an out-of-range datetime value.

Notes: all pages that have this error either has a repeater or datagrid which load data when page loading.

At first I thought the problem is with the date, but then I can see
that some other pages that has datagrid ( that has a date field) work
just fine.

anyone having this problem before?? hopefully you guys can help.

Thanks,

View 4 Replies View Related

Converting A Data Type Double To A Type Float Using A Data Adapter &&amp; SSCE 3.5

Feb 13, 2008

Hi,

I can populate a dataTable with type double (C#) of say '1055.01' however when I save these to the CE3.5 database using a float(CE3.5) I lose the decimal portion. The 'offending' code is:


this.court0TableAdapter1.Update(this.mycourtsDataSet1.Court0);

this.mycourtsDataSet1.AcceptChanges();

this.court0TableAdapter1.Fill(this.mycourtsDataSet1.Court0);


This did not happen with VS2005/CE3.01.

I have tried changing all references to decimal (or money in CE3.5) without luck.

I'm beginning to think that string may be the way to go!!!!!!!

Can someone shed some light on my problem.

Thanks,

Later:

It's necessary to update the datatable adapter as the 3.01 and 3.5 CE are not compatible.

View 4 Replies View Related

COnverting Numeric Data Type (Oracle) To Date Data Type Using SSIS

Mar 7, 2007

We have some columns in a table where the date is stored as 19980101 (YYYYMMDD). The data type for this column is NUMBER(8) in Oracle.

I need to copy rows from Oracle to SQL Server using SSIS. I used the Data Conversion transformation editor to change it to DT_DATE, but the rows are not being inserted to the destination.

On Error, If I fail the component, then the error is :

There was an error with input column "ORDER_DATE_CONV" (1191) on input "OLE DB Destination Input" (29). The column status returned was: "Conversion failed because the data value overflowed the specified type.".

Regards

RH

View 3 Replies View Related

The Conversion Of A Char Data Type To A Datetime Data Type!!

May 13, 2008

hello all .. I have a form that includes two textboxes (Date and Version) .. When I try to insert the record I get the following error message .. seems that something wrong with my coversion (Data type)"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated."
 
in my SQL database I have the date feild as datetime and the version as nvarchar(max)
this is the code in the vb page .. Can you please tell me how to solve this problem?Imports System.Data.SqlClient
Imports system.web.configuration

Partial Class Admin_emag_insert
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Record_DateTextBox.Text = DateTime.Now

End Sub

Protected Sub clearButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles clearButton.Click
Me.VersionTextBox.Text = ""
End Sub

Protected Sub addButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles addButton.Click
Dim objConnection As SqlConnection
Dim objDataCommand As SqlCommand
Dim ConnectionString As String
Dim record_date As Date
Dim version As String
Dim emagSQL As String

'save form values in variables
record_date = Record_DateTextBox.Text
version = VersionTextBox.Text

ConnectionString = WebConfigurationManager.ConnectionStrings("HRDBConnectionString").ConnectionString

'Create and open the connection
objConnection = New SqlConnection(ConnectionString)
objConnection.Open()
emagSQL = "Insert into E_Magazine (Record_Date, Version ) " & _
"values('" & record_date & "','" & version & "')"

'Create and execute the command
objDataCommand = New SqlCommand(emagSQL, objConnection)
objDataCommand.ExecuteNonQuery()
objConnection.Close()

AddMessage.Text = "A new emagazine was added successfully"

Me.VersionTextBox.Text = ""

End Sub
End Class
 

View 10 Replies View Related

Converting Numeric Data Type To Text Data Type

Jul 20, 2005

Hi,I would like to convert a dollar amount ($1,500) to represent Fifteenhundred dollars and 00/100 cents only for SQL reporting purposes. Isthis possible and can I incorporate the statement into an existingleft outer join query.Thanks in advance,Gavin

View 1 Replies View Related

Changing User Defined Data Type's Data Type

Sep 12, 2006

Hi,



I have a user defined data type which is called DEmployeeName,

it's length is varchar(20), how do i change it into varchar(30) without droping it?

I'm using SQL server 2005.

Thanks in advance..

View 1 Replies View Related

Convert Text Data Type To Smalldatetime Data Type

Oct 9, 2007

I have a field that is currently stored as the data type nvarchar(10), and all of the data in this field is in the format mm/dd/yyyy or NULL. I want to convert this field to the smalldatetime data type. Is this possible?
I've tried to use cast in the following way, (rsbirthday is the field name, panelists is the table), but to no avail.


SELECT rsbirthday CAST(rsbirthday AS smalldatetime)

FROM panelists


the error returned is "incorrect syntax near 'rsbirthday'.

I'm rather new to all things SQL, so I only have the vaguest idea of what I'm actually doing.

Thanks for the help!

View 10 Replies View Related

Getting Error : : The Conversion Of A Char Data Type To A Datetime Data Type Resulted In An Out-of-range Datetime Value

Jan 28, 2008

update tblPact_2008_0307 set student_dob = '30/01/1996' where student_rcnumber = 1830when entering update date in format such as ddmmyyyyi know the sql query date format entered should be in mmddyyyy formatis there any way to change the date format entered to ddmmyyyy in sql query?

View 5 Replies View Related

Sqlbulkcopy Error : The Given Value Of Type SqlDecimal From The Data Source Cannot Be Converted To Type Decimal Of The Specified

Apr 16, 2008

Hi,

The table in SQL has column Availability Decimal (8,8)

Code in c# using sqlbulkcopy trying to insert values like 0.0000, 0.9999, 29.999 into the field Availability
we tried the datatype float , but it is converting values to scientific expressions€¦(eg: 8E-05) and the values displayed in reports are scientifc expressions which is not expected
we need to store values as is


Error:
base {System.SystemException} = {"The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified target column."}

"System.InvalidOperationException: The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified target column. ---> System.InvalidOperationException: The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified target column. ---> System.ArgumentException: Parameter value '1.0000' is out of range.
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata)
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlBulkCopy.ConvertValue(Object value, _SqlMetaData metadata)
at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternal()
at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServer(Int32 columnCount)
at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState)
at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table)
at MS.Internal.MS
COM.AggregateRealTimeDataToSQL.SqlHelper.InsertDataIntoAppServerAvailPerMinute(String data, String appName, Int32 dateID, Int32 timeID) in C:\VSTS\MXPS Shared Services\RealTimeMonitoring\AggregateRealTimeDataToSQL\SQLHelper.cs:line 269"


Code in C#

SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnection, SqlBulkCopyOptions.Default);
DataRow dr;
DataTable dt = new DataTable();
DataColumn dc;

try
{

dc = dt.Columns.Add("Availability", typeof(decimal));
€¦.

dr["Availability"] = Convert.ToDecimal(s[2]); ------ I tried SqlDecimal
€¦€¦€¦.

}
bulkCopy.DestinationTableName = "dbo.[Tbl_Fact_App_Server_AvailPerMinute]";
bulkCopy.WriteToServer(dt);



thx



View 8 Replies View Related

Bulk Insert Task Failing On Data Type Conversion For A Destination Column Of Type Bit

Jul 6, 2006

I am trying to use the Bulk Insert Task to load from a csv file. My final column is a bit that is nullable. My file is an ID column that is int, a date column that is mm/dd/yyy, then 20 columns that are real, and a final column that is bit. I've tried various combinations of codepage and datafiletype on my task component. When I have RAW with Char, I get the error included below. If I change to RAW/Native or codepage 1252, I don't have an issue with the bit; however, errors start generating on the ID and date columns.

I have tried various data type settings on my flat file connection, too. I have tried DT_BOOL and the integer datatypes. Nothing seems to work.

I hope someone can help me work through this.

Thanks in advance,

SK



SSIS package "Package3.dtsx" starting.

Error: 0xC002F304 at Bulk Insert Task, Bulk Insert Task: An error occurred with the following error message: "Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.The bulk load failed. The column is too long in the data file for row 1, column 24. Verify that the field terminator and row terminator are specified correctly.Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 23 (cancelled).".

Error: 0xC002F304 at Bulk Insert Task 1, Bulk Insert Task: An error occurred with the following error message: "Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.The bulk load failed. The column is too long in the data file for row 1, column 24. Verify that the field terminator and row terminator are specified correctly.Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 23 (cancelled).".

Task failed: Bulk Insert Task 1

Task failed: Bulk Insert Task

Warning: 0x80019002 at Package3: The Execution method succeeded, but the number of errors raised (2) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

SSIS package "Package3.dtsx" finished: Failure.

View 5 Replies View Related

The Conversion Of A Char Data Type To A Datetime Data Type Resulted In An Out-of-range Datetime Value.

Apr 19, 2008

Advance thanks ....... My table is  TimeSheet:-----------------------------------  CREATE TABLE [dbo].[TimeSheet](    [autoid] [int] IDENTITY(1,1) NOT NULL,    [UserId] [int] NOT NULL,    [starttime] [datetime] NOT NULL,    [endtime] [datetime] NOT NULL,    [summary] [nvarchar](50) NOT NULL,    [description] [nvarchar](50) NULL,    [dtOfEntry] [datetime] NOT NULL,    [Cancelled] [bit] NULL) ON [PRIMARY] My Query is------------------ insert into timesheet (UserId, StartTime,EndTime, Summary, Description,DtOfEntry) values (2, '19/04/2008 2:05:06 PM', '19/04/2008 2:05:06 PM', '66', '6666','19/04/2008 2:05:06 PM')i m not able to insert value Error Message is-------------------------Msg 242, Level 16, State 3, Line 1The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated. can any body give any solution  

View 5 Replies View Related

The Conversion Of A Char Data Type To A Datetime Data Type Resulted In An Out-of-range Datetime Value.

Aug 3, 2005

Hey, I have a big problem that i wanna search data from SQL by DateTime like thatselect * from test where recorddate='MyVariableWhichHoldDate'i use variable that holds Date info.i searched a lot infomation on net but there is no perfect solution. i know why this occur but there is no function to solve this problem. i used a lot of ways. it accept yyyy-mm-dd format but my variable format is dd-mm-yyyyy . is there any function for this problem? and any other solution.thanks for ur attentionregards

View 6 Replies View Related

The Conversion Of Char Data Type To Smalldatetime Data Type Resulted In An Out-of-range Smalldatetime Value

Mar 30, 2007

I am using Visual Studio 2005 and SQL Express 2005. The database was converted from MS Access 2003 to SQL Express by using the upsize wizard.



I would like to store the current date & time in a column in a table. This column is a smalldatetime column called 'lastlogin'.

The code I'm using is:



Dim sqlcommand As New SqlCommand _

("UPDATE tableXYZ SET Loggedin = 'True', LastLogin = GetDate() WHERE employeeID = '" & intEmployeeID.ToString & "'", conn)



Try

conn.Open()

sqlcommand.ExecuteNonQuery()

conn.Close()

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try



This code works fine on my local machine and local SQL server. However at the client side this code results in the error as mentioned in the subject of this thread. I first used 'datetime.now' instead of 'getdate()', but that caused the same error. Then I changed the code to 'getdate()', but the error still remains.



The server at the client is running Windows Server 2000 UK . My local machiine is running WIndows XP Dutch.

Maybe the conversion from Dutch to UK has something to do with it. But this should be solved by using the 'Getdate()' function..... ?













View 1 Replies View Related

Connection Type Limitations When Using XML Data Type In SQL Task

Jul 23, 2007

I'm trying to use the SSIS Execute SQL Task to pull XML from a SQL 2005 database table. The SQL is of the following form:




SELECT
(



SELECT
MT.MessageId 'MessageId',
MT.MessageType 'MessageType',
FROM MessageTable MT
ORDER BY MT.messageid desc
FOR XML PATH('MessageStatus'), TYPE


)
FOR XML PATH('Report'), TYPE

For some reason I can only get this query to work if I use an ADO.NET connection type. If I try to use something like the OLEDB connection I get the following error:



<ROOT><?MSSQLError HResult="0x80004005" Source="Microsoft XML Extensions to SQL Server" Description="No description provided"?></ROOT>



Can anyone tell me why the SELECT ... FOR XML PATH... seems only to work with ADO.NET connections?



Thanks

Walter

View 1 Replies View Related

SqlDataSource.Select Error: Unable To Cast Object Of Type 'System.Data.DataView' To Type 'System.String'.

Oct 19, 2006

I am trying to put the data from a field in my database into a row in a table using the SQLDataSource.Select statement. I am using the following code: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'" myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)But when I run the code, I get the following error:Server Error in '/YorZap' Application. Unable to cast object of type 'System.Data.DataView' to type 'System.String'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.Source Error: Line 54: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'"
Line 55: 'myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments).GetEnumerator.Current, String)
Line 56: myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)
Line 57:
Line 58: filesTable.Rows.Add(myDataRow)Source File: D:YorZapdir_list_sort.aspx    Line: 56 Stack Trace: [InvalidCastException: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.]
ASP.dir_list_sort_aspx.BindFileDataToGrid(String strSortField) in D:YorZapdir_list_sort.aspx:56
ASP.dir_list_sort_aspx.Page_Load(Object sender, EventArgs e) in D:YorZapdir_list_sort.aspx:7
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45
System.Web.UI.Control.OnLoad(EventArgs e) +80
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3743
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210 Please help me!

View 3 Replies View Related

Unable To Cast COM Object Of Type 'System.__ComObject' To Class Type 'System.Data.SqlClient.SqlConn

May 17, 2006

Dear all,

I am stuck with a SSIS package and I can€™t work out. Let me know what steps are the correct in order to solve this.
At first I have just a Flat File Source and then Script Component, nothing else.

Error:





[Script Component [516]] Error: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type 'System.Data.SqlClient.SqlConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)



Script Code (from Script Component):



' Microsoft SQL Server Integration Services user script component
' This is your new script component in Microsoft Visual Basic .NET
' ScriptMain is the entrypoint class for script components

Imports System
Imports System.Data.SqlClient
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper


Public Class ScriptMain
Inherits UserComponent


Dim nDTS As IDTSConnectionManager90
Dim sqlConnecta As SqlConnection
Dim sqlComm As SqlCommand
Dim sqlParam As SqlParameter


Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

Dim valorColumna As String
Dim valorColumna10 As Double


valorColumna = Row.Column9.Substring(1, 1)

If valorColumna = "N" Then
valorColumna10 = -1 * CDbl(Row.Column10 / 100)
Else
valorColumna10 = CDbl(Row.Column10 / 100)
End If

Me.Output0Buffer.PORCRETEN = CDbl(Row.Column11 / 100)
Me.Output0Buffer.IMPRETEN = CDbl(Row.Column12 / 100)
Me.Output0Buffer.EJERCICIO = CInt(Row.Column2)
Me.Output0Buffer.CODPROV = CInt(Row.Column7)
Me.Output0Buffer.MODALIDAD = CInt(Row.Column8)
Me.Output0Buffer.NIFPERC = CStr(Row.Column3)
Me.Output0Buffer.NIFREP = CStr(Row.Column4)
Me.Output0Buffer.NOMBRE = CStr(Row.Column6)
Me.Output0Buffer.EJERDEV = CDbl(Row.Column13)

With sqlComm
.Parameters("@Ejercicio").Value = CInt(Row.Column2)
.Parameters("@NIFPerc").Value = CStr(Row.Column3)
.Parameters("@NIFReP").Value = CStr(Row.Column4)
.Parameters("@Nombre").Value = CStr(Row.Column6)
.Parameters("@CodProv").Value = CInt(Row.Column7)
.Parameters("@Modalidad").Value = CInt(Row.Column8)
.Parameters("@ImpBase").Value = valorColumna10
.Parameters("@PorcReten").Value = CDbl(Row.Column11 / 100)
.Parameters("@ImpReten").Value = CDbl(Row.Column12 / 100)
.Parameters("@EjerDev").Value = CDbl(Row.Column13)

.ExecuteNonQuery()
End With


End Sub
Public Overrides Sub AcquireConnections(ByVal Transaction As Object)

Dim nDTS As IDTSConnectionManager90 = Me.Connections.TablaMODELO80
sqlConnecta = CType(nDTS.AcquireConnection(Nothing), SqlConnection)

End Sub
Public Overrides Sub PreExecute()

sqlComm = New SqlCommand("INSERT INTO hac_modelo180(Ejercicio,NIFPerc,NIFReP,Nombre,CodProv,Modalidad,ImpBase,PorcReten,ImpReten,EjerDev) " & _
"VALUES(@Ejercicio,@NIFPerc,@NIFReP,@Nombre,@CodProv,@Modalidad,@ImpBase,@PorcReten,@ImpReten,@EjerDev)", sqlConnecta)
sqlParam = New SqlParameter("@Ejercicio", Data.SqlDbType.SmallInt)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@NIFPerc", Data.SqlDbType.Char)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@NIFReP", Data.SqlDbType.Char)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@Nombre", Data.SqlDbType.VarChar)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@CodProv", Data.SqlDbType.TinyInt)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@Modalidad", Data.SqlDbType.SmallInt)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@ImpBase", Data.SqlDbType.Decimal)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@PorcReten", Data.SqlDbType.Decimal)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@ImpReten", Data.SqlDbType.Decimal)
sqlComm.parameters.add(sqlParam)
sqlParam = New SqlParameter("@EjerDev", Data.SqlDbType.Decimal)
sqlComm.Parameters.Add(sqlParam)

End Sub


Public Sub New()

End Sub
Public Overrides Sub ReleaseConnections()
nDts.ReleaseConnection(sqlConnecta)
End Sub

Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub
End Class







Thanks a lot for your help


View 13 Replies View Related

@PARAM1 : Unable To Cast Object Of Type 'System.Data.SqlTypes.SqlInt32 To Type System.IConvertable

Apr 23, 2007

I get the following message in the vs2005 querybuilder when i do a preview:



***********************************
SQL Execution Error.

Executed SQL statement: SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = @PARAM1)



Error Source: SQL Server Compact Edition ADO.NET Data Provider


Error Message: @PARAM1 : Unable to cast object of type 'System.Data.SqlTypes.SqlInt32 to type System.IConvertable'.
****************************************

The same querypreview works fine without the parameter:



SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = 186)



Can anybody tell me why this is?
And tell me a way to get the tableadapter working?



Anne-Jan Tuinstra

View 3 Replies View Related

Choosing Event To Log

Feb 21, 2006

Hi,
log backup done every 5 min.
so sql server log file full of entries

"Log backed up: Database: Prices, creation date(time):...."

could loging for Log backed for db Prices be disabled ?
Thanks
Alex

View 4 Replies View Related

One-to-Many Query, Choosing Only One Of The &#34;Many&#34; For Each &#34;One&#34;

Jun 12, 2002

Apologies for the way in which I describe the tables and data, I know I'm not using a very proper way to get my point across:

Table A: "tblJobs" Contains the following:
--------------------------------------------

COLUMNS:
1. JobPK (char(35))
2. LocationName (varchar(50))

DATA (csv):
6643C9C9-7618-472F-9859844AA6C0F47B, Jonesport ME
08563708-3830-4507-B3154E9C4D49C6F2, Garden City NY



Table B: "tblJobDates" contains the following data, related to the two rows above):
--------------------------------------------

COLUMNS:
1. JobPK (char(35))
2. DateData (datetime)
3. CRD (datetime, "Created Date" the date and time that the date was entered)

DATA (csv):
6643C9C9-7618-472F-9859844AA6C0F47B, 6/8/2002, 6/10/2002 12:44:58 PM
6643C9C9-7618-472F-9859844AA6C0F47B, 6/17/2002, 4/22/2002 2:07:31 PM
08563708-3830-4507-B3154E9C4D49C6F2, 6/12/2002, 6/7/2002 4:05:06 PM
08563708-3830-4507-B3154E9C4D49C6F2, 6/13/2002, 6/12/2002 11:38:22 AM

tblJobDates serves two purposes: to give us the most recently entered due date for a job, and to serve as a "repository" to track changes to the due date.


Report C: The report I want to generate does NOT provide historical information... it only serves to show the CURRENT due date for each job in the tblJobs table:
--------------------------------------------

COLUMNS:
LocationName
Due Date (alias of DateData)

OUTPUT (csv):
Jonesport ME, 6/8/2002
Garden City NY, 6/13/2002

Note that for Jonesport, an initial due date of 6/17/2002 was entered (based on the CRD). Then someone changed it so that the job was due EARLIER.

Note that for Garden City, an initial due date of 6/12/2002 was entered (based again on the CRD). Then someone changed it so that the job was due LATER.

The "most recently entered due date" is what should be reflected in my report -- just as it does above ("C")

Other Notes:

-- There are other columns of information from both tables that i would like to return, but above is the most basic form of my request. Most notably, we would need to return the JobPK in report (C).

-- A job should only appear ONCE in report (c), with it's "current" due date, regardless of the other due dates that may have been entered for that job.

-- If a job has no due date, it should not appear on the report.

-- Although not shown here, each row in (B) DOES have a unique identifier (DatePK) as well... if that helps in your solution.

-- Note that the job that is "due first" appears at the top of report (C). This allows a person looking at the report to quickly determine which job "gets priority" -- the one on top!

Okay gurus -- how should the query look that would generate the desired output in Report C?

THANKS IN ADVANCE if you even can point me in the right direction!!

View 1 Replies View Related

Choosing DB Edition (Std Vs Ent)

Jul 20, 2005

I need to decided between Standard and Enterprise Edition (Cost is acriteria - but its secondary to performance - <!--and I am not paying forit myself-->)The server spec under consideration: Dual Xeon, 1GB RAM, 36GB - RAID 1(Dell PowerEdge 1850).Application: Windows 2003 Std Server, ASP.NET, MS SQL Server 2000 baseddata driven web application.Approximately 25 simultaneous clients. Peak activity would probably be 50transactions/activities per second (2 per second per client). I expectthe database size to grow up to 4GB in 1 year.The application would use only basic OLAP features (if at all)...sofeature set wise I believe that standard edition is good enough.What I am concerned about is when MS documentation says that StandardEdition is for "organization that do not require the advanced scalability,availability, performance, or analysis features of the SQL Server 2000Enterprise Edition"Is there a difference in performance between Std and Ent editions? Interms of number of transactions per second that can be serviced?What other criteria should I be aware of before deciding to go one way orthe other?Any ideas?

View 4 Replies View Related

Choosing The Most Frequent

Jul 14, 2006

There must be a way to do this simply. We're running SQL Server 2000. I'm looking for some generic SQL statement that I can apply.

If I have a table with a person column and a location column and multiple records for the same person / locatioin combination, how do I select the person with the location they most frequently visited? Say George visits Mexico 5 times, and the Bahamas twice and costa rica once. I would have 8 records in my table for George. The data looks something like this:

George/Mexico
George/Mexico
George/Mexico
George/Mexico
George/Mexico
George/Bahamas
George/Bahamas
George/Costa Rica
Ben/Brazil
Ben/Brazil
Ben/Peru

The results would be:

George/Mexico
Ben/Brazil



Thanks!

Myles

View 4 Replies View Related

Choosing A Record By Radiobutton

Aug 18, 2006

Please help me out:
I have some records in a sqldatasource and want to show it column wise. Now I do it with a datalist because it's easy. But other options are open.
Every item/record should have a radiobutton (in a group, so that you can only choose one from all). People advised me to do this with a html radiobutton inside the template.
After the user has selected an item and chooses the next-button I need to know what item the user has choosen.
Furthermore, when the user likes to step back, the same radiobutton should allready be selected.
Please help, this is bothering me for a while,
best regards from The Netherlands,
Gert

View 1 Replies View Related

Help In Choosing SQL Server Edition

Jun 12, 2007

My company has a website that connects to a sql server (on a different box). I am trying to convince them to get sql server 2005. However, I do not know if SQL Server 2005 Workgroup edition is okay for our needs. Can someone please tell me if it is.
Basically, our setup is the following:


The SQL Server will only have one/two clients - the web server

View 7 Replies View Related

Dynamically Choosing Connection --please Help

Jul 26, 2007

 i have to store some data on a remote sever(MS SQL SERVER2000). The scenario is like 1. The web application runs on a local machine. User (who inputs) uses through LAN.2. The Input should  be stored in the remote server. if the remote connection is ok. otherwise it should be saved in local server's database(MS SQL 2000).3.  In the application's web.config  there is a connection string pointing to the remote server and another one (alternating one) points the local server's database. in scenario like this i first  to tested the remote connection. if it is not ok  then i initialize the local server's connection like thisprivate MyConnection()    {                        try            {                connectionSql = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnForRemote"].ToString());                connectionSql.Open();            }            catch (Exception ex)            {                connectionSql = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnForLocal"].ToString());            }            finally            {                connectionSql.Close();            }        connectionSql2 = new SqlConnection(ConfigurationManager.ConnectionStrings["Temp"].ToString());                   }My problem is when the remote connection is lost it takes almost 1 minute to store in local database. how can i make it more time efficient. Thanks....

View 5 Replies View Related

Choosing Randomly A Record

Jun 8, 2002

Hello,
I have a table with some data in it.
What I want to do is to create a query that returns me randomly
one of the records of the table. Can this be done?

If this is not possible from SQL server I have thought an
alternative way. This is:

I want to return all rows of the table with SELECT *,
but I want the select to return in the first column an
autoincreament number for each row without the need to add
an autoincrement field in the table. e.g

Table
------
Banana
Tomatoe
Aple
...
...
Orange

Result from select
------------------
1 Banana
2 Tomatoe
3 Aple
. ....
. ....
23 Orange

Can this be done?
At least this way
1) I can travel to the end of the results (from ASP),
2) read the ID of the last row
3) Create a random integer number from 1 to last ID,
4) and finaly select the appropriate random row from that integer.


Can anybody help me please?

Thanks for any help in advance!

Yours, sincerely

Efthymios Kalyviotis
ekalyviotis@comerclub.gr

View 1 Replies View Related

Choosing Appropriate Database Server

Jun 4, 2006

Greetings!

I am purchasing a new/first server and could use some help with the details.

I am purchasing the server with the intent of managing a large database that will be quite extensive and requires a good amount of processing power. I have decided to go with windows server 2003 and SQL Server 2000 as a database. Within next year I hope to have this database directly flowing to a website that I could possibly be hosting as well as 2-3 offsite employess logging into the system remotely.

I would say my biggest question is whether or not to choose the raid 1 configuration or the raid 5. I want to be able to have the Hard drives mirror eachother. I was thinking of going with three hard drives but im not really sure if I would even need that setup. With that, I will just show my current system:

Dell poweredge 1800

3.0 ghz xeon
2 gb memory
sata 1 raid
cerc 6-Channel sata raid controller
160 gb hd x 2
onboard NIC network adapter

Im going price savvy on this one so no ups redundant, power supplies, or tape backup. Although I am open to any suggestions.

Definately appreciate any help with this as I have been hard pressed to find some quality reseller help. They just want to throw the biggest and baddest thing at me.

Thanks!

-Shawn

View 4 Replies View Related

SQL Performance Vs Choosing The Driver

Jan 20, 2008

Hi All,



I would like to know the experts views on the following I have listed below.



1. Is there any significant performance gain by choosing the Native SQL server driver rather than OLEDB for example. I know there are lot of specified features in the Native SQL Driver but I am thinking in terms of the performance.



2. Why not develop for the generic database rather than specific database?



3. More generic mean less work when migrating database to a different database?



Appreciate your valuable thoughts and any recommendations.



Cheers,

Amal

View 1 Replies View Related

Choosing The Right Index In Update

Dec 12, 2007

I have an SQL as follows

UPDATE TB
SET [Deleted] = 1
WHERE TB.[ QuestionId] = @QuestionId

I have an index in this table as follows

CREATE NONCLUSTERED INDEX [IX_AssessedAnswers1] ON [TB]
(
[Id] ASC,
[QuestionId] ASC,
[Deleted] ASC
)WITH (PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF) ON [PRIMARY]

Whether this index will be considered by the query optimiser to lock records? If I created another index with only the QuestionId field will it boost the performance? Actually how the optimiser chooses the right index while update?

View 2 Replies View Related

Choosing Database Between MSDE And Access

Oct 13, 2004

hi,

I need to choose a database based on the following criteria (using .NET app):
1) a light but fully functional database, preferably with the support of store proc and constraints, less than 8000 transaction a day.
2) portable or the database can be export/import very easily
3) reliable and stable
4) least maintenance

I have two db in my mind, Access and MSDE?
Does anyone have some hand-ons experience on the above two? Or any other better suggestions?

Any advice is appreciated.

thanks,
bryan

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved