I am working on a SQL Server database that will be accessed (mainly) via a web interface that will have users from various countries. As I understand it, the best way to store data is to use 'n' (nvarchar etc) datatypes for columns, which allow users to enter data and it will be stored in the raw Unicode format. For other reasons the collation of the db has been changed (to Slovenian) but I understand that this will only affect how data is sorted. However, whenever I try to put certain data into the nvarchar field (Such as the £ symbol) the data get transferred to a letter L. Is that how it would be expected to work and if so am I missing something here - note I Know ent manager sometimes shows data incorrectly, but this happens when I add/view data from anywhere (i.e. end manager/ the website/ query analyser).
I've restored a SQL Server 2000 database with a Latin1_General_BIN collation from a .dmp file to a SQL Server 2005 server with a default collation of SQL_Latin1_General_CP1_CI_AS. When I try to change the database collation I get hundreds of the following error:
The object 'CK_PM10200_GLPOSTD_00AF8CF' is dependent on database collation. So, in this case, is it even possible to change the collation if there are objects in the database that are dependent on it?
Hi friends, How r u?..i have one clarification..Curently, i am doing one search engine stuff...for that, i have to populate data from sql server database to flat file..i got java script search engine code from one web-site,in that code,data's are fetching from flat-file only..so i have populate the data from sql server to flat-file, and then get the key-word value from that flat-file according to the user input..Is it possible?..send mail..
I just finished getting a local database mirrored to an offsite "DR" server. Interesting experience getting that working, but that's another story! It's set up as "High Safety without automatic failover (synchronous) (without a witness). I was hoping I could get a sanity check in this flow....
Local database gets updated each morning with a few meg of data, so it's pretty low use. It's mirrored through a T1 (soon to be dual). My remove copy was restored from yesterdays backup, and the mirror was sync'd in less than 10 minutes, so I don't expect bandwidth to be an issue...
In the event that my local server or network is down, I'd be able to log into my remote server, and run my application remotely. From what I've seen, the "Failover" option is only available on the "Primary" server? Will this become an option if the remote no longer sees the primary, or do I need to do this through the command: ALTER DATABASE <dbname> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS?
Since the updates are so limited, I'm not too concerned with data loss, but will need to make sure I can get this running quickly if needed...
As I understand it, this will put the mirrored database as the primary, and when the old primary comes back only, it'll become the new mirror? I can then let them sync, and force a failover from the remote system to put the primary back to the local network.
I just want to make sure I understand this correctly before I start testing. Thanks for any assistance!
I want to create a DataList that shows products, which will be on multiple pages. I have my stored proc to show paged results, which contains a return value for more records. I have found examples of coding the DataReader, defining all the parameters etc, but what about the drag and drop SqlDataSource?? You can select the DataSource Mode to be "DataReader". I can put select parameters in, with input and my return value. I don't know how to then access the return value, or output value if needed, from this? My DataList references the SqlDataSource, but I don't know how to get the return/output value out??? This is very frustrating, cause I can't find any info about it anywhere. Always input parameters, but no output. This is my current SqlDataSource...
If I take out the RETURN_VALUE Parameter, my results display in my data list, but that's useless if I can't access the return value to determine the remaining number of pages etc. Is my RETURN_VALUE parameter wrong? How do I access that? My stored proc is shown below...
CREATE PROCEDURE sp_PagedItems ( @Page int, @RecsPerPage int, @CategoryID int ) AS
-- We don't want to return the # of rows inserted -- into our temporary table, so turn NOCOUNT ON SET NOCOUNT ON
--Create a temporary table CREATE TABLE #TempItems ( ID int IDENTITY, No varchar(100), Name varchar(100), SDescription varchar(500), Size varchar(10), ImageURL varchar(100) )
-- Insert the rows from tblItems into the temp. table INSERT INTO #TempItems (No, Name, SDescription, Size, ImageURL) SELECT No, Name, SDescription, Size, ImageURL FROM Products WHERE CategoryID=@CategoryID
-- Find out the first and last record we want DECLARE @FirstRec int, @LastRec int SELECT @FirstRec = (@Page - 1) * @RecsPerPage SELECT @LastRec = (@Page * @RecsPerPage + 1)
-- Now, return the set of paged records, plus, an indiciation of we -- have more records or not! SELECT *, MoreRecords = ( SELECT COUNT(*) FROM #TempItems TI WHERE TI.ID >= @LastRec ) FROM #TempItems WHERE ID > @FirstRec AND ID < @LastRec
mine is a small organisation and we have deployed an ERP on windows 2003 server. their are total 60 ERP users and we have 25 concurrent licences for ERP.
at the backend we are running MS SQL 2000 standard edition. we have created one user in Database and ERP accesses data through this user only.
now i need to understand how many CAL for database i need to purchase. either 60 or 25 or 1.
I hope someone can help here. I found that I was having replication failing due to the fact that there is a foreign key being referrenced, here is the error: Could not drop object 'dbo.tblName' because it is referenced by a FOREIGN KEY constraint. (Source: Database Name (Data source); Error number: 3726)
In searching for some sort of answer - I came across this: Join Filters
Foreign key relationships are central to most database designs. For example, in a database that tracks product orders, you often see a CUSTOMER table with a CustID primary key and an ORDER table with a CustID foreign key that references the CUSTOMER table. In merge replication, if you filter the CUSTOMER table with a subset filter clause, you must also filter the ORDER table, so that only the rows that reference the filtered subset of rows from the CUSTOMER table are replicated. Filtering requirements that are based on a foreign key relationship must be explicitly represented in the merge replication configuration through a join filter (which lists the two related table articles and a logical expression that identifies the relationship), as shown in the following example:CUSTOMER.CustID = ORDER.CustIDThe effect of this join filter between the CUSTOMER table and the ORDER table, together with the subset filter clause on the CUSTOMER table, is that Subscribers to the publication receive only those rows from the CUSTOMER table where State = 'WA' and only those rows from the ORDER table that correspond to the CustID values in the filtered CUSTOMER table. ________________________________________________________________________ Am I reading this right? If I have only one table that I need to replicate, I would need to included the other tables connected by the foreign key for the replication to work, and in doing so - the table I designate for updating in this replication will be the only one affected and the others that have go with this - won't update their corresponding dupe tables? Sorry - I hope this makes sense.
I have a question , because Im not very experienced with VB.
The function declares
Public myString Public myKey
When something is declared this way, what happens if two or more users happen to execute the report at the same time? Is myString and myKey public to all of those reports at the same time, or does the Report Server manage those variables separately for each of the reports running concurrently?
My goal is to populate a dropdownlist with only with users that are "Techs". I am using the membership database that you ccan set up through VWD. I added this column to the aspnet_Users table: IsTech as bit datatype. I thought I had the right SQL statement but apparently not, because I get an Invalid column name 'True'.Here is my statement: <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:HRIServiceConnectionString1 %>" SelectCommand="SELECT [UserID], [FirstName]+ ' ' + [LastName] AS techid FROM [aspnet_Users] WHERE [isTech] = True ORDER BY [LastName], [FirstName]"> </asp:SqlDataSource>
http://www.microsoft.com/sql/editions/compact/sscecomparison.mspx The above link says the pros and cons of two SQL Server 2005 editions. Document says Compact Edition is not good for When you need a multi-user database server . What is the meaning of multi-user database? Does this means the database strictly will not support two database connections at a time? -Thank you, Gish
Hi, I'm seeing confusing results coming back from a query and I want to make sure my joins are working as expected.
I have 3 tables, tbl_family, tbl_familyPhone, and tbl_phone. tbl_FamilyPhone is a linking table between families and phones that specifies if it's the primary number.
So a family has many familyPhones and a phone has many family phones. I'm trying to get all the families and their home phone only, if they have one. I don't want families to duplicate and I don't want any left out. Here's what I've got
Code Snippet select [whatever]
from tbl_family LEFT OUTER JOIN tbl_familyphone on tbl_family.pk_familyid = tbl_Familyphone.fk_familyid inner JOIN tbl_phone on tbl_familyphone.fk_phoneID = tbl_phone.pk_phoneid and tbl_phone.fk_phonetypeid = 'E6F1688E-015B-481D-8C41-DCC1FEA5D5AB'
My thinking is the inner join between tbl_Phone and tbl_FamilyPhone will cause any FamilyPhone record without a phone record to be left out (fk_phonetypeid is the id of a home phone). Though some FamilyPhone records may be left out, I will not lose any families because it is left outer joined to familyphone. Is this right? Because if I just do select count(*) from families I get 4517 records, but when running the query above with the joins, I get 4383 records.
Does the Table Lock option in the OLE DB Destination task in a data flow refer to a lock on the destination table or on the source table from which the table is loading from?
The reason I ask is because I have a package run twice simultaneously pulling from the same server and table onto two different tables on two different servers. When I kick off my job to run the two data pulls, one of the jobs terminates with a
"TCP Provider: An existing connection was forcibly closed by the remote host." message. I believe this is due to a table lock on the server, but can't figure this out.
- Windows 2008R2 SP2 VM (VMware 6) - SQL 2012 SP2 Std. - NetApp iSCSI LUNs, Snapmanager for SQL
So I have created a test database and configured the logs to grow to max. 120MB in size.
To check the allocated and free space I right-clicked the database -> tasks -> shrink file
I see currently allocated: 5,00MB and 2,50MB free space for the MDF Database I see currently allocated: 1,00MB and 0,63MB free space for the LDF Logfile
Next I use a data generator to fill the database with random data.
After adding around 500k rows I check the size again:
I see currently allocated: 17,00MB and 0,44MB free space for the MDF Database I see currently allocated: 61,94MB and 0,27MB free space for the LDF Logfile
Next I take a full backup incl. truncating log files. After that I check the size again:
I see currently allocated:Ā 17,00MB and 0,44MB free space for the MDF Database I see currently allocated: 61,94MB and 57,24MB free space for the LDF Logfile
So now my question is where are those 56,97MB? I imagined they should now be added to the MDF file but they seem to be just gone. I did this procedure 2x more time and the MDF stays the same size while the LDF is almost empty after backups. Then I thought maybe its in the memory of the server so I rebooted it. But still the MDF has the same size... Is this normal? How it should work?
I am using SQL Server 2008. In ServerProperty function, there are two properties called āCollationā and āCollationIDā. In some cases, I will only know the CollationID. Is it possible get the collation name from the CollationID? Is there a function called CollationNameFromID?
From BOL, I see these remarks with respect to the MODIFY FILE subcommand (my underline added):
Initializing Files By default, data and log files are initialized by filling the files with zeros when you perform one of the following operations:
Create a database
Add files to an existing database
Increase the size of an existing file
Restore a database or filegroup
Which leads me to believe that expanding the size of a datafile will also wipe out (my definition of 'initialize') any existing data within that file.
I may be misunderstanding 'initialize', because when I tested it out, I found this wasn't the case - my table data written to the file was still there after a resize.
Need to clarify to what degree I'd be taking a risk by increasing the file size on a datafile which already has data in it.
We're upgrading our SQL Server database from 2005 to 2012.I ran the Upgrade Advisory report and got this issue "Non-integer constants are not allowed in the ORDER BY clause in 90" because of the script below
SELECT gp.BRAND+' <> '+gp.CATEGORY AS 'full name', gp.PRODCODE, gp.CATEGORY FROM dbo.GFK_PRODUCT gp ORDER BY 'full name'
I tried running the same query in our test SQL Server 2012 and it ran successfully.Ā Now I'm confuse if i still need to change it.I google the issue a bit and came across this linkĀ and mentioned this.
1.) Non-integer constants are ... constants that are not integer number.
Example:Ā 'string1'Ā represents a string constant 0x01Ā represents a varbinary constant {ts '2015-02-26 06:00:00'}Ā represents a datetime constant
1.23Ā represents a numeric constants
2) So single quotes are used to define a string constants / character string constantsĀ butĀ SQL Server allows also to use single quotation marks use also as column identifier delimiter: SELECT ... expression AS 'Column1' FROM ...
In this context is clear thatĀ 'Column1'Ā is a column identifierĀ butĀ when used in ORDER BY :Ā ORDER BY 'Column1'Ā it generates confusion because SQL Server doesn't knows if it represents a string literal (character string constant) or it represents a column identifier / column name."Do I still need to change the existing code even though it's working fine in 2012? If yes, it is because of best practice reason or it will total get deprecated/not working in the future version?
I am using SQL Server 2008. In ServerProperty function, there are two properties called āCollationā and āCollationIDā. In some cases, I will only know the CollationID. Is it possible get the collation name from the CollationID? Is there a function called CollationNameFromID?
Hi: I have a website and related database in English version, now I am trying to start with other language, such as Chinese. The first problem I am facing is: search a user name when user name is Chinese: For example: English version: SELECT u_name FROM Users WHERE u_name = 'eric', it will return a value, but if I type: SELECT u_name FROM Users WHERE u_name = 'č¾ēå ', even if the table cell has the č¾ēå record, it won't return anything. Search online, there are a lot of articles, since I am pretty new for this, can you let me know where to start? How to change the collation for the existing db, do I need to create stored procedure for the search? I would like to solve this problem start from my MSsql 2005 database. If that works fine, then I will go to my web application. Thanks a lot. James
I am using SQL Server 2008. In ServerProperty function, there are two properties called "Collation" and "CollationID". In some cases, I will only know the CollationID. Is it possible get the collation name from the CollationID? Is there a function called CollationNameFromID?
dear experts while i'm learning BCP from books online, i got a doubt. copying data between different collations. what exactly the meaning of collation?
i tried in BOL. but because i'm a junior, i didnt got the good idea about collation. please explain me
I am just trying to understand about how collation and unicode work in SQL Server. My database's collation is Latin1_General, and I set one column in one table to have collation Cyrillic_General. Then in Windows PC where I am running an application that is connected to my database, I set Mongolian Language from Regional Settings. When I typed using Mongolian Keyboards and save the characters into database, then I can retrieve the cyrillic characters back into my application. However, when I checked into database using Query Analyzer, those characters are saved in the column, that has collation Cyrillic_General and with nchar data type, apparently using codepage 1252, my database default codepage. My application and my database server are located in two different machines and I don't install Mongolian language in my database server. So that when other web application reads those characters from that column, even my browser has been set to use Cyrillic encoding, still it showed as characters from codepage 1252.
Could someone explain me what actually happens here?
Hello AllI'm a bit confused about collation settings so needed some info. onit. My database server is currently using SortOrder asLatin1-General, case-insensitive, accent-sensitive,kanatype-insensitive, width-insensitive for Unicode Data, SQL ServerSort Order 52 on Code Page 1252 for non-Unicode DataI have a table:CREATE TABLE [PD_RUSS3].[pdtable_185]([iso_area_indx_no] [int] NULL ,[lineid_1] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CS_AS NULL ,[iso_type] [smallint] NULL) ON [PRIMARY]I have a nonclustered, UNIQUE index located on PRIMARY oniso_area_indx_no, lineid_1, iso_typeHowever I'm able to load a file with these entries:45 '16-XX-WCS' 145 '16-xx-WCS' 1I thought that this would fail because of the above settings. Pleaseenlighten me on what I'm missing here..??thanksSunitJoin Bytes!
Hi,I have SQL Server 2005 database with SQL_Latin1_General_CP1_CI_AS collation, and there is a little problem when inserting Cyrillic text. It works fine when I use SQL Server Management Studio to open specific table and insert new row manually. Problem appears when I use SQL queries. For example: INSERT INTO Customer (ID, Name) VALUES (1, "ŠŠ»Š°Š“ŠøŠ¼ŠøŃ"). ID is type of int, and Name is nvarchar.When I execute the query, value of ID is OK (it is 1), but insted of "ŠŠ»Š°Š“ŠøŠ¼ŠøŃ" the value of Name is "????????" (only question marks).I am not sure now, if I should change database collation(and what to put), or I should change column type of "Name" column.
why do i get collation conflict when i used temp table ??Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.i solved it by using COLLATE Latin1_General_CI_AS (the column name)will i have collation conflicts again when i put my web app on a web hosting company??
Which collation format should I use? SQL_Latin1_General_CI_AS, SQL_Latin1_General_CP1_CI_AS, or Latin1_General_CI_AS I noticed that my development server has a different collation setting to the production server. development. SQL_Latin1_General_CP1_CI_ASproduction. Latin1_General_CI_AS Both these servers are SQL Server 2005 Express and I typically use varchar or text fields for storing the data. I've been told that the difference between them is that the former uses code page 1252, as specified here: http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx However when I compare that to, say, the page of symbols one gets using the 'Insert, Symbol' command via microsoft word I find quite a disagreement. It also differs from the 'View, Clip Library' list provided by TextPad. The data in my database uses non-ASCII characters (or extended ASCII, if you prefer). The administrators of my CMS will sometimes copy and paste or write European spellings for company names etc. When they do that they're likely to resort to Word's Insert Symbol command. When I get this data and show it on a web page I want to specify utf-8 endcoding. Which of these SQL server collations should I be using. I suspect that I should be using SQL_Latin1_General_CI_AS. Essentially, I want the charater as seen in the textbox of the CMS to look identical to that displayed on a web page which has the following meta tag set: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> The aforementioned CMS administrators are entering data on Windows XP PCs running asp.net. They may get the accented characters from several different sources (MS Word Insert Symbol or cut and paste from a web page), but they can agree with me that the symbol should display in the text box of the CMS identically to that on the web site. Can someone put me right on this?
what's the difference between SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AI What the SQL and CP1 mean in SQL_Latin1_General_CP1_CI_AS?and which one should i use?