Character Types
Nov 16, 2007
i am using sql server 2000, i am new to databases, could you please tell me what are the different character types, example "varchar , numeric...etc"
How to find out the difference between them....
Where do i find a tutorial for this kind of basic knowledge ?
regards
View 14 Replies
ADVERTISEMENT
Dec 18, 2006
Hi there,Trying to work with SQL2005 with Hebrew characters. If i use the Unicode character data types do i need to change the database collation???. regards
View 5 Replies
View Related
Jun 10, 2015
I Have a table with #Sample like below
=================================
#Sample
id int,
SSN varchar(20),
State varchar(2)
Â
Sample Data:
ID SSN STATE
1 999-000-000 AB
2 979-000-000Â BC
3 995-000-000Â CD
=================================
We used filter logic based on the SSN & State.
We are passing these values through variables like
Declare @State varchar(2)
Declare @SSN varchar(20)
While run time these values are lets suppose @SSN = '999-000-000' & @State='ABC'
Now the Result is displayed with the state data Like 'AB' only.
Output: 1 999-000-000 AB
instead it should give system generated error.
Here I have 2 Questions:
1. Why it is taking 1st 2 Charecters?
2. Why it does not have any system generated for length?
I can do validation with Length function for these 2 variables however if have 100 variables then it should not feasible case. So, what is the reason behind?Â
View 5 Replies
View Related
May 26, 2005
SQL Server 2000, ASP.Net 1.1
I've been writing this stuff for a while, and can't seem to come to the
conclusion of how I should be retrieving data and assigning this data
to variables.
Since i'm using SQL Server, I'm convinced that I should be using the
datareaders GetSqlDouble (or whatever) function, but this would mean i
need my local variables to be one of the SQL types. The problem
with that is, that there will have to be lots of conversions done by me
to be able to use a SQL type in my application.
For instance, I have a class where i'm retrieving dates. In order
to retrieve them correctly (Null values included), I need to retrieve
them with GetSqlDateTime(), then when it comes time to display the date
in a table, i must first check for nulls, then convert to a
string. This seems to be very cumbersome. Would I be better
off just using GetDateTime(), and the .ToString method, and ignoring
Sql Types all together?
so, basically, how are you guys using your sql server data? with
the supplied sql types, and doing all of the post-processing work
manually? I feel like i'm having trouble conveying my
issue...hopefully someone knows what i mean....i'd just like some
direction to save trouble in the long run, since i feel like there's
got to be a better way...
Confused!
Thanks,
JJ
View 1 Replies
View Related
May 17, 2015
I have a table that contains file paths as
ServernamefolderAfilenameA
ServernameFolderBFilenameB
and I need a query to return
ServernamefolderA
ServernameFolderB
I tried
SELECT DISTINCT left(Source, charindex('', Source)- 0) AS String
FROM Table
But that removes everything after the first and I need it to return all data before the last
View 5 Replies
View Related
Aug 6, 2015
I have the following scenario, The contents of main file are like :
ServerCentral|||||forum|||||||||||||||is||||||the||best
so||||||be|||||on||||||||||||||||||||||||||||||||||||||||||||it
And I need the output in the following form:
ServerCentral=forum=is=the=best
so=be=on=it
The logic being that multiple and consecutive occurrences of the special character, here - pipe , should be replaced by a single special character.
View 5 Replies
View Related
Apr 15, 2004
I have data in a column that starts with 1-4 characters followed by a dash then followed by an number of characters (ex: EU-Surgery).
How do I select everything to the right of the dash when the number of characters to the left of the dash varies?
View 3 Replies
View Related
Oct 1, 2014
I'd like to return the left-most character from an 8 character string & the third from the left character too.
Like this ABC00123 returns AC
$query = "SELECT LEFT(uninum,3), RIGHT(uninum,5), clmarea, Date FROM tblunimov";
$result = mysql_query($query) or die(mysql_error());
echo "<div class='tblstyle1'>";
echo "<table class='tblstyle1'>";
echo "<tr><th>ini</th><th>item</th><th>area</th><th>date</th></tr>";
while($row = mysql_fetch_array($result)){
[Code] ....
View 5 Replies
View Related
Feb 1, 2008
Hi!
I have a table like this below and it doesn't only contain English Names but it also contain Chinese Name.
CREATE TABLE Names
(FirstName NVARCHAR (50),
LastName NVARCHAR (50));
I tried to view the column using SQL Query Analyzer, It didn't display Chinese Character.
I know that SQL Server 2005 is using UCS-2 Encoding and Chinese Character uses Double Byte Character Set (DBCS) Encoding.
I want to read the FirstName and LastName columns and display in Window Form Data Grid and ASP.NET Grid View.
I tried to use this code below and it didn't work. It convert some of the English Name to Chinese Character and it display the chinese character and some still in the original unreadable characters.
Does anybody know how to read those character from SQL Table and display the correct Chinese Character without converting the English Name into Chinese also?
Thanks
int codePage = 950;
StringBuilder message = new StringBuilder();
Encoding targetEncoding = Encoding.GetEncoding(codePage);
byte[] encodedChars= targetEncoding.GetBytes(str);
.
message.AppendLine("Byte representation of '" + str + "' in Code Page '" + codePage + "':");
for (int i = 0; i < encodedChars.Length; i++)
{
message.Append("Byte " + i + ": " + encodedChars);
}
message.AppendLine(" RESULT : " + System.Text.Encoding.Unicode.GetString(encodedChars));
Console.Writeline(message.ToString());
View 1 Replies
View Related
Oct 20, 2007
Hi,
I´m exporting an ms-excel file, then I use a lookup transformation to get a field from a SQL Server 2005 table. The Lookup transformation editor, after selecting the table, shows a warning that says:
at least one mapping between a column from available input columns ans a column from available lookup columns must be defined on the columns page.
So I try to make a relationship in the Lookup transformation editor's column tab where I find the Available input columns and the available lookup columns but I get the following error:
The following columns cannot be mapped:
[Department, DEP_CLEGALCODE]
One or more columns do not have supported data types, or their data types do not match.
The field in SLQ Server is varchar(10) and the input field is a derived column transformation; I have tried different Data Types but I always have the same error.
The DataFlow is: ExcelSource --> Derived Column --> Lookup --> Flat file destination
thanks.
View 6 Replies
View Related
Feb 4, 2006
Hi,
Please help me to know this question.
How many types of UDF are in SQL SERVER 2000?
Please tell me if anybody knows the answer.
Thanks in advance,
Joydeep
View 14 Replies
View Related
Mar 13, 2004
HI i have a big problem i have an exericse to do on SQL for school but i havne tbeen told what they are. All i have to do is to match the follwing togehter and say why they would use it any ideas?
DDl-
DML-
DCL-
these need to be matched up to certain users:
Database administartor
Users
Application develpers any ideas
View 2 Replies
View Related
Nov 29, 2007
in my work I use some "objects", that i tune using "Parameters"
So i have table MyObjects And ObjectParameters-OP
In the table OP i want field for Parameter Type(Type)... now i using type Varchar(63) and then i need for parameters of money type, i will get it by SELECT * FROM ObjectParameters WHERE Type = 'money'...
at the sql.ru i got an answer, where they suggest me using type "sysname", in MSDN i have found that it is equivalent nvarchar(128), i a cant find any differences between my solution and sql.ru solution.
AND main question is.. can i using ID for my types from View sys.types, And can i be sure that it will be the same ID in another version SQL Server (like 2000, 2008) or another installation of SQL Server for same type...
sorry if i have misstakes in my english...
Thanks In Advance...
View 6 Replies
View Related
Jun 2, 2007
Hi,
When creating a database in the Management Studio, you get to select the database owner, and should that be usually the Administrator and ASPNET account?Also, what is this Object Types option for? There seem to be only one "Login" option in there, what does that serve as?
View 2 Replies
View Related
Sep 21, 2007
i want to check the price of sql server 2005 in my country as a consideration to take when deciding on wich db to build.i dont understand the licensing method. what 5 clt stands for ? whats the basic 64 bit 1 processor dual core license i need for a commercial website ? thanx,
View 1 Replies
View Related
Dec 29, 2004
Hello,
I have a really dumb question regarding SQL data types. I have a couple columns in a table that are specified as MONEY. These columns are being read from my web app and displayed on the website for reference when filling in other information.
My problem is that when it is displayed on the website it give four decimal places instead of two. For example I want it to report $33,000.29 but what is actually displayed is $33,000.2965.
How can I set up either SQL or my web app so that it only displays the two decimal places? I've looked into changing the datatype already but SMALLMONEY and MONEY have the same type of decimal values.
Thanks!
View 3 Replies
View Related
Mar 7, 2006
I ham trying to convert a 'System.Data.CommandType' to 'System.Web.UI.WebControls.SqlDataSourceCommandType'.
but I get
Error 4 Cannot implicitly convert type 'System.Data.CommandType' to 'System.Web.UI.WebControls.SqlDataSourceCommandType'. An explicit conversion exists (are you missing a cast?) D:InetpubwwwrootHelp_DeskApp_CodeHelpDeskSql.cs 99 42 http://localhost/Help_Desk/
My problem is I cant seem to get a explicit conversion to work. if it cast it I get an.
Specified argument was out of the range of valid values.Parameter name: value . when running the page. but no build errors, does anyone know how to cast this?
View 2 Replies
View Related
Jun 12, 2006
Hi,
I am getting this error: {"XML parsing: line 1, character 43, unable to switch the encoding"} System.Data.SqlClient.SqlException when I run the code below.
I know it is caused by the fact that the encoding of the XML file I'm trying to insert is not utf-16, but rather utf-8. However I would like to be able to enter any encoding. Is this possible?
If not is there a way to convert the encoding before I insert? Or any other ideas anyone might have. Thanks!
XmlDataSource xds = new XmlDataSource();
xds.DataFile = tbLink.Text.Trim();
xds.XPath = "rss/channel/item";
XmlDocument xmlDoc = new XmlDocument();
xmlDoc = xds.GetXmlDocument();
string strConn = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
sqlComm.Parameters.Add(new SqlParameter("@XMLData", xmlDoc.InnerXml));
strSQL = " INSERT INTO tblCastStore ( intCastID, CastXML ) VALUES ( @@IDENTITY, @XMLData );";
sqlComm.CommandText = strSQL;
try
{
sqlConn.Open();
sqlComm.ExecuteNonQuery();
sqlConn.Close();
}
catch (SqlException se)
{
lblError.Text = se.Message;
}
View 2 Replies
View Related
Aug 7, 2001
I hope someone can help me.
I am running a visual basic program which creates a recordset based on a stored procedure. No matter what cursor type I set I always end up with a static cursor on my recordset. I think the stored procedure is over-writing the cursor type. As I know very little about TSQL, I don't know how to fix this.
Any Ideas?
Barney
View 1 Replies
View Related
Aug 29, 2001
I am looking for a chart of SQL Server data types and information about them, such as usage, constraints, etc. Could anyone point me in the right direction?
Thanks
View 1 Replies
View Related
Oct 2, 2000
I'm just getting used to using SQL 7 Database and am looking for some recommendations on what DATA TYPES to use when designing tables.
The site I am working on now uses cold fusion to enter, update, and insert mainly text and articles. Now the problem with the articles is that some of them are pretty big. And when inserting or updating them, if they go over the limit of characters I get an error.
I know in access I used to use the data type "MEMO" and be able to put a large piece of info in that field.
What's the equivalent for SQL server databe?
What are the most used/common or recommended data types that should be used when putting tables together?
Thanks
George
View 2 Replies
View Related
Jun 24, 2003
Hello, dear Friends!
My situation is a following:
I have some not big databases with only English data and some conteining data in Hebrew.
My question is: May I manage two collation types- meaning the database collation type will be for example some kind of Latin and some databases' collation will be in Hebrew.
If you have any experience of managing DB's in two absolutely different languages (Japanesse, Russian, Chinesse, Arabic with English) please tell me about it.
Best regards.
Marina.:rolleyes:
View 5 Replies
View Related
Nov 21, 2003
hi, i'm trying to build an online forum using sql server 2000 and coldfusion mx.
could anybody help me as to what datatypes i should use for my database fields?
i'll be using 2 simple tables to start with, ie TOPICS and POSTS. each will contain fairly basic information such as name of poster, time, data, title, message etc.
any help would be greatly appreciated.
thanx, zaffi.
View 4 Replies
View Related
Jun 9, 2004
Which data type do I need to assign to my field to let users enter characters such as +=-_| etc....pretty much every single character from a standard keyboard....
thanks
View 2 Replies
View Related
Apr 23, 2008
I have a table that I want to use for reports that holds these datatypes
safe: Integer
unsafe: Integer
made_safe: Bit
unobserved: Bit
Which gets populated.
I want to count the values in each field but Bit fields seem to be awkward. This is my attempt
SELECT
SUM(safe)as TotalSafe,
SUM(unsafe)as TotalUnsafe,
COUNT(Case WHEN unobserved = 1 THEN 1 ELSE NULL END)as NotSeen,
COUNT(Case when made_safe = 1 THEN 1 ELSE NULL END) as TotalMadeSafe
FROM myTable
Any ideas please
View 3 Replies
View Related
Sep 13, 2006
Hi All,
I want to know how many types of edition available for SQL2000 and SQL2005 respectively.
thanks.
View 7 Replies
View Related
Mar 29, 2007
hello,
is it possible to have several replication types within the same database?
for example, for two tables i want "merge replication" with a central server, where twice a day data is merged?
and for three other tables, i want "transactional replication" with a central server, where data is immediately inserted?
thanks
View 1 Replies
View Related
May 10, 2007
Hi,
I am pretty new with SQL and was dabbling in a test database that is linked with a software application.
I made a change to a table - Lets call this (Table1).
Table1 has a multiple columns.
Column1 is defined as numeric(9)
Column2 is defined as varchar(20)
In this case, I wanted to make all values in Column2 = Column1 that did not have a value defined so I ran the following query:
update Table1 set Column2 = Column1 where Column2 = ''
This took effect but the particular software application doesn't recognize these values because they are the wrong data type.
How can I convert all data in a column to varchar(20) if it is another data type (i.e. in this case numeric(9))?
I've tried in Enterprise manager to redesign the table and adjusted the length to 21 and then back and saved it but this did not work. I was looking at Convert and Cast functions but don't know how to write one to accomplish what I need to do here.
Half of the data in Column2 is varchar(20) and half is numeric(9).
I want all to be varchar(20).
Thanks,
asyncd
View 1 Replies
View Related
Feb 14, 2008
Im comparing values. if i add the values which is numeric or monetary in the column and if it is greater than zero it will insert to a table, but the datatype of my column([Day 30 AMT] etc. is char. i want to implement like these like these because it cant return a result if i query..
FROM tbl1 a LEFT OUTER JOIN tb2 b
ON a.ID = b.ID
WHERE b.ID IS NULL AND
a.[Day 30 AMT] + a.[Day 60 AMT] + a.[Day 90 AMT] + a.[Day 120 AMT] + a.[Day 150 AMT] + a.[Day 180 AMT] + a.[Day 210+ AMT]) > 0
View 8 Replies
View Related
Mar 13, 2008
What is the difference between int and numeric data type in sql server 2000. When I should use which?
View 2 Replies
View Related
Jul 20, 2005
what is the equivalent data type of autonumber of access in sql server?
View 2 Replies
View Related
Sep 6, 2006
Hi,
I want to store a decimal value which I get from an execute sql task into a package variable. Which data type should I specify when creating the package variable?
Thanks,
Tom
View 8 Replies
View Related
Nov 5, 2007
I have a code that looks something like this
DELETE FROM [SERVER1].DB.dbo.Table1
I'm wondering when it's connectig to SERVER1, is it using windows authentication? is there a way to setup so it uses SQL Server Authentication?
Thanks,
View 4 Replies
View Related