Schema Advice For Private Message Function

Jul 16, 2007

 Hi Guys,
 I've got a bit stuck trying to decide on a table structure for a private message like part of a site I'm building (I'm using SqlServer 2000, not that it really matters).
at first I was going to use a single table with the following schema:
 
MessageId int
ReplyToMessageId int (nullable)
FromUserId uniqueidentifier (I'm using .net membership)
ToUserId uniqueidentifier
IsRead bit
IsDeleted bit
Subject nchar(50)
Body nvarchar(1000) 
DateCreated datetime
DateUpdated datetime
CreatedBy uniqueidentifier
ModifiedBy uniqueidentifier
 
What strikes me here is that I'm using alot of guids (which are huge) and if I'm going to be threading the messages (which I am) there's no easy way to return an ordered list of messages that are replies to each other. So then I thought about introducting a messageThreads table, but I can't think of anything to store there apart from a threadid (which seems to defeat the purpose)
Any ideas? I can clarify more if necessary.
Thanks 

 

View 6 Replies


ADVERTISEMENT

Query With A Big Function..advice...ideas...

Mar 27, 2007

Ok, im fairly new to SQL (real world use) uni wasn't all that, so im throwing out my idea for some feedback, and to see if it is at all possible.

I have 2 tables, 1 is called Hotels, and 1 is called Flights. I want...to list every Hotel, with price, availability date, and Flight date from a (GetDate()) function, up untill a date specified in a query.

At first this sounds easy. However... a hotel can be available for up to a month or two at a time, so at least 60 records for 1 hotel.

In this query i want a SUM of the Hotel price between the GetDate() date, and the end date specified in the query.

Can this all be done in 1 SQL query?

Thanks in advance for any input you may provide.

Gnub

View 16 Replies View Related

Setting The Schema For An SP/Function

Feb 21, 2008



Hi Guys,

I wanted to know how to set the schema for a stored procedure/function. I have some tables, T-SQL stored procedures and fuctions under schema MYSOFT and I call them as follows

MYSOFT.LOOKUP_REC

I have now written some c# SP's and Functions and want to add them to the MYSOFT Schema, how would I do this. I have tried setting the Assemly Owner value to MYSOFT in the project properties but it doesnt seem to work. I can see all my other functions & SP's having the schema name as their post fix in braces

FIND_NAMES (MYSOFT)

but not my c# ones.

When I try to access my C# Function with the schema name MYSOFT I get an error message

'Cannot find either column 'MYSOFT' or the user-defined function or aggregate 'MYSOFT.FIND_NAMES' or the name is ambiguous'

I would appreciate any help

Thanks & Regards

View 4 Replies View Related

Can Delete 'dbo.' Schema When Call Function In SP

Nov 21, 2007

Hi:

We found the problem that when the SP call function,there must have 'dbo.' before the function.Does it necessarily?Can delete 'dbo.' schema when call function in SP?

View 1 Replies View Related

Problem Creating Function To Be Schema Independent

Apr 1, 2008

I am writing a SQLServer script that I want to be schema name independent. I mean I know that all users of the script will have the same tables, but not necessarily the same schema name.

When I hard code the script to use the name of my schema, wcadmin, it works OK.

CREATE FUNCTION wcadmin.dectohex(@a numeric)
RETURNS varchar(8)
BEGIN
DECLARE @x varchar(8)
DECLARE @y varchar(1)
DECLARE @z numeric
DECLARE @w numeric

SET @w=@a
SET @x=''

WHILE @w > 0
BEGIN
SET @z = @w % 16;

SET @y= CASE @z
WHEN 10 THEN 'A'
WHEN 11 THEN 'B'
WHEN 12 THEN 'C'
WHEN 13 THEN 'D'
WHEN 14 THEN 'E'
WHEN 15 THEN 'F'
ELSE CAST(@z AS varchar)
END

SET @w = ROUND(@w/16,0,1)
SET @x = @y + @x
END

-- Pads the number with 0s on the left
SET @x = RIGHT(REPLICATE('0',8) + @x ,8)
RETURN @x
END;
GO

select 'WTDOCUMENT' HOLDER,
dm.WTDocumentNumber ITEMNUMBER,
dm.name ITEMNAME,
ad.fileName ContentFilename,
fh.hostName VaultHost,
wcadmin.dectohex(fi.uniqueSequenceNumber) VaultFile,
fm.path VaultPath
from
WTDocument di,
WTDocumentMaster dm,
HolderToContent hc,
ApplicationData ad,
FvItem fi,
FvFolder ff,
FvMount fm,
FvHost fh
where di.idA3masterReference = dm.idA2A2
and fm.idA3A5 = ff.idA2A2
and fm.idA3B5 = fh.idA2A2
and fi.idA3A4 = ff.idA2A2
and ad.idA3A5 = fi.idA2A2
and hc.idA3B5 = ad.idA2A2
and hc.idA3A5 = di.idA2A2

DROP FUNCTION wcadmin.dectohex;
GO

But when I remove my schema name I get the error

'dectohex' is not a recognized built-in function name.

In this case I'm just using :-

CREATE FUNCTION dectohex(@a numeric)
.
.
.
.
select 'WTDOCUMENT' HOLDER,
dm.WTDocumentNumber ITEMNUMBER,
dm.name ITEMNAME,
ad.fileName ContentFilename,
fh.hostName VaultHost,
dectohex(fi.uniqueSequenceNumber) VaultFile,
.
.
.
.
DROP FUNCTION dectohex;

Creating and dropping the function seems to work OK when I drop the schema name, I just can't call it.

I've been trying various permutations of dbo and [dbo] prefixes unsuccessfully.

Any suggestions?

Thanks


David

View 5 Replies View Related

SQL Server 2012 :: Error Message - Aggregate Function And Group By Clause

Feb 19, 2014

I'm trying to write a query to select various columns from 3 tables. In the where clause I use a set of conditions, but most important condition is that I only want to see all results from the different columns where the ph.ProdHeaderDossierCode contains at least 25 lines of processed hours. I tried this with group by and having, but I constant get error messages on all other columns that I want to see: "is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause". How can I make this so I can see all information I need?

Here is my code so far:

selectph.CalculatedTotalTime,
ph.ProdHeaderDossierCode,
ph.MachGrpCode,
ph.EmpId,
pd.PartCode
fromdbo.T_ProcessedHour ph,

[Code] ....

View 8 Replies View Related

Private Key

Mar 6, 2007

Hi

I am trying to setup service broker by following the article on http://support.microsoft.com/default.aspx/kb/915852

The script ran without error, but when I try to send a message, I get the following in the trace Audit Broker Conversation and the message is not delivered.

The certificate's private key cannot be found

This message could not be delivered because the security context could not be retrieved.

Does anyone know what I did wrong, is it the Certficate in the Master Database or the Target Database

thanks

Paul

View 1 Replies View Related

Private Messages

Sep 26, 2005

i'm trying to make private messages like the one in this site, i didnt start programming yet, the problem is in the DB schema, i have 3 tables (Users, Messages, MessageDetails) i think the problem that the UserID is related to the other two Tables, so to know the sender and reciever, when i try to view all messages for specific user and show all users who sent it, it give nothing back, so any help in the DB, thanx 4 help.

View 13 Replies View Related

The 'System.Web.Security.SqlMembershipProvider' Requires A Database Schema Compatible With Schema Version '1'.

Sep 27, 2007

Locally I develop in SQL server 2005 enterprise. Recently I recreated my db on the server of my hosting company (in sql server 2005 express).I basically recreated the tables and copied the data in it.I now receive the following error when I hit the DB:The 'System.Web.Security.SqlMembershipProvider' requires a
database schema compatible with schema version '1'.  However, the
current database schema is not compatible with this version.  You may
need to either install a compatible schema with aspnet_regsql.exe
(available in the framework installation directory), or upgrade the
provider to a newer version.I heard something about running aspnet_regsql.exe, but I dont have that access to the DB. Also I dont know if this command does anything more than creating the membership tables and filling it with some default data...Any other solutions/thought on what this can be?Thanks!

View 4 Replies View Related

Private Virtual Dtabase

Mar 22, 2000

One of our clients controls data for about 150 companies. Each company has the same schema and is running SQL Server 7. The maintenence task is horrible. He would like to put all the data in one large database, but needs to control the access, so a user at one company selecting data in a table cannot have access to another company's data in the same table. I thought about using views for each company but that is 150 companies times 100 tables. With Oracle8i you can make virtual private databases. Can this be done in SQL Server 7? Thanks in advance

View 1 Replies View Related

Certificate Private Key Cannot Be Found

Apr 15, 2014

I set up Service broker (2008R2 -> 2012) across different servers and domains using certificates.I set up 2 queues (one for sending, one for receiving).I set up 6 services (3 for send, 3 for receive), all 3 sharing the same queue type. (srv_send_1, srv_send_2, srv_send_3), (srv_receive_1, srv_receive_2, srv_receive_3).I set up a route for each receiving service on the source, and for each sending service on the target.I set up a SB binding to the remote for each sender service type.I granted send rights to the sending services on the source server.

I then tested my first service, and it worked perfectly (still works).My second service however is failing with the error "The certificate's private key cannot be found".I am stumped, as all the setup code was a lot of copy/paste which I have checked, rechecked and even re-coded.Basically, here is what Im doing:

begin dialog @ConversationHandle
FROM Service srv_send_1
TO Service 'srv_receive_1'
ON CONTRACT myContract
WITH ENCRYPTION = OFF, LIFETIME = 60*60*24*7;
SEND ON CONVERSATION @conversationHandle
MESSAGE TYPE [my_msgtype] (@xml);

The above code works 100% with service1, but not with service2.Note that on profiler, the target server doesnt receive any communication. The error shows on the sender profiler.Also, The conversation shows up as CONVERSING in sys.conversation_endpoints and the entry exists in sys.transmission_queue.

View 1 Replies View Related

Can I Access My Private Db Through My Web Server?

Aug 30, 2005

Web server: win2003 server with iis6DB: sql server 2000I have 50+ remote offices running an Access 2002 app which connectsdirectly to sql server at a 3rd party hosting company, in part using anodbc connection on the workstation.We recently moved our database (and our web site) in-house. The newdatabase is inside the firewall but outside the dmz, where it livesalong side the company's most sensitive databases. IT's policy won'tallow us to connect directly from the internet. I'm trying to avoidbuying another copy of sql server for the Access app, which I one dayhope to drop anyway in favor ofThe web server uses port 1433 to talk to the database. I was wonderingif there is a simple way to route requests from the Access app throughthe web server.Thanks,Bob

View 9 Replies View Related

SQL CE Private V. Shared Deployment

Feb 2, 2007

I have a couple of questions on the nature of shared and private deployment of SQL Server CE 2005 on mobile devices:

1. I've read that with a shared install, SQL Server 2005 Compact Edition files are automatically updated and serviced by Microsoft Update. I take it that this only applies to installations on desktop computers -- if you're installing on mobile devices, there IS no automatic update. Right?

2. I've also read that in order to do a shared install of SQL Server 2005 CE, the user must have administrative rights. How does this apply to installs on a mobile device? There is no such thing as an administrative user on a mobile device. However, mobile devices CAN require different levels of privilege to install certain programs -- do you need something like an application signed for privileged execution (via a M2M certificate) in order to do a shared install of SQL Server 2005 CE on a mobile device?

Or is the shared versus private deployment only an issue when deploying to a desktop?

Larry

View 4 Replies View Related

Private Deployment Of SQLCE For C++ App

Apr 20, 2007

MSDN has examples of deploying SQLCE privately for C# and VB.NET, but that doesn't seem to translate to C++. A .NET application just loads the assembly it needs from the local directory, but from what I can tell I need to use the OLE DB driver to use SQL CE in C++. The problem is that the OLE DB driver is a COM object that (presumably) needs to be registered.



Has anyone successfully used SQLCE from C++ without registering any COM objects? I'm thinking the only way to do that would be to call DllGetObject() on the DLL and get the object manually, but I've never done this so I'd hate to waste the time if there's an easier way, or if this won't work.

View 7 Replies View Related

Certificate Private Key Recovery

Feb 5, 2008

We are looking to put column level encryption on a table. Great! Wonderful! Look in books online and see that you must give "control" perm to the Certificate for any user that needs to use the symmetric key.

Now my question. I have backed up the Certificate to file. What I have found playing around with the commands is it is possible to run the following command:

Alter Certificate MyCert
Remove private key

BOL says their is no "Restore Certificate" command and to just use "Create Certificate". I have tried this and I keep getting an error saying the certificate already exist in the database.

What have I missed? How can I restore this certificate without restoring the ENTIRE database? Is there a permission set that can be applied to the Certificate to stop thsi kind of command from being run while still having the symmetric key usable? Any help would be of great use!

Thanks,


*note* this is using the MasterKey->Cert->SymmetricKey

View 6 Replies View Related

Transferring Objects Form Schema A To Schema B In One Shot....!

May 27, 2008

I have 35+ tables and 15+ stored procedures with SchemaA, now I want to transfer them to SchemaB.

I know how to do one by one...!

alter schema SchemaB transfer
SchemaA.TableA

but it will take long time...!

Thanks,

View 3 Replies View Related

Defining Connections As Private Variables

Apr 7, 2006

Is there any harm in defining a SqlConnection as a private class variable for a web page?Private SqlConnection cn = new SqlConnectection(ConfigurationManager.ConnectionStrings["MyString"].ConectionString);The connection is only opened in certain event handlers, and is closed right after use. It was always my understanding that creating the connection is not a big deal but opening the connection is. Is that correct?

View 1 Replies View Related

ClickOnce Private Installation Issue

May 12, 2007

I'm working on a VB.Net 2005 application that uses SQLCE as a backend database.

Following the instructions on how to do a private installation (http://msdn2.microsoft.com/en-us/library/bb219482.aspx) so that admin rights were not needed, I successfully got it working as a ClickOnce deployment. But today during a demo for a client, they ran into this error while installing the latest version from our publishing URL:

"Unable to install or run the application. Application requires that assembly System.Data.SQLServerCe version 9.0.42 .... must be installed in the Global Assembly Cache."



Basically it's saying the user isn't an admin so they can't install. This is the problem I went to great lengths to try to avoid, and is the reason we are using SQL CE in the first place: admin rights are not required to install our application's database. To our knowledge, SQL CE is the only Microsoft product that fits this scenario.

Now, I haven't changed anything in the publishing of the application to my knowledge, and when I check the project prerequisites, the SQLCE engine still isn't in there (as summarized at the above URL). Again following the instructions at the URL above for private installation, the required assemblies are still part of the project's files.

It must be something I did to cause this, but I have no memory of changing anything in regards to this part of the application. Our deadline is in 4 days and I cannot continue development until I get past this issue.

Where do I look to fix this problem? A little help would be greatly appreciated.

View 1 Replies View Related

Using Private Public Keys In SQL2005

Jul 30, 2007

Here is what I am trying to do. I want to create a private / public key pair (either a certificate or asymmetric key) and be able to give the public key to my business contacts. They would then use the public key to encrypt data to be sent to me and then I could import that data into my SQL 2005 database and use the private key to decrypt it.

It seems to me that this should be a pretty simple process, but it is not. The reason I want to do this is that the data they send to me on a regular basis is sensitive. Currently we use PGP, but then I have to decrypt the data and then import it and then reencrypt it. It would greatly simplify my process if I could just import the data and use it.

So how can I do this. Most of the posts I read say that asymmetric keys are avaiable in SQL2005 but not recommended for use. I don't want my business contacts to be able to decrypt any of my data (if they got access to the database) just encrypt.

Any recommendations???

Thanks!

Jim Youmans
St Louis, Missouri

View 5 Replies View Related

Yet Another Question On Private Install In A Native/C++ OLE DB App

Jan 25, 2008

Folks- By reading all the results I got from doing a search on "private install" in this forum, I thought this must be as easy as:

1. Copying the seven DLL's comprising the engine to my application's install dir on the deployment machine. If my app is installed at C:MyApp then CE dll's would go into C:MyApp, thats where my WinMain'd exe is residing.
2. RegSvr32 on sqlceca35.dll, sqlceoledb35.dll

Since I'm using native C++/OLE DB, I don't think I'd need to care about System.Data.SqlServerCe.dll

However my app which is basically the NorthWnd sample is failing on CoCreateInstance(CLSID_SQLSERVERCE_3_0............)

Which means oledb provider not registered on the machine? am I correct?

I watched Steve Lasker's video, even though the private install covers managed code, but I thought I should be doing something very similar, apparently I'm missing something.

I'll appreciate any help.

P.S., The 7 dll's above I mentioned are:
sqlceca35.dll
sqlcecompact35.dll
sqlceer35EN.dll
sqlceme35.dll
sqlceoledb35.dll
sqlceqp35.dll
sqlcese35.dll

View 3 Replies View Related

How To Forcing The Mirror Communication To A Private Network?

Jun 16, 2007

SQL 2005 Standard x64 Service Pack 2

Windows 2003 R2 X64 service pack 2



The principle, partner and witnesss have two NICs each (NIC1 and NIC2). I want them to communicate in NIC2 for sending logs and establishing quorum. This will happen in their own private network (say 192.168.1.0/24). The NIC1 in each server will be available for client communication. The domain and clients are in the network (say 10.1.1.0/24).



I am using the same domain account as SQL server service account in all three servers.



How can I do this?



Thanks

View 1 Replies View Related

Can't Connect To The Backend DB During Re-install Of Public From Private

Apr 13, 2007

I'm having a great deal of difficultyconnecting to SQL 2005 sp1 during the running of the deployment tool on the FE.. The error message indicates that I have to install the Backward compatible tool on the FE... Did that and upgraded SQL to SP1... Still a no-workie..Exactly what SQLs are compatible with the Public version of OCS... It worked fine with the Private version and SQL2005...

View 2 Replies View Related

Database Schema Compatible With Schema Version '1'

Apr 12, 2008

Hello everybody!I'm using ASP.NET  3.5,  MSSQL 2005I  bought virtual web hosting .On new user registrations i have an error =(The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'.  However, the current database schema is not compatible with this version.  You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version. On my virtual machine it work fine but on web hosting i have an error =(What can you propose to me?

View 2 Replies View Related

Moving Data From One DB Schema To Another DB Schema Using SSIS

May 8, 2007

Hello,



I would like to use SSIS tool to move the data from one database schema to another database schema.



For example:



Source table has

1. UserName (varchar 20) (no null)

2. Email (varchar 50) (can be null)



Destination table has



1. UserID (uniqueidentifier - GUID)

2. UserName (varchar 50) (no null)

3. EmailAddress (nvarchar 50) (can be null)

4. DateTime



Questions:



1. What controls do I use in my Data Flow to make data move between databases with different data types and include new value in UserID as a new GUID and DateTime as a date (GETDATE)?

OLE DB Source, OLE DB Destination, Data Converson and .....

How do I insert Guid and Date at the same time?





2. I have many tables to do data moving. Any sugestions? How do I architect my project? If I create many data flows for each table - it will look complicated.



Please give me some advices here.



Thanks.

View 3 Replies View Related

Can't Connect Remotely To SQL Express On Virtual Private Server

Mar 18, 2007

I've just bought a Virtual Private Server Account because I want to host a number of different ASP.NET sites, each backed by their own SQL database. I've downloaded SQLEXPRE.EXE and SQLServer2005_SSMEE-x64.msi to the server and installed the database engine and Management Studio Express on the VPS.
 My problem is that I cannot access the SQLEXPRESS on my server from my local machine.  The Management Studio Express cannot get logged in.  I've used "Surface Area Configuration Manager" to allow "Local and remote connections" using TCP/IP only. I've used SQL Server Configuration Manager" to enable the TCP/IP protocol.  After making these changes I've stopped and started the SQL server - and even rebooted the machine. I've created a login "Remote User" for this access. I've added sqlservr.exe as an exception to the firewall.
What else do I need to do? Is there a simpleton's guide to completing this task?
 

View 1 Replies View Related

Using Aspnetdb Express Database For Private Website Tables

Mar 23, 2007

Hi, I am using express database and tools. I have an aspnetdb express database because I am using the login controls, personalisation...Can I use this database for my private tables also? Or do I need a separate express database for my private tables? Will using aspnetdb database, which contains special asp.net tables, for my private website tables create any kinds of problems in using my website? I want to use a single express database for my website, not two different express databases.
Regards, Sandy

View 1 Replies View Related

SQL Server 2012 :: Asymmetric Encryption Using Public And Private Key

Jun 3, 2015

We are planning to encrypt few fields using asymmetric encryption. Tyring share public key with users and retain private key with us. How to generate keys? Haven't found any solid document on how to generate these keys.

View 0 Replies View Related

Creating Object In OnInit() - Not Accessible In This Context Because It Is 'Private'

Oct 15, 2006

I am trying to create an assembly object when a report is initialized and I am getting the error:

[rsCompilerErrorInExpression] The BackgroundColor expression for the textbox 'textbox2' contains an error: [BC30390] 'ReportExprHostImpl.CustomCodeProxy.X' is not accessible in this context because it is 'Private'

In the Code tab, I have:
Dim X As namespace.classname
Protected Overrides Sub OnInit()
X = new namespace.classname()
End Sub

In my color field, I have "=code.X.color"
If I replace the color field with "=namespace.classname.color" and have color be a shared property, then it works. However, I ultimately need the color to be based on individual user settings, so I cannot use the shared property approach.

Any ideas on how to get around this "because it is private" error?

FYI, I am trying to replicate the concept of themes using report formatting information pulled from a database.

View 2 Replies View Related

SQL Security :: Why Doesn't PVKConverter Generate A Private Key File

Mar 23, 2015

I am trying to convert a certificate that was exported from our database server to be used by SQL Server for database encryption.  When I run the PVKConverter, not Private Key File (PVK) is generated.The certificate has Server and Client Authentication as the purposes of the certificate. 

What purpose or purposes does the certificate need in order to be able to be used by SQL Server 2012 SP2?Why doesn't the PVKConverter generate a private key file?I can use the command makecerts to generate a self signed certificate and have it work with SQL Server database encryption.

View 6 Replies View Related

How Many IP(Public && Private) Required For 2 Node Active/Passive Cluster

Jul 13, 2007



Hi all,

I have some doubt about the IP Required for configuring cluster(both Window and SQL server)

Details :
----------
How Many IP(Public & Private) Required for 2 Node Active/Passive both window and SQL server Cluster ?

IP(Public & Private) Required :
---------------------------------------
1 : For Window Clustering : 2 node Active/Passive Cluster ? How many ip ?
2 : For Sql Server Clustering : 2 node Active/Passive Cluster ?how many ip ?
3 : Is there any mathematics for that ? How to analyse the IP requirement ?

Thanks

View 2 Replies View Related

Analysis :: SSAS - Windows Authentication Error (Via Private Network)

Jun 19, 2015

I'm trying to implement a SSAS Project in a Virtual Machine using a private network. When I try to deploy the solution the program gives me the following error:

I already have a Windows Authentication but still gives me that error.

View 3 Replies View Related

Examples Of Certificates Created With Private Key And FROM EXECUTABLE FILE Options

Apr 4, 2006

Hi

I am looking at documentation of CREATE CERTIFICATE statement. I am having hard time in understanding if I want to create CERTIFICATE with above mentioned options, how I am supposed to create either PRIVATE KEY file or EXECUTABLE file. any example would be really helpful for what I am doing here.

thanks

Satya

View 1 Replies View Related

The Certificate, Asymmetric Key, Or Private Key File Does Not Exist Or Has Invalid Format.

Sep 20, 2006

I am sure I'm being dumb here but I am trying to deploy an assembly with external_access.

I have signed the assembly using the <new> option in the project properties.

When I then try and create the Key I get the above error using the code below.

CREATE ASYMMETRIC KEY SQLExtensionUDTKey

FROM EXECUTABLE FILE = 'C:Documents and SettingsSimon SabinMy DocumentsVisual Studio 2005ProjectsSQLBitsCoreSQLExtensionsSQLExtensions.UDTinDebugSQLExtensions.UDT.dll'

What could be the problem?

View 7 Replies View Related







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