insert hebrew string to database with SQL Server 2008 R2 - database

I am trying to insert hebrew strings into a SQL Server database using visual studio 2010 and SQL Server 2008 R2 with connection string but in the database table I get ????? instead of the original string. Just to mentions that it doesn't happen in the past. What could be the problem?

You have to change database collation.
Run the following script :
USE master;
GO
ALTER DATABASE YOUR_DATABASE_NAME
COLLATE Hebrew_CI_AS ;
GO

Related

CREATE OR ALTER PROCEDURE

According to this blog, CREATE OR ALTER feature was introduced in SQL Server 2016 SP1 but when I executed this statement for my SQL Server 2008 R2 version database, it worked. Any idea why?

Can't see data in SQL Server database table

I can't see data in SQL Server database table. The column is of nvarchar(MAX) not null.
It stores json string in string format.
When I run query Select * from table, I can see the data in output window, but can't see when I open table using edit top 200 rows.
You need to update your SQL Server Management Studio (SSMS) to the latest version. This problem occurs if you use SSMS v. SQL 2008 for working with SQL server 2014.

Database table with field of type date not allowed in SQL Server 2008 R2?

I am trying to create a table with a database field of type DATE in SQL Server 2008 R2, but every time I try, I get this message:
Column, parameter, or variable #10: Cannot find data type date.
Now I know this datatype is permitted with 2008 r2, so what is going on?
I am trying to create this table within Microsoft SQL Server Management Studio.
Are you sure you are running against a SQL Server 2008 R2 instance? Is it possible that you are using the SQL Server 2008 R2 version of Management Studio, but connecting to SQL Server 2005? What does SELECT ##VERSION; yield?

Convert SQL Server 2008 database to SQL Server 2005

Convert SQL Server 2008 database to SQL Server 2005. Any solution please?
You can script your 2008 database to create the database objects and insert data, then run that script on the 2005 instance. You might have to temporarily disable foreign keys to get some of the inserts to work.
If you want to set the compatibility level of your 2008 SQL Servers to be 2005 (so that you are effectively saying that they are all 2005), you can use the SET COMPATIBILITY_LEVEL command to do this...MSDN link
Using there example, you would run this on your 2008 databases:
ALTER DATABASE database_name -- change me!
SET COMPATIBILITY_LEVEL = 90 -- set to sql server 2005 compatibility level

SQL 2005 2008 collation issue

I've been working on SQL server 2005 for a few years and i'd never come across collation issues. However i installed SQL 2008 on a virtual machine and tried to sync my 2005 database with the new 2008 server using Redgate SQL compare. It failed complaing about the collation on the 2 servers being different.
After a quick bit of research i discovered my 2005 is using Latin1_General_CI_AS and the new 2008 installation is using SQL_Latin1_General_CP1_CI_AS.
Why is 2008 using something different to 2005? Both times i've just done a default install. Secondly what should i do to get them the same, which collation is the correct one?
I do not know what criteria is used for the MS SQL Server installer to select default collation.
Collation of a server does not have to be the same as the collation of a database on that server. Collation of a database does not have to be the same as the collation of table columns in the database.
You can set the collation of the database when you create one. Default it will get the same collation as the server.
Here is a post about how you can change the collation of a database including changing the collation of columns.
Changing SQL Server Database sorting
with a reference to here http://support.microsoft.com/kb/325335.
Here is a starting point if you need to change the default collation of a server
http://msdn.microsoft.com/en-us/library/ms179254.aspx.
I do not know what is necessary for Redgate SQL Compare, but I guess it only needs the database collation to be the same. So if you are replicating a db to a new server you probably only need to create the new db with the same collation as the one you already have and leave the default collation of the server as is.

Resources