Localized Data In SQL Database

Feb 17, 2008

Hi,

is there any best practice to store localized data in a (SQL) database? I couldn't find any helpful resources, so I've made my own concept. Any suggestions to improve the following code?




Code Snippet
USE tempdb
GO

--
-- create a table for localized data
--
CREATE TABLE [LocalizedData]
(
[Identifier] varchar(50) NOT NULL,
[Language] varchar(5) NOT NULL,
[Title] nvarchar(50),
[Description] nvarchar(200),
PRIMARY KEY ([Identifier], [Language])
)
GO

--
-- insert some sample data
--
INSERT INTO [LocalizedData] ([Identifier], [Language], [Title], [Description])
SELECT 'String1', 'en', 'first entry', 'This is my first entry'
UNION SELECT 'String1', 'de', 'erster Eintrag', 'Das ist mein erster Eintrag'
UNION SELECT 'String2', 'de', 'Führerschein', 'Kein Kommentar'
UNION SELECT 'String2', 'en', 'driving licence', 'no comment'
UNION SELECT 'String2', 'en-us', 'driver''s license', NULL
GO

--
-- create procedure to retrieve some localized strings
--
CREATE PROCEDURE GetLocalizedData
(
@identifier varchar(50),
@fallbackLanguage char(2) = 'en',
@lang varchar(5)
)
AS
DECLARE @generalLanguage char(2)
, @specializedLanguage char(5)

IF LEN(@lang) = 5
BEGIN
SET @specializedLanguage = @lang
SET @generalLanguage = LEFT(@lang, 2)
END
ELSE
BEGIN
SET @specializedLanguage = @lang + '-' + @lang
SET @generalLanguage = @lang
END

SELECT COALESCE([S].[Title], [G].[Title], [F].[Title])
, COALESCE([S].[Description], [G].[Description], [F].[Description])
FROM [LocalizedData] [F]
LEFT JOIN [LocalizedData] [G]
ON [G].[Identifier] = @identifier
AND [G].[Language] = @generalLanguage
LEFT JOIN [LocalizedData] [S]
ON [S].[Identifier] = @identifier
AND [S].[Language] = @specializedLanguage
WHERE [F].[Identifier] = @identifier
AND [F].[Language] = @fallbackLanguage
GO

--
-- retrieve some data
--
EXEC GetLocalizedData @identifier = 'String1', @lang = 'de'
EXEC GetLocalizedData @identifier = 'String1', @lang = 'fr'
EXEC GetLocalizedData @identifier = 'String1', @lang = 'en-us'
EXEC GetLocalizedData @identifier = 'String2', @lang = 'en-us'
EXEC GetLocalizedData @identifier = 'String2', @lang = 'en'
EXEC GetLocalizedData @identifier = 'String2', @lang = 'de'





Output:
------------------ -----------------------------
erster Eintrag Das ist mein erster Eintrag
------------------ -----------------------------
first entry This is my first entry
------------------ -----------------------------
first entry This is my first entry
------------------ -----------------------------
driver's license no comment
------------------ -----------------------------
driving licence no comment
------------------ -----------------------------
Führerschein Kein Kommentar

It works like I would expect it; a nice fallback like the .NET FX localization, but... I wonder if this approach will still be fast enough with 100.000 entries and more complex queries.

--
Regards,
Daniel Kuppitz

View 6 Replies


ADVERTISEMENT

Localized Messages For SQL SERVER 2000

Nov 13, 2006

I found a usefull link to my problem : http://support.microsoft.com/Default.aspx?id=277535

But I am unable to find the s80xLang.exe file anywhere. I have looked through all my DVDs and nothing.

Anyone know where to look or download it from ?

View 6 Replies View Related

Upgrading Localized MSDE-server To The English Version Of SQL Server Express 2005?

Aug 6, 2007

Hello,

at the moment I have the following problem:
We have installed a version of the MSDE 2000 Sp3 with our software since 2005. Now we install SQL Server Express 2005 in order to use the latest version and to be compatible with Vista.
We have never had any problems with the MSDE, so it was no problem that we installed the german version (by mistake) because there never was any output at installation time.
When we now upgrade the existing MSDE installing the new version of our software, there are often problems and there are error messages, unfortunately in german, which cannot be read by most of our international users.

The problem is, that there seems to be no possibility to upgrade the existing (german) MSDE with the english version of SQL Server Express 2005.
My question is, if it is possible to upgrade the german MSDE to the english SQL Server 2005 to enable our international users to read the error messages at installation time in english?

Thanks in advance.

Best regards,
Peter

View 4 Replies View Related

Database Create ODBC Connections To Access Database Directly And Update Data?

Sep 10, 2012

We have a SQL database that uses Active Directory with Windows Authentication. Can users that are members of the Active Directory group that has read/write access to the SQL database create ODBC connections to access the database directly and update the data? They dont have individual logins on the server. They are only members of the Active Directory group that has a login?

View 1 Replies View Related

How To Change The Data Format For A Single Database In A SQL Server Group Of Database

Nov 1, 2001

Hi all,

I have to change the date format for one database in a group of databases in my sql server 2000,Can you please tell me how to change the date format.


thanks in advance

View 1 Replies View Related

Taking Data From A Different Databases/Data Warehouses Using A Sequel Server 2005 Based Database.

Apr 1, 2008



I'm in the middle of developing a Database for a hospital that measures its audits, inhouse operations, and finance. What we currently have and do everyday is collect data from a large database that is real time with patient data, progess, infomation, etc and dump it into a data warehouse that runs on TSI/Eclipsys. We run reports using a number of programs and dump it into Excel sheets that have charts, reports, etc. This Database for which I'm developing won't come soley from the TSI/Eclypsys source, but this is the only source thats updated regularly. I don't want to have in sync with TSI/Eclipysys in fear that every day when it updates data may be lost, not read, or worse won't be up date if there is a problem. My question is is it possible to run a query from Sequel Server 2005 that will take that data upon request using the reporing features on Sequel Server 2005. i.e. What if I need to run a report on measure B in department 12 from Jan 1-Feb 1, instead of being in sync, can I just write queries to take that information rather than double the data and take up twice the space and trouble. FYI, these datatypes rarely change in the TSI/Eclipsys data warehouse. This sure was long question and didn't intended it to be . Thanks for listening and hope to hear back.


Stephen

View 1 Replies View Related

SQL Security :: Making Data Change In Read Only Database Without Letting Other Users Update Data

Aug 6, 2015

I want to make data changes in read_only database , that's why i must set database read_write. While database is at read_write mode, i want to be sure that no one makes change in database.

For this aim, i write the code below, but i suspect that after setting the database read_write, till the setting database
single_user ,is it possible get DML script from another user. Is the code below enough for this operation. Or is there another way?

Reminding: Read_only database can not be set single_user mode. That's why, first you must set database read_write.

The code;

use master
alter database xxx set read_write
with rollback immediate
alter database xxx set single_user
with rollback immediate

use xxx
update  tablexxx set columnxxx=yyy
use master
alter database xxx set read_only
with rollback immediate
alter database xxx set multi_user
with rollback immediate

View 5 Replies View Related

Error When Transferring Data From Local Database To Hosted Database

Apr 10, 2006

Hi,

View 1 Replies View Related

Transfer Data From A Foxpro Database File To Sql Server Database

Jun 11, 1999

i have a old database in foxpro and it has to be converted to sql server 6.5 database . the table in the foxpro has been broken into more than 1 tables in the sql server . so how can i transfer the data from 1 foxpro table to different tables in sql server 6.5.
vineet

View 1 Replies View Related

Designing A Database Within A Database... Design Question Storing Data...

Jul 23, 2005

I have a system that basically stores a database within a database (I'msure lots have you have done this before in some form or another).At the end of the day, I'm storing the actual data generically in acolumn of type nvarchar(4000), but I want to add support for unlimitedtext. I want to do this in a smart fashion. Right now I am leaningtowards putting 2 nullable Value fields:ValueLong ntext nullableValueShort nvarchar(4000) nullableand dynamically storing the info in one or the other depending on thesize. ASP.NET does this exact very thing in it's Session State model;look at the ASPStateTempSessions table. This table has both aSessionItemShort of type varbinary (7000) and a SessionItemLong of typeImage.My question is, is it better to user varbinary (7000) and Image? I'mthinking maybe I should go down this path, simply because ASP.NET does,but I don't really know why. Does anyone know what would be the benifitof using varbinary and Image datatypes? If it's just to allow saving ofbinary data, then I don't really need that right now (and I don't thinkASP.NET does either). Are there any other reasons?thanks,dave

View 7 Replies View Related

Question About Move Large Amount Of Data From Database To Database

Apr 23, 2007

guys,I have a project need to move more than 100,000 records from onedatabase table to another database table every week. Currently, usersinput date range from web UI, my store procedure will take those dateranges to INSERT records to a table in another database, then deletethe records, but it will take really long time to finish this action(up to 1 or 2 hours).My question is if there is some other way I should do to speed up theaction, I am thinking about use bcp to copy those records to datafileand then use bcp to insert it into SQL Server table. Is this the rightway to do it or should I consider other solution (then, what is thesolution.)Thanks a lot!

View 8 Replies View Related

Weekly Update Part Of Database With Data From Original Database

Mar 26, 2008

Hi!

I have an original database that I want to copy once to another database. Then I want to update the data weekly with the data of the original database. I don€™t change any tables or columns in that part of the database. Just some tables more in the €˜new€™ database (than the tables from the original database) with some references to the tables that have to be updated weekly.
How can I do this? (if you know what I mean... it's a sort of a datawarehouse where different sources come together.. that part that represents the original database is just a part of the datawarehouse. That part is exactly the same structure as the original database.)

Thanks,

Sandra

View 1 Replies View Related

How Can I Return Data From A Database And Fill A Data Grid View?

May 2, 2007

Hi ! I have a textbox and a Search button. When the user inputs a value and press the button, i  want a datagrid to be filled.
The following code runs:
Dim connect As New Data.SqlClient.SqlConnection( _
"Server=SrvnameSQLEXPRESS;Integrated Security=True; UID= ;password= ; database=dtbsname")
connect.Open()
Dim cmd As New SqlCommand
Dim valor As New SqlParameter("@valor", SqlDbType.VarChar, 50)
cmd.CommandText = "Ver_Contactos_Reducido"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = connect
cmd.Parameters.Add(valor)
cmd.Parameters("@valor").Value = texto
Dim adapter As New SqlDataAdapter(cmd)
Dim ds As New System.Data.DataSet()
adapter.Fill(ds)
GridViewContactos.DataSource = ds
GridViewContactos.DataBind()
connect.Close()
I drag a datagrid on the page and only changed its Id.
Into the SQL database the stored procedure is the following:
ALTER PROCEDURE [dbo].[Ver_Contactos_Reducido]
(@Valor VARCHAR(100))
AS
BEGIN
SET NOCOUNT ON;
SELECT NombreRazonSocial, Nombre, Apellido,TelefonoLaboral,
Interno, TelefonoCelular, Email1, Organizacion
FROM CONTACTOS
WHERE NombreRazonSocial = @Valor OR Nombre = @Valor OR Apellido = @Valor OR  TelefonoLaboral = @Valor OR Interno = @Valor OR
TelefonoCelular =@Valor OR Email1 = @Valor OR Organizacion= @Valor
END
When i run the page i can't see the datagrid, and after i enter a text and press the button, nothing happens. What am i doing wrong??
Thks!!

View 2 Replies View Related

Data Access :: Importing Huge Data From One Database To Another Daily

Jul 7, 2015

We have a daily process, which copies millions of rows of data from one DB to another over Linked Server. Just checking on the best practise, are there more efficient ways than the Linked server to copy millions of rows of data from one DB to another? I checked bulk insert but that transfers the data from the file to DB not DB to DB. 

View 6 Replies View Related

Created SQL Server Database Using SYBASE DLL && Data, But Data Problem

Jan 21, 2008



Hello,

I took our SYBASE DDL and created the tables on an SQL Server Express datbase on a PC and then downloaded our data from UNIIX using the WinSCP utility and BULK Inserted the data into the SQL Server database and everything uploaded fine apparently, but when we go to use the data we are getting some data differences.


Do you know of any data conversion issues that may be coming into play here maybe?

Thanks very much!
BobK

View 1 Replies View Related

How To Copy All Data From Table1 In Database A To Table2 In Database B ?

Dec 29, 2004

If I want to copy the data from Table1 in Database A to Table2 in
Database B but Table1 column name is code , Table 2 column name is
vesselcode.
(Code = vesselcode)

How to copy all data from Table1 in Database A to Table2 in Database B ?
Do I need to write the SQL statment ? and Can I use Server Enterprise
Manager Tool?Thx a lot.

View 1 Replies View Related

Adding Data To Database Or Viewing Database In MsSQL

Jun 14, 1999

I am new to ms SQL. I only have the use of the Enterprise Manager.
Creating tables I understand. However I am confused on how to add data to
a table or view the data in a table. Can this be done through Enterprise Manager? If I am adding a large amount of data do I have to use the query window. This seems like a tedious method. In Access yo have a form basically pop up where you can type in the record sets. Any advice would be appreciated! Sincerely,
Bill Bequette

View 1 Replies View Related

Transferring Data From MSDE Database To SQL 2000 Database

Jul 23, 2005

Hi all,Here is my situation.I have an application that uses SQL 2000. The client has a programthat uses MSDE. The client MUST have the MSDE version of the Database.What I have done is to create a SQL 2000 Database that is exactly likethe MSDE version. What I wish to do, is at regularly scheduledintervals, update the SQL 2000 Data with the newest MSDE Data.On my clients server, they have both MSDE and SQL 2000 installedthe msde has a user name and password to access it, whereas the SQL2000 uses authenticated mode to access it.What I'm trying to do is to write a bunch of SQL Queries, that I canrun that will copy over the new Data, but I'm having problems accessingthe msde database in query analyzer from the SQL DatabaseCan anyone give me hints on the best way to try thisThanksScott

View 1 Replies View Related

Best Way To Return Data From SQL Database, Without Giving Access To Database

May 8, 2008

Hello,

I have a quick question regarding getting data from a SQL database but I am slightly confused as to the best way to handle it.

Basically on of the projects I am working on I need to send data to another company, there are several calls required to the database to bring back various options for changing the questions asked on the front end.

Up to now all that has happened is there has been a mutual agreement between myself and this other company and they have just had access to the database to call a series of stored procs which I have written for them to access the data. Recently however the situation has changed and my client wants me stop them accessing the database however they still need to recieve the information from the database they recieve now.

What will be the best way to handle this? My knowledge of SQL is farily limited presently and I am only ust getting into learning a lot more about it.

Any help and advice would be greatly appreciated.

Kind regards,

Lee

View 5 Replies View Related

How To Export Whole Database Schema To Another Database But Not Include The Data?

Sep 21, 2007


I need to export a database, x, of a server, X, to another database, y, of a server, Y and I need export the database schema only, not include the data.
Does anyone know how to do that?
Many thanks for replying.

View 7 Replies View Related

Error Importing Data From Oracle Database To An SQL Database

Oct 11, 2005

Hi!

View 36 Replies View Related

SQL Express Database Table Data Insert Into Another Database

Apr 15, 2007

Hi,

I have two SQL Express database and I want to do two things. One is to transfer a table over to the other database. Two, move the files from one table in one database to another. Please let me know when you get a chance.

Thanks,

Kyle

View 8 Replies View Related

How To Update Data From This Database To Orther Database ?

Jun 20, 2007

 
Please help me How to update data from this Database to orther Database ?
Thank

View 5 Replies View Related

Can You Convert Access Database Data Over To An SQL Database?

Feb 15, 2008

I would like to start using SQL, how would I convert my data in MS Access over to an SQL Server Database?

View 2 Replies View Related

Appending Data From Database 1 To Database 2 (live Into Dev Env)

Feb 1, 2005

have 2 databases in sql server 2000

Live
Dev

I need to append all the data from LIVE into DEV environment. I have tried using MS Access (linking tables & importing tables and running APPEND query to update the rows from LIVE to DEV but PK & FK is causing problems as some data will have the same ID's....

Could I use DTS--Access wizard in SQL Server.

What is the best option to use?

Thanks all in advance

View 2 Replies View Related

Data Transfer From Collation CI Database To A CS Database

Jul 20, 2005

I have a client who was installed improperly on a Case InsensitiveCollation SQL system and have been working with this system for over ayear. For them to move forward in application software versions, theywill need to be reinstalled on a Case Sensitive SQL system. I waswondering if anyone has tried this and was willing to provideinformation that may be of assistance? I have tried various someoptions within DTS but without success.

View 1 Replies View Related

Populate Database Tables With Data From Another Database

May 2, 2008



I have two Databases with the same name that reside in different servers. The two servers are linked servers. Each database consists of 5 Tables. The tables have identical names in each database.

The database in ServerA has 5 tables with data, the database in ServerB also has 5 tables with the same schema as ServerA, however the 5 identical tables in ServerB contain no data.

I need to populate the 5 tables in ServerB with the Data from the 5 tables in ServerA.

What SQL code or script can i use to populate the 5 tables in ServerB

Below are the names of the 5 tables:

TABLE1: [ServerB].[ProdDB].dbo.[Orders]
TABLE2: [ServerB].[ProdDB].dbo.[Sales]
TABLE3: [ServerB].[ProdDB].dbo.[Employee]
TABLE4: [ServerB].[ProdDB].dbo.[Customer]
TABLE5: [ServerB].[ProdDB].dbo.[Region]


Does any one have a script that could help me with this task. Thanks

I am using SQL Server 2005

View 2 Replies View Related

How To Transfer Data From A Database To Another Database.

May 2, 2008

Hi,
   I want to transfer some tables and their data from a database to another database so what is the best way of doing..
 In the source Database i right click on that table and then gave Script table and then selected Create To and then copied that create table query and pasted it in the destination table..
 
So is there is way i can get the rows from all of that table.. There are around... 1000 rows or something like that and that database consits of 5 - 6 tables.
any help will be appreciated..
Regards,
Karen

View 4 Replies View Related

Inserting Data Into One Database From Another Database

May 1, 2012

I have two databases im working with, one is our public database GRM_Public, and the other is our production database GRM_Prod.

I'm trying to import data from a field called 'oldscreencodes1' from GRM_Prod.Transfer table into a field called 'Sale1Type' in GRM_Public.Real_land table.

For some reason I can't get this to work, I have in the past imported datatables from our production DB to our public DB by using 'insert into' but I've never inserted data into a single field within a datatable and I think I'm over thinking this process.

Is a 'join' necessary in order to accomplish this?

View 6 Replies View Related

Insert Data One Database To Other Database

May 7, 2007

hi

i am using this queries is

Insert into excelb.B.dbo.Emp(Employee_Name,Emp_addr) Values (@Employee_Name,@Emp_Addr) select * from excelb.A.dbo.Emp



excelb - server name

now my problem is a server to another server insert the data that not acces the data and i am using different password the servers- but same pasword are insert the data

plz help me



bye

elango

View 4 Replies View Related

SQL Server Test Database To SQL Server Production Database -- Data Migration

Feb 25, 2006

Hi,

Is there any tool available to migrate the data from the SQL Server test database to SQL Server production database. Data Migration should be based on a condition which can be given as an input for a table by the user. The dependant tables also should be migrated based on the given condition. i.e data subsetting based on the matching conditions.

Ex : Salary > 2000

The rows of the table which matches the condition alone need to be migrated for the corresponding table. Also its dependant table's rows should be migrated based on the given condition. Please help me with a tool which can automate this.

Thanks,
MiraJ

View 4 Replies View Related

Copy A Database Table With All Its Data, Indexes And Constraints To A New Table In The Same Database

Feb 4, 2008

Hi,
How can I copy a database table with all its data, indexes and constraints to a new table in the same database in sql server 2005

View 7 Replies View Related

Select Data From Table In One Database Server While Connected To Another Database Server.

Dec 18, 2007



Hi,


Is there a way in SQL Server 2005 to use a select statement to fetch data from a table in another Server while running the query in one Server.

Like using a database Server Link in oracle...


Thanks
Pramod

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved