|
http://msdn2.microsoft.com/en-us/library/ms345147.aspx
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
I am having some difficulty with an MSSQL insert that contains Slovakian, Croatian, Hungarian and other Eastern European characters.
I am using SQL Server Standard Edition Version 8. The Server Collation is Latin1_General_CI_AS as is the Database I am using. The fields I am using are ntext and nvarchar which I understand store data as Unicode.
The problem I am encountering is that if I paste the text directly into the table field using Enterprise Manager, then all the accented characters are correctly displayed and saved. If I insert them through via an SQL statement using Enterprise Manager (or from the website the database is connected to) then the majority of these characters do not retain their accents, etc.
However, *some* of the characters still retain their accents when inserted through the insert statement, such as š (an accented "s" in case there are display issues!), but others like ů lose them.
Changing the collation to Slovakian resolved this problem, but as the database already holds a very large amount of data containing Western European characters I am wary of making such a change should there be any knock on effects.
Is there any way I can get the SQL statement to insert these characters without altering collations, etc? I am just bemused why I can paste them directly into the table using cut and paste but not through an SQL Insert.
Help would be greatly appreciated.
|
|
|
|
|
I have no experience in this area, however I did find a Microsoft article that seems to cover the area click here.
I hope this is of some help...
You always pass failure on the way to success.
|
|
|
|
|
If using a SQL statement, ensure that you use the N prefix on any literal strings, par exemple:
INSERT INTO table VALUES ('š') -- BAD!
INSERT INTO table VALUES (N'š') -- good! The N tells SQL Server that yes, this is a National (i.e. Unicode) character string.
The reason that š works but ů doesn't is that the former is on Western European Windows codepage 1252[^] but the latter isn't. Changing the collation to Slovakian changes to codepage 1250[^] which does have this value.
You should be using parameters with your SQL statements on a website, which should not have this problem if you are using the correct types for the parameters (i.e. adVarWChar for ADO, SqlDbType.NVarChar for ADO.NET SQL Server provider).
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Thank you both for answering this, you've been a great help and the characters are now displaying correctly.
Many thanks!
|
|
|
|
|
Hi All
I want to know is there any extended procedure in sql to find out by which authentication mode sql server is connected.I want to use it in c# application .
Thanks in advance
Regards
DilipRam
|
|
|
|
|
How can you use this without having to authenicate in the first place.
SQL has two modes Windows or Windows and SQL
|
|
|
|
|
Hello Everyone,
Can anybody tell me how to get top two records from the database in SQL Server 2000
For Example: I've ten records then it should return record no. 9 and 10
Thnx
|
|
|
|
|
select top 2 itemnumber
from stocktable
order by itemnumber desc
You always pass failure on the way to success.
|
|
|
|
|
first,thank for willing help me to solve my question, Q1 and Q2.
Q1. I knew "sp_who2" is using to detect who is using database.But , i have not idea that how i write at first?
Q2. Where should i put my script?
Thank again.
-- modified at 5:37 Friday 26th October, 2007
|
|
|
|
|
First of all, read the forum guidelines about naming your posts. Your subject line isn't helpful.
I don't understand your question. Do you want to run an ad-hoc SQL script that calls the SP sp_who2. If you are using Management Studio, open up a new query window for your database and execute it from there. If you are using the SQL 2000 client tools, fire up Query Analyser and do the same.
Paul Marfleet
|
|
|
|
|
thank for your remind about my mistake and your solution.
thank again.
|
|
|
|
|
Can we connect SQL Server 2005 to VSS directly or indirectly using Visual Studio 2005?
|
|
|
|
|
You need to create a VS2005 database project first I'm afraid.
|
|
|
|
|
Many times i came across situations where multiple users updates the same set of records at the same time simultaneously. And i also came across situations while i am selecting a set of 100 records another process should not pick the same set of records.How to Implement this???
Can anyone explain in detail about DB LOCKING and how to retaining DB Integrity..
Whether to apply in Application end while querying or at DB end. And how to test whether LOCKING is implemented or not???
Sathiya
|
|
|
|
|
|
Hi ,
I'm writing .Net Application that works with MS SQL 2005 , and I'm going to run this app on a Windows Server 2003 Operation System and Windows XP Clients , What should I do to deploy this app? Is it enough to Install the main app just in Server computer and then install prerequisites on Clients?Note that I connect to SqlServer using a unique Login and I'm not going to create a new Login for each client .I mean all clients must connect to server using ONE SqlServer Login. I need help on this subject ,
Thanks in advance .
|
|
|
|
|
You haven't explained what the architecture of your system is. Which parts of the system do you install on the server computer and which parts on the client machines?
If your architecture consists of a SQL Server database on your server and a .NET app installed on a number of client PCs, all you need to do is add a connection string entry to the App.config file for your client app that allows your app to connect to the database using the aforementioned SQL login.
Paul Marfleet
|
|
|
|
|
Thanks , Is it possible to just install .Net App on server and share it so that other clients can run it to avoid installing my .Net app on each client?
|
|
|
|
|
For a long time, the Tasks-Generate Scripts command in SSMS used to really annoy me, because I had to choose between creating DROP or CREATE scripts, and only had an optional IF EXISTS check.
Now I'm presented with a set of options that allows an IF NOT EXISTS, and DROP and CREATE in the same script. Am I going mad? What could have caused this change?
|
|
|
|
|
No seems quite sensible to me; these are used to stop you getting an errors by creating something that is already created.
|
|
|
|
|
It know it's more sensible, I just don't know when it changed and what updated caused it to change.
|
|
|
|
|
I have an SQL 2005 data table that has these coloumn;
Name Type
EventDate, DateTime
WaysideAddress, Nvarchar(50)
WaysideName, Nvarchar(50)
State, nchar(10)
AlarmMessage, Nvarchar(50)
What I am trying to do is count the total number of distinct AlarmMessage that each WaysideName reported from the table Grouped by EventDate and WaysideName.
The AlarmMessage is all text.
So the results of the query should look like this;
WaysideName|AlarmMessage|Count
Thanks,
|
|
|
|
|
Solved my own question;
SELECT DISTINCT WaysideName, ST, AlarmMessage, COUNT(AlarmMessage) AS Error_Count
FROM AlarmsList
GROUP BY WaysideName, ST, AlarmMessage
ORDER BY Error_Count DESC, ST, WaysideName, AlarmMessage
Thanks Everyone regardless!
|
|
|
|
|
Hi
I want to count the rows in a DataTable but it should ignore blank rows, I am trying something this,
string batchid = ds.Tables["No"].Columns[0].ColumnName;
ds.Tables[0].DefaultView.RowFilter = "" + batchid.Trim() + "=" + string.EmptyString;
int records=ds.Tables[0].Rows.counl;
the above code showing me following error.
Syntax error: Missing operand after '=' operator
Shahzad Aslam
Software Engineer
Email: shehzadaslam@hotmail.com
|
|
|
|