Why Do Some System Views Have Columns With Different Collations Then The Default Collation?
Oct 8, 2007
I'm recreating many of my DBA scripts that no longer work in 2005 due to the rework of system tables. It's a risk I lived with knowing that someday the system tables would change. I'm now encountering collation problems, which I do not understand. I know how to fix the problem, but I don't know why the collation issues exist in the first place.
Run the following command.
Select * From sys.all_objects a JOIN master..spt_values b on a.type = b.type
You will receive the following error.
Msg 468, Level 16, State 9, Line 1
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS_KS_WS" in the equal to operation.
Now run sp_help 'sys.all_objects' and look at the collation defintion for columns "type" and "type_desc". In my environment they have a collation of Latin1_General_CI_AS_KS_WS. This is different then the overall default collation of SQL_Latin1_General_CP1_CI_AS, thus causing the error.
My question is why did Microsoft need to make this collation different for these columns?
Any ideas?
Thanks, Dave
View 3 Replies
ADVERTISEMENT
Sep 15, 2014
I changed the default collation of a database and every table within that except sysDiagrams , which I can't even through the designer .
View 9 Replies
View Related
Jan 31, 2008
Hi folks,I'm having issues trying to create a union using two Views I created.View 1:SELECT dbo.Development.Object_Id, dbo.Development.Related_Event_Id, dbo.Development.Related_Staff_Id, ExDescription.Surname + '. ' + ExDescription.PreferredName AS StaffMember, dbo.Events.Event_type, dbo.Events.Academic_Year, dbo.Events.Start_date, dbo.Events.End_date, dbo.Development.IsStaffMemberFROM MONDAS.Reaseheath.dbo.ExDescription AS ExDescription INNER JOIN dbo.Development INNER JOIN dbo.Events ON dbo.Development.Related_Event_Id = dbo.Events.Object_Id ON ExDescription.AccountCode = dbo.Development.Related_Staff_Id COLLATE Latin1_General_CI_AI View 2:SELECT dbo.Development.Object_Id, dbo.Development.Related_Event_Id, dbo.Development.Related_Staff_Id, dbo.NonStaffExDescription.Surname + ', ' + dbo.NonStaffExDescription.PreferredName AS StaffMember, dbo.Events.Event_type, dbo.Events.Academic_Year, dbo.Events.Start_date, dbo.Events.End_date, dbo.Development.IsStaffMemberFROM dbo.Development INNER JOIN dbo.Events ON dbo.Development.Related_Event_Id = dbo.Events.Object_Id INNER JOIN dbo.NonStaffExDescription ON dbo.Development.Related_Staff_Id = dbo.NonStaffExDescription.AccountCode In the first view I am linking to another server, which is why I have had to change the collation, but the second view all the tables are in the same database hence the collation is the same.But when I'm trying to do a UNION between the two I get another collation error, but can't figure out how to change the collation like I did in the first view.Heres the UNION query:SELECT Object_Id, Related_Event_Id, Related_Staff_Id, StaffMember, Event_type, Academic_Year, Start_date, End_date, IsStaffMemberFROM dbo.DevView1UNIONSELECT Object_Id, Related_Event_Id, Related_Staff_Id, StaffMember, Event_type, Academic_Year, Start_date, End_date, IsStaffMemberFROM dbo.DevView2 Can anyone help?Thanks
View 3 Replies
View Related
Oct 23, 2003
SQL Server 2000: Is it possible to change SQL server's default collation without reinstall ?
View 3 Replies
View Related
Sep 3, 2002
On installation of SQL2000 if one selects the 'typical' installation one gets a default collation of SQL_Latin1_General_CP1_CI_AS, which among other things sets the default code page to 1252 and accent sensitive. If one selects the 'custom' installation one can choose a default collation, not one of the backward compatible selections; in fact one must select a default collation in order to override the AS setting. If one does select the default collation to override the AS setting one gets a default collation of Latin1_General_CI_AI.
Unfortunately SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AI are not compatible collation sequences for string comparison operations.
One of our vendors really wants the SQL_... collation setting for their database; however, our other enterprise applications want accent-insensitive set. Other than overriding the collation sequence for all databases and tables, etc. is there a way to create a server default collation setting of SQL_Latin1_General_CP1_CI_AI???
Thanks,
AL
View 2 Replies
View Related
Mar 22, 2006
HiWhen we installed SqlServer2000 we left the default collation name(Sql_Latin1_General_CPI_CI_AS).The user defined databases we created afterwards were defined with adifferent collation name in order to be able to accept the character setwe use, Hebrew.We are looking into switching DTSs that we use to copy data from ourmain system , that uses an Ingres database, into OSQL scripts. Althoughthe DTSs successfully copy the Hebrew letters when I copy data with OSQLit comes over as jibberish.After looking into the matter I came to the conclusion that while DTSrefers to specific databases and uses the destination database'scollation name , OSQL refers to the remote server and destination serverand therefore uses the collation name of the server and not of thedatabase. In order for it to successfully copy the Hebrew I need tochange the default collation name of the installation.Is "rebuild master" the way to do such a thing ? (this is a productionserver so we are wary of doing a "rebuild master")Has anyone else run into similar problems when transfering data betweenservers using OSQL ?ThanksDavid Greenberg
View 3 Replies
View Related
Apr 10, 2007
I was looking in sys.syslogins and sys.sql_logins for a property to tell me if the login is locked but all i see are properties for if the account is enabled or if the account has access.
Is there a system view I can query to tell if if the account is locked ?
Thanks,
View 3 Replies
View Related
Jan 31, 2006
Hello,
can someone tell me where I can look to find a sql command that
is being executed by an application against my database?
In Oracle, I look in the v$sql_text view - is there something
similar in SQL Server 2000 ?
Many thanks in advance
View 2 Replies
View Related
Nov 26, 2007
I'm trying to access a System Catalog View (sys.database_permissions, and others) from a table valued function. I need to be able to pass the database name into the function so that I can operate on any database. Typically I'd use dynamic SQL to do something like
INSERT INTO #tempTable
EXEC ('SELECT * FROM ' + @DBName + '.sys.database_permissions')
But of course I can't use dynamic SQL inside of a UDF. I know I could do this using a stored procedure, but I'd need the output to be a recordset that I can query.
Has anyone done anything like this? I think I'm stuck.
View 5 Replies
View Related
Jun 4, 2008
Hi all, Is there any easy way to not allow a user to see system views? I have set up 1 view for a login, and I have to use an ODBC connection to access it. However, the 3rd party application I'm using is apparently timing out because of the number of tables/views that are returned. TIA! - Mark
View 2 Replies
View Related
Mar 5, 2006
I've had a couple problems with SMO and I wonder if anyone else has. Specifically, when I run through stored procedures (just like your example) it is painfully slow. Maybe 5 a second. Another problem is filtering on nonsystem objects with either "SVR.SetDefaultInitFields(typeof(Microsoft.SqlServer.Management.Smo.View), "IsSystemObject"); or View.isSystemObject.
Both cases crash my app. Any ideas?
Below are two ways that both crash or hang.
SVR.SetDefaultInitFields(typeof(Microsoft.SqlServer.Management.Smo.View), "IsSystemObject");
foreach (Microsoft.SqlServer.Management.Smo.View view in viewCollection)
{}
OR
foreach (Microsoft.SqlServer.Management.Smo.View view in viewCollection)
{
if (!view.IsSystemObject)
{}
}
View 1 Replies
View Related
Apr 30, 2007
Is there anyway to access system views on/from a linked server?
I have unsuccessfully tried various permutations of
select *
from [MDEDATAWTDss2005].master.[information_schema.colums]
Thanks
View 6 Replies
View Related
May 11, 2015
I got a script, which ran on SQL Server 7. After compiling on SQL Server 2012, I came across that the previous script used a system ViewsTables columns named "suid", which no longer operate in SQL Server 2012. After modifying the script with 2012 and replaced suid by SID, it works but the suid column is not appearing in System Views. What if we want to get that column back in SQL Server 2012? is there any possible way?
View 3 Replies
View Related
Mar 15, 2008
Please, could anyone tell me how to get information from which attribute of which table is the attribute from the view derived(it could also be a complex expression, not just attribute)through querying system tables or views(INFORMATION_SCHEMA, preferably if possible, because it's standard)
i'm using MSSQL2005.
Thank you!
View 4 Replies
View Related
Feb 4, 2008
As im diving into my new DBA role and reading as much as I can, I am a little confused on DMV's and system tables.
I've been reading through the book "SQL Server 2005 Bible", which has been very helpful. I tend to use it in conjunction with BOL whenever I come across something I want to learn more.
Last Friday, I tinkered around with DMV's, which was really cool, but I ran into something today that confused me.
Basically, it was finding out the recovery model for all the DB's on the server. The code in the book was:
SELECT [name], recovery_model_desc
FROM sys.databases;
Which turned exactly what it says it will.
however, I am confused.
I initially thought I needed to specify something in the "[name]" section, but realized, that is not the case.
My question is, why is that?
How do I know when to use [] around something?
I found this article:
http://www.databasejournal.com/features/mssql/article.php/3587906
I have been reading it.
I guess I am just really young and raw to T-SQL to know when to use the language corectly.
Is it due to the fact that the rules or syntax is a little different when using system tables?
Hope that makes sense.
Thanks.
TCG
View 5 Replies
View Related
Sep 21, 2006
All of a sudden none of our merge replications are working. In fact you can't even insert, update or delete and data from the tables in the merge publication. When trying that, we get an error stating:
Msg 550, Level 16, State 1, Procedure MSmerge_ins_E3F43EF8B259476099BBB194A2E1708C, Line 42
The attempted insert or update failed because the target view either specifies WITH CHECK OPTION or spans a view that specifies WITH CHECK OPTION and one or more rows resulting from the operation did not qualify under the CHECK OPTION constraint.
The statement has been terminated.
Currently, the only solution I've found is to delete the publication and recreate it. I'm trying to figure out why this happened. It happened on a development server that to my knowledge, hasn't been changed in a week or so outside of changing the server's IP address. Would that cause such an error to occur?
-mike
View 5 Replies
View Related
Sep 12, 2006
We are in the process of supporting two databases (Oracle 10g, SQL Server 2005) for our application.
I want to know what is the equivalent Tables/Views in SQL Server for the Oracle System tables dba_tab_comments, dba_tab_cols
Thanks in advance
View 4 Replies
View Related
Apr 25, 2008
Is this possible?
here is the situation. I have a DB on one system. I back it up and then restore it to a second system. This second system I run reports off of and I want to create custom views that do not exist on the original system. Can I restore the
backup DB from the remote system without wiping out the custom views on the local system?
I have to do this this way as they won't let us create the views we want on the remote system so the only way we have access to run the reports is by restoring the backup locally.
TIA!
View 2 Replies
View Related
Nov 16, 2007
We recently downloaded and installed SQL Express as it was a required program for our new database management software. When trying to install my database management software I was asked to Login to the SQL server. I entered the SQLEXPRESS server, however, I do not have the SA password. When SQL Express installed it did not ask for a password only for a user name and company. I am running Windows Small Business Server with the Administrator and no password. We did not assign a password to the Administrator account yet.
I have tried to leave the password blank using the login SA and I get error message 28000 Login failed for user. The user is not associated with a trusted SQL Server Connection.
Is there a default password for SA? Or in the alternative, how do I create a user or associate an exising Windows user with a trusted SQL server connection?
View 3 Replies
View Related
Sep 30, 2006
I have a view which at the moment has no unique identifier on each record. When I try adding a column definition to the view such as NEWID() as TransactionId, the view then cannot 1) be selected into a temporary table, or 2) queried on other columns in the table. In either case I end up with an empty result set.
I believe I have a way around this for my purpose, which was principally testability. However, can anyone enlighten me as to how and why this happens?
Andrew Raymond
View 5 Replies
View Related
May 12, 2008
i found that some stored procedure get created automatically in sqlserver 2000 (system stored procedures) ,while doing my work i accidentally deleted those stored procedures can any body answer following questions1: why these stored procedures are there and automatically created2: what happen en if i deleted those stored procedures3: how to recreate those stored procedures with limited user permission thanks in advance
View 2 Replies
View Related
Feb 5, 2001
How do you hide the default system databases so that they cannot be viewed? Also when it it time for me to access them how do I unhide the databases?
View 1 Replies
View Related
Mar 19, 2008
Can a View include an identity column? If a view can include an identity column, how do you go about setting a column as an identity column.
Also how do you go about removing an identity property that may exist on column in a View
I am using SQL Server 2005.
View 7 Replies
View Related
Mar 18, 2008
While learning ASP.net 2.0, I was taught that the the default provider for the SqlDataSource was System.Data.SqlClient, and that I only needed to specify it as a provider when I put it in the web.config file. However, now (in VWDE 2008) when I add a SqlDataSource to a page, it adds ProviderName="System.Data.SqlClient". Does this mean that it isnt the default anymore?
View 1 Replies
View Related
Dec 14, 2011
grant SELECT on all_columns to yogi_bear;
grant SELECT on all_objects to yogi_bear;
grant SELECT on all_views to yogi_bear;
but it doesn't work, why? I know how to do it with a cursor or dynamic sql, but why won't these sql statements work?
View 7 Replies
View Related
Feb 7, 2007
Q: How do I use Calculated Columns from a Data Source View in an OLEDB Data Source Adapter.
I took the following steps:
- Created new SSIS project
- Added a Data Source connecting to a SQLServer2005 DB (MyDataSource)
- Added a Data Source View based on MyDataSource (MyDSV)
- Created a Calcualted field to Table Object MyTable (MyCalcField)
- Added a Connection Manager based on MyDSV
- Added Data Flow to Project
- Added OLEDB Source Adapter to Data Flow
- Attempting to Access Calculated Field MyCalcField to be used in Data Flow.
ISSUE: I can't seem to find a way to get the Calculated field to pass through. It's as though this metadata is not available to the Flow.
Anyone have any ideas?
Thanks - MikeyNero
View 6 Replies
View Related
Apr 25, 2007
I have a server with 3 SQL Server named instances on it - servername, servername/TST and servername/GOLDSTD. I have several databases on the default instance (servername) but users cannot access the databases unless they are given system admin privileges to their login. This occurs using both SQL Server Logins and Windows authentication logins. If I move the database to a different named instance (servername/TST), the problem no longer exists and users can connect with dbo privileges. Any suggestions or is this typical for default instances? Thanks in advance for any help
View 8 Replies
View Related
Oct 30, 2015
In SQL Server 2012 Instance properties ,database default location is not showing system drive E: which was my backup drive. How can I add it again?
View 8 Replies
View Related
Jan 6, 2006
In Windows Server 2003 SP1 (x86) with Sql Server 2000 I could use the following connectionstring no problem
DSN=Hello;
Now I am using Windows Server 2003 x64 and SQL 2005 and I get this error:
Provider is not specified and there is no designated default provider.
If i try Provider=MSDASQL;DSN=Hello; i get
Provider cannot be found. It may not be properly installed.
for DSNless this works fine:
Provider=sqloledb;driver={sql server};server=(local);database=Hello;uid=sa;pwd=p wd;
but i am forced to use DSN as it is in a closed source application which uses set DSNs (the idea there being that you can change the connections how you like in ODBC)
This means that i need the ODBC provider name that will work in here: Provider=...;DSN=Hello;
and then to use whatever works in there as the "default provider" but i cannot find any information anywhere on how to do this!
please reply ASAP!
View 7 Replies
View Related
Mar 25, 2015
How can you install the System Databases to a drive other than the default?
I want the Data Files to be installed on D:MSSQLData and the log files to be stored on D:MSSQLLog.
For better, quicker answers on T-SQL questions, click on the following...
[URL]
For better answers on performance questions, click on the following...
[URL]
View 9 Replies
View Related
Jun 23, 2015
during period of troubles connecting to Local Servers and Sites location i.e., to [URL], the place where all Reports are saved by default, I have continued to work on some Reports that have been saved to file system of my localhost/developing machine. But, upon recovery of http location, I can not see/open those files?
how to approach those files in order to open them in Report Builder 3.0 and thus, to "save as" them to the http location? Seems that Report Builder has chosen that location, by default, somehow.....
View 2 Replies
View Related
Jul 7, 2015
My Integrity job started failing recently with the following error. Msg 701, Level 17, State 123, Line 1 There is insufficient system memory in resource pool 'default' to run this query. Process Exit Code 1. The step failed.
select @@ version
Microsoft SQL Server 2008 R2 (SP2) - 10.50.4033.0 (X64)
Jul 9 2014 16:04:25
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
System is having 4GB RAM and SQL is using most of it. It has 2 processors.
View 8 Replies
View Related
Jul 23, 2005
HiI have a table that currently has 466 columns and about 700,000records. Adding a new DEFAULT column to this table takes a long time.It it a lot faster to recreate the table with the new columns and thencopy all of the data across.As far as I am aware when you add a DEFAULT column the followinghappens:a) The column is added with a NULL propertyb) Each row is updated to be set to the DEFAULT valuec) The column is changed to NOT NULL.However, adding the column as NOT NULL with the DEFAULT seems to take alot longer than if I do steps a) - c) separately.When I say a long time, adding just a single DEFAULT column takesaround 6 hours. Surely it should not take this long?There is a trigger on this table but disabling this does not seem tomake much difference.Can anybody give me any advice on the use of DEFAULT columns please?When should they be used, benefits, disadvantages, alternatives etc.Also should it really take as long as it is taking or is there aproblem with my setup?If I am honest I can't see why DEFAULT columns should be used as thevalues could always be inserted explicitly via the applicationThanks in Advance.Paul
View 5 Replies
View Related