How Do I INSERT Reserved Characters?
Mar 2, 2001The Query:
INSERT INTO Table1
VALUE('this doesn't work')
How can I Insert strings like the one above, into my database?
The Query:
INSERT INTO Table1
VALUE('this doesn't work')
How can I Insert strings like the one above, into my database?
I have tried both in sql server 2000 and sql server 2005 the following code:
DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><![CDATA[lÃnea átona]]></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))
I always get an error 6603 in SQL2000 and 6602+8179 in SQL2005, wich means it can't parse the 'Ã' and 'á' characters, though they are in a CDATA.
I have tried with <,>,@ characters and it works fine.
I have also tried using 'á' and 'í' without CDATA but I get the same message:
DECLARE @DOC VARCHAR(100)
DECLARE @HDOC INT
SET @Doc='<datos><texto><línea átona></texto></datos>'
EXEC sp_xml_preparedocument @HDOC OUTPUT, @DOC
SELECT * FROM OPENXML(@HDOC,'datos',2) WITH (texto nvarchar(50))
I must be doing something wrong, but I cannot imagine what it could be. I made a brand new table and started to enter some data. I am putting the initail data in using Enterprise Manager. This is essentially test data for development. I have several varchar columns set to 8000 for their size. When I try to enter text into them it is getting truncated at 999 characters. I thought that maybe I misunderstood the varchar type and that 1000 characters is 8000 bits and that is what the 8000 means. So, I redid the table with the datatype "text" for my long columns. Same thing. It is being truncated at 999. Is there something I am missing here? I am not trying to do anything tricky or confusing, I am simply trying to put more than 1000 characters into a table column.I should mention that I have been pasting the text that is copied from Notepad (to remove any extranous formatting). The text cuts cut off and I cannot even type in the column after that.Any clues would really be appreciated.
View 2 Replies View RelatedHi, I'm new here. Happy new year!
Simple question. I can not insert special characters such as ' " ( ) etc. What special escape I need to put in my sql statement?
The Query:
INSERT INTO Table1
VALUE('this doesn't work')
How can I Insert strings like the one above, into my database?
I am writing a web application and everytime I attempt to insert some special characters in the database I get errors. Is there a way around this?
View 5 Replies View RelatedFor eg, insert into tab values ('She's a woman');
What are the other characters that'll fail the insert ?
TIA !
Hi,I'm having an issue where users are copying and pasting text from word documents. The formatting of certain special characters such as mswrods curly ' is fine until the string is inserted in to the db (sql2000 varchar field). I'm using asp.net 2.Any ideas on this one?Ta Dan
View 3 Replies View RelatedHi
I am developing an application where i want to store the different language (i.e. chines,Arabic,urdu etc) character in database (SQL Server). so when i store arabic characters in SQL server , it stores the (???????).
datatype of field is nvarchar.
is anybody know about the problem and solution.
Regards
Mubahsar Ghazi
I'm adding data to a text column, and whenever I have a backslash at the end of a line it disappears. Here's an example:
Code:
INSERT INTO MyTable (TextCol) VALUES ('some text
some more text
yet more text')
The on the first line is fine- the on the 2nd line just disappears. If I add a 2nd backslash on the end of the line, one is inserted. If I add a space to the end of the line, everything works as normal. I can fix this client-side, but before I do I'd really like to know what's going on?
I have current current sql server 2000 database containing some columns in big5. To display these cols correctly, my asp.net nust have directive with CodePage="1252" ContentType="text/html;charset=BIG5". I can not update, or insert big5 character into these columns via .aspx page. I'm using .net framework 2.0. Please help me, thanks a lot for any help.
View 7 Replies View RelatedI'm testing, with SQL 2014 on the same DB, a procedure that extracts data from a table into a file and Loads data from that file into a different table which has the same columns as the initial table (I use a function to create the create table statement from the source table and change the name of the destination table)
when doing my bcp -c the record with the special character "é" doesn't make it to the file.
when doing a bcp -w the record with the special character makes it to the file but the bulk insert omits the whole record.
The result file in the case that makes it to the file is unicode. I'm not using a format file (don't see the need for it)
The bulk insert into the destination table that contains identical columns as the source (a mixture on int, varchar, char) --> didn't work
I also tried by building the columns of the destination table with nvarchars -- Still doesn't work.
I tried the bulk insert with:
codepage = 'ACP, 'RAW' --> didn't change anything. still didn't work.
It's a complicated process that takes 1 XML record that contains information + the Create Table Statement (to eventually be able to this on a different server/DB) + the title Row for each column + the Data... Each of these are created with a BCP command (all with the same options). they are then appended to each other with a copy /B c:file1.txt + c:File2.txt + c:File3.txt + c:File4.csv c:ResultFile
Once the result file is created I bulk insert the 2 first rows in one table "TableA"
create the tmp table "TABLE B" with the create table statement that is in "TableA"
and do another bulk insert of the remainder of the file into the newly created table.
What else can I try? Should I be creating a format file? what are the benefits of a format file?
It's a very long procedure that does both Extract and Load (with 12 parameters) not sure what I should put here.
Hi,
We have a table with a column called 'text' Yes, text is a reserved keyword for data type. I can select it 'SELECT text FROM thistable' but when I try to use it in the order clause, 'SELECT text FROM thistable ORDER BY text', I get this error:
'The text, ntext, and image data types cannot be used in an ORDER BY clause'
I know, you're not supposed to used reserved keywords but the person who initially created this didn't know. We would prefer not to change the column name as this would require tons of changes in the code & COM object.
Is there a way to order this column?
Thanks.
Does anyone know where I can get a 7.0 reserved word list?
View 1 Replies View RelatedI migrated a SQL7 database to a SQL2000 server by restoring from a backup file. Everything worked fine until we restarted the SQL Service a few days later and suddenly a table named Function caused me much grief
It seems Function is a reserved word in 2000 - but not in SQL 7.
I am guessing the restore fooled the system into thinking it was a SQL7 database until the restart? Anyone have any ideas why else it would have worked just fine for 5 days, then die on a restart of SQL service (not even a reboot!)
Sandie
I've got a sproc that we are migrating from SS2K that uses the reserved keyword 'Pivot'. Best way to replace it. I think it is renameable until the select from TempDB (which is mysterious as I can't see a table in tempDB by that name!!) as below...
CREATE PROCEDURE [dbo].[sp_CreateXtab]
@select varchar(8000),
@sumfunc varchar(100),
@pivot varchar(100),
@table varchar(100),
@SQLOutput varchar(8000) OUTPUT
[code]....
Hi, I have got a problem. When I try to access my database table Users, I get the following error:
SELECT permission denied on object 'Users', database 'Users', owner 'dbo'.
So
I tried to grand this select command in MS Web Data Administration, but
it doesnt work. When I try to grand db_datareader role to dbo, I get
the following error
[Microsoft][ODBC SQL Server Driver][SQL
Server]Cannot use the reserved user or role name 'db_datareader'.
Does someone have an idea where could be a problem?
We want to covert all reserved words
in procedures to upper case,any suggestions ?
I have one column name that is: description
when i write a query the world lights up with blue, I think I saw someone using [ ] around the word but I no longer remember if this is the way to handle reserve words that have been use as columns names
Hi there,
I'm trying to recreate a MS-SQL database in MySQL. One particular table has a column names "Precision", a reserved word in MySQL. I woudl really prefer to keep this name if possible as it will be referenced in all sorts of places. I've tried single and double quotes, that didn't work.
Is it possible to use reserveds word as column names? How?
cheers
Dear Friends,I'm running a SQL 2005 database. Lately (in the last 4 months) my database size has grown exponentially and now totals 2.5 gig (it used to be about 100mb). When I run sp_spaceused i get the following info:
Reserved Space 2522MB
Data 450MB
Indexes 215MB
Unused 1856MB
<!--[if !supportLineBreakNewLine]-->
The unused space is reserved by my two largest tables, one being 542mb (which is a log I create and the size seems fine for the amount of data) reserving 1033mb and the other being 121mb (which is another log and also seems fine) reserving most of the rest.
I have tried running DBCC SHRINKFILE and DBCC CLEANTABLE commands on a backup copy of the database and cannot seem to free the unused space.
I have also tried copying the database in an attempt to reduce the unused reserved space and have tried creating a new database and importing the tables with no luck
Any help would be greatly appreciated, noting that I'm honestly not that technical and would probably need step by step instructions, but if you only have time to point me in the right direction that would also be of great help!
Jano
Hi!
We are encountering an issue of using OLE DB destination with the field name of the table is a reserved word in the database.
The database is DB2 V8 (mainframe). "partition" is one of the reserved word in V8 (It is not in the previous version and the whole thing worked fine).
It errors out when it reaches to the OLE DB destination task to do the insert. It complaints about using the reserved word, "partition". We could use an "OLE DB command" (instead of a to do an OLE DB Destination) with the insert SQL statement explicitly by putting double quote around the field name, partition in the insert statement. It works this way. But We wondered if there is any work around of using a reserved word in OLE DB destination in that case?
Thanks!
I am attempting to define a Transactional Publication with Updateable Subscriptions.
One of the articles in the definition has a column called "insertDate" The attempt fails with"A .NET Framework error occurred during execution of user-defined routine or aggregate "sp_MSmakeconflicttable_ sqlclr" System.Data.SqlClient.SqlException: Column names in each table must be unique. Column name insertdata in table 'conflict_ <Publication Name>_<TableName>' is specified more than onceDoes sp_MSmakeconflicttable_sqlclr attempt to create a derived table with this additional column.
Must I rename my column.Are there any other names I should watch out for (other than the standard reserved keywords).
Here we go,
I have a great question for all of you.
What is the problem in using reserved words in table columns name? Any one have a compeling reason not to use?
Here is an exemple:
/ ******** Table ********/
Entity
EntityId
Name
When you query this table you should use the [ ] like this:
SELECT EntityId,[Name] FROM Entity
Anyone have any objection to this, with actual facts?
The question why use this?
This about the programing object in C#
Entity oneEntity = new Entity();
oneEntity.Name = "Test Entity";
It could be:
oneEntity.EntityName = "Test Entity";
Any one???
In my application I must store over 16000 character in a sql table field . When I split into more than 1 field it gives "unclosed quotation mark" message.
How can I store over 16000 characters to sql table field (only one field) with language specific characters?
Thanks
Please can anyone help me - I am trying to establish whether there are any reserved symbols in SQL passwords
eg % £ " $ ( / < * etc
The SQL BOL has a list of reserved words but I cannot find a list of reserved symbols.
We have a problem where by for example if the main part of the password is "test" and my user wants to add a punctuation mark into this we get "You are attempting to use an invalid character message"
Specifically
"test$" is accepted "$test" is not accepted
None of "te+st" "+test" "test+" are accepted.
Has anyone else come across this and found a list of the logic that produces these results so I can point my users in the right direction?
Cheers
Hey guys,
I have a table which has 6 text columns (tblA).. I no longer require 1 of those text columns and want to reclaim the space that it is currently taking up..
Is the only way to BCP out all the data (except the 1 column i no longer require) drop the column and BCP the data back into the table?
Hi,
I haven't found anything that shows that "sample" is a reserved word in SQL 2000. However when I enter it in Query Analyzer, the color changes to blue, as it is a transact-sql word. However, I'm still able to create a table called sample or name the column.
Does anybody know why query analyzer recognizes it as a transact-sql/reserverd word??
Thanks in advance,
Jorge
In on of the server tempdb is not releasing the reserved space after completion of data loads,as of now 99% of free space available in data file,we tried to shrink the datafile ,and space has not been released.
View 7 Replies View RelatedHello all,
I have a database that supports two different applications.
For arguments sake I'll call them "intelligent app" and "clueless app"
The client that provided me the schema for the clueless app used reserved words as field names.
The words used are:
value, state, and time
I explained to the client that modifying them could prevent current/future issues.
The client is an "oracle" db (and in my mind should know better but .....) and responded back to me with the following:
BEGIN QUOTE
They are not currently reserved and there is no guarantee they will ever be reserved. In fact, the SQL server line eliminates as many words from the reserved list as they add with new releases. There are other words on the
possible future reserved keyword list that I do not wish to avoid either unless forced to some day, like depth, size, class, zone, level and others.
END QUOTE
Now for the assistance request, where can I find the documented ramifications of using reserved words?
I want to have my documentation (and my ducks lined up) when this clients portion of the app fails.
Any and all assistance is greatly appreciated.
T. Mullins
Hi everybody,
I would like to know if there is any property in sql2000 database to separate lowercase characters from uppercase characters. I mean not to take the values €˜child€™ and €˜Child€™ as to be the same. We are transferring our ingres database into sqlserver. In ingres we have these values but we consider them as different values. Can we have it in sqlserver too?
Hellen
Re: SSRS report viewer Execution ' ' cannot be found
(rsExecutionNotFound) Reserved.ReportViewerWebControl.axd
Every now and then, my users get this error while in the Reportviewer.
Usually, they have to close the window where the report was rendered
and pull it open again. Attempting to open the report again does not
work.
What is this?
I run the report viewer like this:
<rsweb:ReportViewer BackColor="Transparent" ZoomMode="Percent"
width="100%" ProcessingMode="Remote" ID="ReportViewer1"
runat="server">
<ServerReport ReportPath="/myfolder/myreport"
ReportServerUrl="http://myserverr/reportserver" />
</rsweb:ReportViewer>
In my web config:
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Data.OracleClient, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0,
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider,
Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>
</compilation>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
Thanks for any help or information.
I am setting up my first sql node on a 2 node cluster and runing into this
The disks are already added into the failover cluster manager