ALTER ASSEMBLY Needs Special Permission

Feb 20, 2008

Hello again,

I get an error message every time I want to alter an assembly in the Management Studio. The message goes something like this:

"An error occurred in the Microsoft .NET Framework while trying to load assembly id 65610. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues."
I've already found this article on Microsoft support which mentions two possible workarounds. Could you possibly explain me, how do they work? I've tried both methods by 'registering' my windows login, with and without the domain, but none of them seemed to work. I've also set the TRUSTWORTHY property before using these workarounds.

So, do you have any ideas what could possibly went wrong? Thanks in advance for your time and help!

View 8 Replies


ADVERTISEMENT

ALTER ASSEMBLY Error Msg 6509 An Error Occurred While Gathering Metadata From Assembly ‘&&<Assembly Name&&>’ With HRESULT 0x1.

Feb 22, 2008

I work with February CTP of SqlServer 2008.
I have an Assembly with several UDTs inside. Version of assembly is 1.0.*
I use CREATE ASSEMBLY statement to register this assembly, and it runs without any errors. Then I rebuild CLR solution without doing any changes in source code. In that case the only difference between new and old assemblies is version (difference in fourth part of version).
Then I try to update assembly in SqlServer. I use
ALTER ASSEMBLY <name>
FROM <path>
WITH PERMISSION_SET = UNSAFE, UNCHECKED DATA
statement for this. Statement runs with error:
Msg 6509An error occurred while gathering metadata from assembly €˜<Assembly name>€™ with HRESULT 0x1.
I found the list of condition for ALTER ASSEMBLY in MSDN:
ALTER ASSEMBLY statement cannot be used to change the following:
· The signatures of CLR functions, aggregate functions, stored procedures, and triggers in an instance of SQL Server that reference the assembly. ALTER ASSEMBLY fails when SQL Server cannot rebind .NET Framework database objects in SQL Server with the new version of the assembly.
· The signatures of methods in the assembly that are called from other assemblies.
· The list of assemblies that depend on the assembly, as referenced in the DependentList property of the assembly.
· The indexability of a method, unless there are no indexes or persisted computed columns depending on that method, either directly or indirectly.
· The FillRow method name attribute for CLR table-valued functions.
· The Accumulate and Terminate method signature for user-defined aggregates.
· System assemblies.
· Assembly ownership. Use ALTER AUTHORIZATION (Transact-SQL) instead.
Additionally, for assemblies that implement user-defined types, ALTER ASSEMBLY can be used for making only the following changes:
· Modifying public methods of the user-defined type class, as long as signatures or attributes are not changed.
· Adding new public methods.
· Modifying private methods in any way.

But I haven€™t done any changes in source code, so new version of assembly satisfies all this conditions.
What could be the reason for such behavior?
P.S. I€™ve got the same error, if I add or change any method in assembly before rebuilding.

View 9 Replies View Related

Can't Deploy Unsafe Assembly, Permission Problem(?)

Sep 19, 2007

Hello,

I think I have some kind of permission problem. But first things first:

I have code which I would like to run in SQL Server (CLR Integration). First thing is that my code uses third-party-dll. I have to deploy my code as unsafe because of

"

CREATE ASSEMBLY failed because method "add_FunctionAdd" on type "USP.Express.Pro.FunctionsCollection" in safe assembly "USP.Express.Pro.2.0" has a synchronized attribute. Explicit synchronization is not allowed in safe assemblies.
"

Of course I can not create "asymmetric key" for third-party-dll (Or can I?).


So, I tried to use trustworthy DB. But I get all the time error Msg 10327: "Assembly is not authorised for PERMISSION_SET=UNSAFE"

I am using Windows Login to log on Sql Server. Login is granted "Unsafe assembly" and DB has trustworthy setting "on".

Login has server roles "sysadmin" and "securityadmin".
Login is mapped with DB User who has same name ( DOMAINUserName ) and has default schema "dbo".
Login has DB memberships "db_owner" and "db_securityadmin".
DB user owns schemas "db_owner" and "db_securityadmin".

Am I missing something?

Interesting thing is that I can do deployment (as unsafe assembly) in master-database. But not in the other databases.

Questions are:
- Is there other way to authorise third-party-dll than using trustworthy?
- Why deployment can be done in master-database?

And finally:
- Why deployment can not be done in other database?

View 9 Replies View Related

Unable To Load An Assembly With Permission Set = EXTERNAL ACCESS

Jul 20, 2007

Hi



I've loaded a C# assembly into my database with External Access (the dll contains a routine

that accesses Environment.MachineName).



I am now unable to invoke any of the entry points in this assembly. I get the error message



'An error occured trying to load assembly Id XYZ. System.IO.FileLoadException.....'



I have set the database Trustworthy flag to ON and the assembly does not have a strong name.



Can anyone tell me what I've done wrong?



Thanks

Steve



P.S. I am calling the assembly from SQL code residing in a different database than the one

the assembly has been loaded into.

View 3 Replies View Related

Alter Table Permission To Dbo

Jul 20, 2005

I have the following requirementI am creating a login and database user 'test' on a database with dborole .I want to remove create table , alter table permisions to this user.I am able to revoke create table permission but alter table goesthrough.I gave a command deny insert,delete,update on ssycolumns to test.Still I am not able to prevent user altering schema . Alter tablesuccessfully goes throgh.I do not want to use datreader and datwriter role.since I want user 'test' to create storred procedure with dbo ownerIs there a way to achieve this ?ThanksM A Srinivas

View 1 Replies View Related

Severe Error Occurring When Creating Assembly With External Access Permission

Jul 11, 2006

I had created a CLR function in my db and was able to execute it successfully a couple of months ago. But when I tried to execute it today it was throwing errors saying there was something wrong with the permissions on the assembly. So I decided to drop everything and recreate it except I can not longer create the assembly with EXTERNAL ACCESS permissions. Whenever I try to create the assembly I get the followng error:

Msg 0, Level 11, State 0, Line 0

A severe error occurred on the current command. The results, if any, should be discarded.

Msg 0, Level 20, State 0, Line 0

A severe error occurred on the current command. The results, if any, should be discarded.

I also tried to create the assembly with Unsafe permissions and got the same error. Does anyone know why this error would be occurring now? I tried creating the same assembly on a different SQL 2005 server and it creates successfully and can be executed successfully. Any help would be greatly appreciated!!



Thanks!

GN

View 3 Replies View Related

SQL 2012 :: Permission To Create / Alter Proc But Not DBOwner

Feb 5, 2015

Without giving dbowner how can we grant permission to user to alter/create procs?

View 3 Replies View Related

Deny Connect To Sql Permission Or Alter Login Disable

May 7, 2008

Hi All,

I would like to disable a user account from logging to the database. I would like to know the difference between deny connect to sql permission and disabling an account by alter login disable. Please advice. Thanks

View 1 Replies View Related

Granting Permission To A Database User To Alter Database Role

Sep 5, 2006

I want a database user to be able to alter login, database user and database role from my application. so, i assigned that user to sccurityadmin server role, db_accessadmin and db_securityadmin database roles....By now, the user can add or remove login and database user. However, the user cannot add or remove any database role membership. What am I missing here?? What should I do so that the user can create, and alter database roles in the database??

View 1 Replies View Related

Msg 6573 Method, Property Or Field In Assembly Is Not Static. VB.Net Assembly In SQL Server Problem

Feb 29, 2008



I am trying to get a function I created in VB 5 for Access and Excel to work in SQL 2005. I was able to update the old VB code to work in VB 2005. I compiled and made a .dll, and I was able to register the new Assembly in SQL Server. When I try to create the Function, I get an error:


CREATE FUNCTION dbo.Temperature(@FluidName char, @InpCode Char, @Units Char, @Prop1 varchar, @Prop2 varChar)

RETURNS VarChar

AS EXTERNAL NAME FluidProps.[FluidProps.FluidProperties.Fluids].Temperature


Error returned:


Msg 6573, Level 16, State 1, Procedure Temperature, Line 21

Method, property or field 'Temperature' of class 'FluidProps.FluidProperties.Fluids' in assembly 'FluidProps' is not static.



Here is the code (part of it) in the VB class:

Header:


Imports Microsoft.SqlServer.Server

Imports System.Data.SqlClient

Imports System.Runtime.InteropServices

Imports System.Security

Imports System.Security.Permissions





Namespace FluidProperties



'Option Strict Off

'Option Explicit On

Public Partial Class Fluids

Function:


Function Temperature(ByRef FluidName As Object, ByRef InpCode As Object, ByRef Units As Object, ByRef Prop1 As Object, Optional ByRef Prop2 As Object = Nothing) As Object

Call CalcProp(FluidName, InpCode, Units, Prop1, Prop2)

Temperature = ConvertUnits("-T", Units, T, 0)

End Function


If I change the Function Temperature to Static, I get an error that functions cannot be Static. Its been a long time since I created the code and am having a hard time in my older age of getting the cobwebs out to make it work.

I have no problem getting the function to work if I call it from a VB form....so what do I need to do to get it to work on data in my SQL server?

Thanks

Buck

View 20 Replies View Related

Failed To Load Expression Host Assembly. Details: StrongName Cannot Have An Empty String For The Assembly Name.

Jan 12, 2006

I previously had an ASP.NET 1.1 site running on my IIS 6.0 server (not the default website) with Reporting Services running in a subdirectory of that website.  I recently upgraded to ASP.NET 2.0 for my website and was greeted with an error when trying to view a report.  The error was very non-descript, but when I checked the server logs, it recorded the details as "It is not possible to run two different versions of ASP.NET in the same IIS process.  Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process."

 

First of all, I could not figure out where and how to do this.  Secondly, I decided to try to also change the Reporting Services folders to run ASP.NET 2.0 and when I did, I was greeted with the following message when attempting to view a report:

 

"Failed to load expression host assembly. Details: StrongName cannot have an empty string for the assembly name."

Please help.

View 7 Replies View Related

Creating A System.Management Assembly In Order For My Own Assembly To Work?

Aug 2, 2006

Hi

I am a bit paranoid about what I just did to my SQL Server 2005 with this CLR experiment.

I created a Class Lib in C# called inLineLib that has a class Queue which represents an object with an ID field.

in another separate namespace called inLineCLRsql, I created a class called test which will hold the function to be accessed from DB, I referenced and created an instances of the Queue class, and retrieve it's ID in a function called PrintMessage.

namespace inlineCLRsql{


public static class test{


public static void PrintMessage(){



inLineLib.Queue q = new inLineLib.Queue();

int i = q.queueId ;

Microsoft.SqlServer.Server.SqlContext.Pipe.Send(i.ToString());



}

}

}

to access this from the db, I attempted to create an assembley referencing inLineCLRsql.dll. This didn't work as it complained about inLineLib assembly not existing in the db. I then attempted to create an assembley for inLineLib but it barfed saying System.Management assembly not created.

so what I did is (and this is where I need to know if I just ruined sql server or not):

1- ALTER DATABASE myDB SET TRUSTWORTHY ON;.

2- CREATE ASSEMBLY SystemManagement

FROM 'C:WINDOWSMicrosoft.NETFrameworkv2.0.50727System.Management.dll'

WITH PERMISSION_SET = UNSAFE

3- CREATE ASSEMBLY inLineLibMaster

FROM 'D:inLineServerinLineLibinDebuginLineLib.dll'

WITH PERMISSION_SET = unsafe

4- and finally

CREATE ASSEMBLY inLineLib

FROM 'D:inLineServerCLRSQLinlineCLRsqlinDebuginlineCLRsql.dll'

WITH PERMISSION_SET = SAFE



Everything works after those steps (which took some trial and error). I can create a sproc like:

CREATE PROC sp_test AS

EXTERNAL NAME inLineLib.[inlineCLRsql.test].PrintMessage

and it returns the Queue ID

Is there anything unadvisable about the steps above?



Thanks for your help



M



View 1 Replies View Related

Error Registering Assembly Using CREATE ASSEMBLY

May 1, 2008

We have written a test CRL stored procedure to test replacing one of our complex stored procedures but can€™t get it deployed to our SQL server that hosts a mirrored configuration of our production database (very locked down). It works fine on our development instances (not very locked down). It only references the default assemblies that were added when we created the project. All it does is use Context Connection=true to get data, loops though some records and returns the data using SQLContext. CLR is enabled on SQL server, the assembly is strongly signed, and we tried deploy using the binary string with the SAFE setting.


CREATE ASSEMBLY for assembly 'SQLCLRTest2' failed because assembly 'SQLCLRTest2' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message
[ : SQLCLRTest2.StoredProcedures::GetLift][mdToken=0x600001e] Type load failed.
[token 0x02000008] Type load failed.

View 8 Replies View Related

Error: CREATE ASSEMBLY For Assembly

May 31, 2007

I am trying to deploy a Database Project with Visual Studio 2005 and SQL Server 2005 Standard.
I import €œSystem.IO€? and have therefore set the permission levels to EXTERNAL_ACCESS.

I am receiving the same error message that many folks have received.

CREATE ASSEMBLY for assembly 'Images' failed because assembly 'Images' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS.
The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ACCESS ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission. If you have restored or attached this database, make sure the database owner is mapped to the correct login on this server. If not, use sp_changedbowner to fix the problem. Images.

My CLR access is €œon€?

I have tried

1) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to [BuiltinAdministrators].
2) From master run: GRANT EXTERNAL ACCESS ASSEMBLY to €œMy Windows Authentication ID€?.
3) Run ALTER DATABASE MYDATABASE SET TRUSTWORTHY ON
4) In Visual Studio .NET 2005 Set the permission levels to €˜external€™
5) Tried BuiltinAdministrators and my SQL Server Windows Authenticated Login ID for the ASSEMBLY OWNER.

I can compile BUT NOT DEPLOY

Any help would be greatly appreciated.
Regards Steve

View 8 Replies View Related

CREATE ASSEMBLY Using Assembly Binary?!?!

Mar 8, 2006

I was trying to understand how VS.NET2005 was deploying .NET CLR assemblies to SQL2005 so I ran a trace and found some interesting results.

VS.NET creates some SQL that looks pretty interesting:

CREATE ASSEMBLY [AssemblyNameHere]
FROM 0x4D5A90000300000004000000FFFF000......<continue binary data>
WITH PERMISSION_SET = EXTERNAL_ACCESS

Boy howdy!

I have tried to reproduce this and create my own deployment application but I cant figure out how they create this binary stream. The info in BOL is not much help and I have not found any samples anywhere on how to create this stream in c#.

Anyone out there been able to get this to work?

-Ben

View 4 Replies View Related

Alter Table Alter Column In MSACCESS. How Can I Do It For A Decimal Field?

Jul 23, 2005

Hi people,I?m trying to alter a integer field to a decimal(12,4) field in MSACCESS 2K.Example:table : item_nota_fiscal_forn_setor_publicofield : qtd_mercadoria integer NOT NULLALTER TABLE item_nota_fiscal_forn_setor_publicoALTER COLUMN qtd_mercadoria decimal(12,4) NOT NULLBut, It doesn't work. A sintax error rises.I need to change that field in a Visual Basic aplication, dinamically.How can I do it? How can I create a decimal(12,4) field via script in MSACCESS?Thanks,Euler Almeida--Message posted via http://www.sqlmonster.com

View 1 Replies View Related

SQL Server - Permission Issues : Execute Permission Denied On Object 'SprocName'

Dec 13, 2005

I have an application that uses Integrated Windows authentication. My Web.config looks like below
<add key="dbconnection" value=" server=XXX;Initial Catalog=XXX;persist security info=False;Integrated Security=SSPI;Pooling=true" />
When users try to access my application, they get the below error:
Execute permission denied on object 'SprocName', database 'DBNAME',Owner,'dbo'
The Only way I  could get rid off the error is if I set DBO permissions for the user group on the databse.
Can someone suggest how to set up a security group with the ‘necessary’ permissions on SQL SERVER (ie read,write execute Sproc etc) and not too many extra ones, like DBO.
Thanks,
 

View 2 Replies View Related

Insert Permission Denied After Granting Permission

Sep 19, 2007



SQL Server 2005 anomoly?
In SQL Server Management Studio I granted specific permissions to user "A" to do Select, Insert, Update, Delete on Table "B" -
When I logged on as User "A" and attempted the Insert imto table "B" I got the following error:
"Insert Permission Denied on Table B, Database C, Schema dbo"
Is this a problem with the dbo schema?

Then I went back and created a stored proccedure "D" with the exact same Insert statement inside the procedure. I granted User "A" execute permission on the stored procedure "D".
I then logged on as User A and executed Stored Procedure "D". No Problem - stored procedure executed fine with the Insert.
I attempted the Insert statement again - straight SQL - as User "A" and got the same error as above ("Insert Permission Denied.....")
Strange behavior - cannot do a SQL. Insert even though user has permissions but can execute a store procedure with the same Insert statement.
What gives?


View 2 Replies View Related

Alter Table Alter Column

Jul 20, 2005

I would like to add an Identity to an existing column in a table using astored procedure then add records to the table and then remove the identityafter the records have been added or something similar.here is a rough idea of what the stored procedure should do. (I do not knowthe syntax to accomplish this can anyone help or explain this?Thanks much,CBLCREATE proc dbo.pts_ImportJobsas/* add identity to [BarCode Part#] */alter table dbo.ItemTestalter column [BarCode Part#] [int] IDENTITY(1, 1) NOT NULL/* add records from text file here *//* remove identity from BarCode Part#] */alter table dbo.ItemTestalter column [BarCode Part#] [int] NOT NULLreturnGOSET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGOhere is the original tableCREATE TABLE [ItemTest] ([BarCode Part#] [int] NOT NULL ,[File Number] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_File Number] DEFAULT (''),[Item Number] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Item Number] DEFAULT (''),[Description] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Description] DEFAULT (''),[Room Number] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Room Number] DEFAULT (''),[Quantity] [int] NULL CONSTRAINT [DF_ItemTest_Quantity] DEFAULT (0),[Label Printed Cnt] [int] NULL CONSTRAINT [DF_ItemTest_Label Printed Cnt]DEFAULT (0),[Rework] [bit] NULL CONSTRAINT [DF_ItemTest_Rework] DEFAULT (0),[Rework Cnt] [int] NULL CONSTRAINT [DF_ItemTest_Rework Cnt] DEFAULT (0),[Assembly Scan Cnt] [int] NULL CONSTRAINT [DF_ItemTest_Assembly Scan Cnt]DEFAULT (0),[BarCode Crate#] [int] NULL CONSTRAINT [DF_ItemTest_BarCode Crate#] DEFAULT(0),[Assembly Group#] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Assembly Group#] DEFAULT (''),[Assembly Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULLCONSTRAINT [DF_ItemTest_Assembly Name] DEFAULT (''),[Import Date] [datetime] NULL CONSTRAINT [DF_ItemTest_Import Date] DEFAULT(getdate()),CONSTRAINT [IX_ItemTest] UNIQUE NONCLUSTERED([BarCode Part#]) ON [PRIMARY]) ON [PRIMARY]GO

View 2 Replies View Related

Alter Table Alter Column...

Oct 8, 2007

I am using sql server ce.I am changing my tables sometimes.how to use 'alter table alter column...'.for example:I have table 'customers', I delete column 'name' and add column 'age'.Now I drop Table 'customers' and create again.but I read something about 'alter table alter column...'.I use thi command but not work.I thing syntax not true,that I use..plaese help me?



my code:
Alter table customers alter column age

View 7 Replies View Related

TSQL - Using ALTER TABLE - ALTER COLUMN To Modify Column Type / Set Identity Column

Sep 7, 2007

Hi guys,
If I have a temporary table called #CTE
With the columns
[Account]
[Name]
[RowID Table Level]
[RowID Data Level]
and I need to change the column type for the columns:
[RowID Table Level]
[RowID Data Level]
to integer, and set the column [RowID Table Level] as Identity (index) starting from 1, incrementing 1 each time.
What will be the right syntax using SQL SERVER 2000?

I am trying to solve the question in the link below:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2093921&SiteID=1

Thanks in advance,
Aldo.

I have tried the code below, but getting syntax error...



ALTER TABLE #CTE
ALTER COLUMN
[RowID Table Level] INT IDENTITY(1,1),
[RowID Data Level] INT;


I have also tried:

ALTER TABLE #CTE
MODIFY
[RowID Table Level] INT IDENTITY(1,1),
[RowID Data Level] INT;







View 18 Replies View Related

Assembly.Load Can't Load My Custom Assembly From The GAC.

Mar 7, 2007

Hi there.

I have an assembly, call it A1, that I've deployed to a SQL Server 2005 database. I can use the managed stored procedures from A1 in SQL Server no problem.

In A1 there is a bit of code which uses the Assembly.Load() method, so load another assembly and use instances of class found in that external assembly. However, when I run the managed stored proc in A1 that uses Assembly.Load() I get the error:

Could not load file or assembly 'A1, Version=1.0.0.0, Culture=neutral,PublicKeyToken='????' or one of its dependencies. The system cannot find the file specified.

(note: for security I've changed some of the above line).

So I changed the Assembly.Load() to use

System.Data,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089

I re-built the project, re-deployed it and ran the code in SQL Server - it worked. I could create an instance of a System.Data.DataSet for example. So why can't I load my own custom assembly? My assembly does have a strong name and it's installed in the GAC. I wrote a console app to try and Assembly.Load() my custom assembly and that worked fine (it was also running on the same server as the SQL Server).

So it's defiantely the SQL Server that can't 'see' my customer assembly. What do I need to do this assembly so that SQL Server will allow me to Assembly.Load it, just as it can with System.Data?

Thanks
Jas.

View 1 Replies View Related

A Special Thank You

Nov 17, 2004

I want to thank Brett Kaiser and Pat Phelan for advising me to get the "The Guru's Guide to Transcact-SQL" HOLY MOLY what an awesome book and the software that comes with it is so awesome "Sequin". This book is better then any of the Microsoft books, it breaks it all down for you and doesnt make it too difficult to understand I stayed up late last night reading this book. (which is why I'm exhausted today). This is by far the best Transact-SQL book I have ever come across.

THANKS GUYS :):):)

View 8 Replies View Related

Special Character

Dec 8, 2005

Hi,

i have the following problem:

I like to extract all special characters in one table with many fields.
How can I handle this without using 'replace' for each field and many characters ?

Thx. for ur suggestions.

dajm

View 2 Replies View Related

Special Characters

Jan 16, 2006

Hi All

I have a database I want to check whether any special characters are entered or not

E.g.

Post
-------

Director
Asst*Director
Ma^nager

I want to see all the entires where special characters like !@#$%^&*()_+ are entered

Plz help

Thanks

View 8 Replies View Related

Special Characters

Mar 10, 2008

Hi,

I an concatenating a string using char(187) as the separator. When I run the command "select char(187)" I get the symbol >>

However, when it writes to a csv file it is showing as an overscore instead.

Is there a known problem with special characters when writing to files?

View 2 Replies View Related

Special Character

Jul 20, 2005

How can I insert by asp a string containing 'That's the stringAsp code:SQL = "insert into tablename (columnA) values ('" & variable & "')"The problem is when variable contains a ' (single quote), it stops thestring definition and get an error.Can I do something?Thanks--Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

View 2 Replies View Related

Special Characters

Apr 2, 2008

Our SQL 2005 databases have "SQL_Latin1_General_CP1_CI_AS"
collation settings on the server. One of tables has one column declared as "ntext".
When we try to insert "‚¬" character directly trough insert statement and retrieve it, we're getting right results. When we use web-services to insert data with this character (euro), and retrieving the data back, we're not getting this sign back. We are getting some characters like little squares. If I try to copy and paste them into notepad, I am getting ???
However, when I tried to place them here, I got them right:

‚¬ Å Å¡ Ž ž Å’ Å“ Ÿ

How can we assure visually they are inserted properly?

View 1 Replies View Related

Denormalizing With A Special Need

Sep 2, 2007

I have the following:

Demograph Table (PK MemberID)
-MemberID
-FirstName
-LastName

InsuranceSegments Table (PK = all columns combined)
-MemberID
-ProgramCode
-StatusCode
-BeginDate
-EndDate


I need to get the data into this table (i'll call the table MyTest)
-MemberID
-FirstName
-LastName
-BeginDate
-EndDate
-ProgramCode
-StatusCode

The catch:
For each record in the demograph table I need only one segment and that segment is to be based on the greatest EndDate.

What I need:
Give me the last segment for each demograph record and put each into it table MyTest

In my pseodo thinking
INSERT INTO MyTest (MemberID, FirstName, LastName, BeginDate, EndDate, ProgramCode, StatusCode)
SELECT
Demograph.MemberID, Demograph.FirstName, Demograph.LastName,
InsuranceSegments.BeginDate, InsuranceSegments.EndDate, InsuranceSegments.ProgramCode, InsuranceSegments.StatusCode
FROM
Demograph
INNER JOIN
InsuranceSegments
ON
Demograph.MemberID = InsuranceSegments.MemberID
WHERE { Need help :-) }
Need help with the where clause to get the segment with the 'highest/latest' EndDate


Sorry for the wall of text. I hope this is enough information to receive help and would like to thank you in advance for your time :-)

J

View 7 Replies View Related

Special Count

Feb 7, 2008

Hi everybody,

I need to write a special count on my table and I don't have idea how to do it.

I have an Audit table like that:

EventTime (DateTimeColumn) - Description (varchar) - UserID
----------------------------------------------------------------

2008-01-28 08:47:19 blabla User 12008-01-28 08:49:04 blabla User 1
2008-01-28 08:51:52 blabla User 2
2008-01-28 08:56:38 blabla User 3
2008-01-28 11:20:03 blabla User 2
2008-01-28 11:59:57 blabla User 32008-01-28 12:00:07 blabla User 32008-01-28 12:00:16 blabla User 32008-01-28 14:52:31 blabla User 32008-01-28 14:52:34 blabla User 4
2008-01-28 15:15:43 blabla User 4

I need to count the number of record for each user (on the datetime) BUT if there are x records in the same minute, I want to count it only one time.

Exemple: the user 1 and the user 3

For the user 1, the result should be 1 because there are 2 records for him, but 2 in the same minute.
For the user 3, the result should be 3 because there are 4 records for him, but 3 in the same minute.

I have any idea about the way to do it.
Your council are welcom ;o)

Thanks in advance
Jerome

View 6 Replies View Related

Cannot Use The Special Principal 'sa'

Aug 29, 2006

Hello,

I am starting to use SQL Server 2005. I am having trouble connecting remotely. I tried to enable the 'sa' user and got this error:

Cannot use the special principal 'sa'

Is the 'sa' user no longer valid for remote connections?

Thank you





View 11 Replies View Related

Cannot Use The Special Principle 'sa'

Jan 9, 2008

Ok, here's my issue... SQL 2005.

I have about 12 different databases, which about 4 of them are have no user mapped to it. Under the SA login, databases are mapped to the "dbo". The 4 I am having issues with have no user mapped. They are blank.

Here is where I am at... Security>Logins>sa>Login Properties>User Mapping

The columns are "Map", "Database", "User", and "Default Schema"

Here is an example of the correct Selection
Map=checked, Database=eDistribution, User=dbo, Default Schema=dbo


Now here is an example of a problem database
Map=unchecked, Database=FORMS, User=blank, Default Schema=blank

Here is the error when trying to add the "dbo" as a user

Any ideas?

TITLE: Microsoft SQL Server Management Studio
------------------------------
Create failed for User 'sa'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+User&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot use the special principal 'sa'. (Microsoft SQL Server, Error: 15405)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1406&EvtSrc=MSSQLServer&EvtID=15405&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------

TITLE: Microsoft SQL Server Management Studio
------------------------------
Create failed for User 'dbo'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+User&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
User, group, or role 'dbo' already exists in the current database. (Microsoft SQL Server, Error: 15023)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1406&EvtSrc=MSSQLServer&EvtID=15023&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------

View 1 Replies View Related

Special SQL Select Statement

Mar 1, 2007

Im starting a project that will be used to reserve rooms in a building.  My problem right now is writing an sql statement that will return a dataset with the proper results.  I have three tables setup below.  I need a dataset that returns rooms that are closed on a certain date and a set that returns open rooms on a particular date.I cant seem to figure out that sql statement... Any suggestions will be greatly appreciated.  tblRooms   pkRoomID   fkReservationID  tblDates   pkDateID   fkReservationID  tblReservation    pkReservationID    fkRoomID    fkDateID  

View 3 Replies View Related







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