Over the years I have always used the decimal(18,0) as the datatype for
primary keys. Aside from the number of significant numbers involved,
would BigInt type be better for performance or is decimal(18,0) still okay.
--
Don Vaillancourt
Director of Software Development
WEB IMPACT INC.
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: Join Bytes! <mailto:donv@webimpact.com>
web: http://www.web-impact.com
Web Impact Inc. <http://www.web-impact.com>
This email message is intended only for the addressee(s) and contains
information that may be confidential and/or copyright.
If you are not the intended recipient please notify the sender by reply
email and immediately delete this email.
Use, disclosure or reproduction of this email by anyone other than the
intended recipient(s) is strictly prohibited. No representation is made
that this email or any attachments are free of viruses. Virus scanning
is recommended and is the responsibility of the recipient.
insert into scn_transaction (sourceSystemName) values(@sourceSystem);
SELECT @txOut = @@identity
Whose purpose is to perform an insert into a table and return me the identity value of the inserted record, which I'll then use throughout the rest of my package. The identity column in the inserted table is numeric(18,0).
I execute the stored proc with the following sql with an OLE DB connection manager:
exec sp_newTransaction ?, ?
The first parameter is a string variable from earlier in the package, and the second is the output parameter. I have the following parameter mappings to the execute sql task:
The proc is correctly called, and the row insesrted, however I get a type conversion error when SSIS attempts to map the return parameter to my package variable... I've tried all sorts of combonations, and can't seem to get it to execute.
At one point I wasn't returning a numeric, but rather an int from the stored proc, and all was well until I went to use the variable in a derived column later in the package, and the type was converted quite incorrectly (a 1 was 77799789080 or some such), indicating a type conversion error likely related to the encoding of the number.
I'd like to keep the datatypes as numeric and make ssis use those - any pointers are greatly appreciated as to what type my package variable should be to allow proper assignment of a sql server numeric type to it.
I have a field in a table that stores date of birth. The field's datatype is char(6) and looks like this: 091703 (mmddyy). I want to convert this value to a datetime datatype.
What is the syntax to convert char(6) to datetime?
HI,I have a table with IDENTITY column with the datatype as INTEGER. Nowthis table record count is almost reaching its limt. that is totalrecord count is almost near to 2^31-1. It will reach the limit with inanother one or two months.In order to avoid the arithmentic overflow error 8115, we would likechange the datatype from INT to BIGINT. we hope this will solve ourproblem.How do I approch this datatype conversion?. Since the data count ishuge, that leads to a long down time of database.we need better approach or solution for this problem?. kindly give mea better solution that will reduce the total downtime of the productiondatabase.?.Regards
i have so doubts in my mind and that i want to discuss with you guys... Can i use more then 5/6 fields in a table with datatype of Text as u know Text can store maximu data... ? acutally i am trying to store a very long strings values into the all fields. it's just popup into my mind that might be table structer would not able to store that my amount of data when u use more then 5/6 text datatypes...
and another thing... is which one is better to use as data type "Text" or "varchar(max)"... ? if any article to read more about these thing,, can you refere to me...
I have a USERS database table with a column called IsValidated. It identifies if a user has been validated. I'd like to know which datatype would be the most efficient for this column. Our DBA made it a varchar(1) column. Would using int be better? Please advice.
I have a message box or multiline textbox on my form and I am storing into an SQL DB. I currently have it as a VARCHAR, but that doesn't seem to store the carriage returns. Do I have to store them as a nvarchar, text, ntext or something else to make the returns show? I am pulling them out of the DB and showing them in a label where I replace the with a <br>.
fathima writes "what data type is used to store unlimited content in sql server. Actually i need to store a text book pls reply i need it for a proejct work."
i have a field in table x withe datatype bit. if i store say value 64. it will store it as 1. then if i store another no. say 43 and so on. then how do i retireve those values from table. say i want ot retrieve 64 the how will sql recoginze i want to retireve 64 as it is stored as 1 in the datafield
I am using Visual Studio .NET 2003 with SQL Server 2000. I am trying toinsert the date and time into a SQL database by using hour(now). I amhaving a hard time trying to figure out which datatype to use in SQL tostore this value. I have tried using datetime, char, nchar, text andnothing seems to work. Anyone have any ideas? Thanks!Regards, :)Christopher Bowen
hello,i m having a problem with the sql database.it does not accept 0(zero)asthe first number in the integer field.whenever i insert 01 it takes itas 1.similarly for 02 and so on till 09.i want 01. can anyone suggesthow to get.i m doing this on sql server.does sql server support?is thisthe problem of sql server?
hello !I got some problems here. I have an attribute that determines the unitof something,e.g. the size of using "mm" , the length of using "seconds"and something others may using "n-page", so ,which data type should Iuse. the "nvarchar" or others?thank you very much!*** Sent via Developersdex http://www.developersdex.com ***
Hi,Sorry if this isn't the right forum...I'm getting a "System.ArgumentException: Column requires a valid DataType" on the following line of code: dcUserAnswer.DataType = System.Type.GetType("SqlTypes.SqlInt32") I'm using SQL Server 2003 & ASP.NET 1.1 Thanks,Jens
Hi Everyone, In C# file: bool abc; (it is working)But in sql file: (bool is not working. What datatype should use for bool in the sql file?)CREATE TABLE sb_payment_history ( sb_dispensing bool NULL <================ not working because bool is not known. )GOThanks,May
Please i need to display the money column in DataBase in an asp.net page but i get something like this 786.0000 how can i format it so that i get something like 786.00 Thanx
Hi,I created a table with one column being that of an 'image' data type. The problem is I don't know how to insert an image into that column. Pleas Help.
How can I update a column with a datatype of int to be empty? Everything I tried updates the field with a zero. I need to empty out the value (equivalent to string type update of null).
I am getting a "Syntax error converting the varchar value '10,90' to a column of data type int." error when I run the following procedure:
@myList varchar(200)
SELECT column1 FROM table1 WHERE table1.ID IN (@myList)
When @myList is a single value, I get no errors. However, when @myList is a comma separated list like in the message above, I error out. I am using SQL Server 2000.
How else can I build this list of IDs? Thank you in advance for your comments.
Hi, I'm a webmaster of http://www.jivejewelry.com. Somehow the website seems slows. The developer told me that a datatype in the database design could be causing the problem. I don't believe it that is possible. Is this actually possible? Please help.
Dear All: I am in the process of developing a code generation tool to generate automatically: 1- Business Layer objects 2- Object Layer objects 3- Data Layer objects
The code follows the same technique used in IssueTracker Starter Kit.
I faced somehting wierd today while trying to convert between SQL Data types to C# data types:
Check the image please, the problem is that, different value number is being given to each column type, by using both: syscolumsn.type and syscolumns.xtype, which one to use ? which is the best used to convert to C# ? Are there any place where data types of SQL Server are being converted to C# data types ?
Hello, I am using OpenXML to do inserts/updates on Sql Server. I have a problem with data type, for example, check this example: DECLARE @record VARCHAR(1000) SELECT @record = '<tests> <test> <NumberofChildren></NumberofChildren> <Name></Name> <Active></Active> </test></tests>' DECLARE @IndexInXML INT -- Create an internal representation of the XML document EXEC sp_xml_preparedocument @IndexInXML OUTPUT, @record INSERT INTO [test] SELECT [NumberofChildren], [Name], ISNULL([Active],null) FROM OPENXML (@IndexInXML, '/tests/test',2) WITH ( [NumberofChildren] INT, [Name] VARCHAR(50), [Active] BIT ) -- Remove in-memory table from memory EXEC sp_xml_removedocument @IndexInXML I have a table called test, it has the followig fields:1- ID2- NumberofChildren3- Name4- ActiveAll fields but ID are asisgned "Allow Null"I want to add data to this table, but if the value coming from xml is empty, I want to have null, in NumberofChildren, Name, Active.When I try my script, if the data is null, NumberofChildren with 0 value, Name is nothing, Active is 0,How can I make the INT and BIT datatypes have NULL when the input is empty in the xml? Can you helpthank you
Hi, I want to pass data to the stored procedure by vb code.One of the input parameters of the SP has Text Data Type.whats the equivalent of this datatype in vb? Thanks in Advance.