Showing posts with label nvarchar. Show all posts
Showing posts with label nvarchar. Show all posts

Friday, March 30, 2012

HELP HELP varchar

I have a field type of "varchar"

It can not accept to Store Arabic Characters!!! plus i can't change it into ntext or nvarchar my system which goin to export the data into SQL server by suing insert command will hang. so im stucked with varchar!!!

here some sample of my data stored currently in My SQL SERVER 2000

" /   "

Plzzzz help me if there any other way to do it

Do you have the right collation set in your database?

Have a look in BOL (Books on Line) at COLLATE - there's a lot of info in there about how to deal with charachters from different languages and alphabets.

/Kenneth

|||If you want to store arabic characters you will have to change your column data types to nvarchar. So you will have to investigate the problem you are describing while using the nvarchar column. What is the actual problem here ? I am not sure / doubt that this is related to collation problems, but further investigation might help us to solve the problem.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.desql

Friday, March 9, 2012

Help - To use Create #table in Exec command

Hi,
I need the use Create table #table command in the Exec command
Example
declare @.chr_CreateSql nVarchar(4000)
,@.err Varchar(255)
select @.chr_CreateSql = ' Create table #test (ss varchar(255))'
Exec (@.chr_CreateSql)
select * from #test
When I run this I get the following error
But when I change #test to ##test
It works fine.
The reason I need the create table in exec command the number of columns in
temp table is dynamic. Please help me to resolve this issue
Thanks
Senthil> select @.chr_CreateSql = ' Create table #test (ss varchar(255))'
> Exec (@.chr_CreateSql)
> select * from #test
Every day, it seems.
EXEC() has its own scope. When EXEC() has finished, your #temp table no
longer exists.
You can fool it by doing this all in one EXEC() call:
EXEC('CREATE TABLE #test(ss VARCHAR(255)); SELECT * FROM #test')
Or, figure out a way to drop the temp table, or the dynamic SQL, or both.
Neither are considered "best practices"... dynamic SQL is treated quite well
here: http://www.sommarskog.se/dynamic_sql.html

> But when I change #test to ##test
This is a global temp table. I recommend you do not use this syntax unless
you know the pros and cons.

> The reason I need the create table in exec command the number of columns
> in
> temp table is dynamic.
Why not use all the columns and then ignore the ones you don't need.
A