I have a function that generates a BouncyCastle RSA key pair. I need to encrypt the private key and then store the encrypted private and public keys into separate SQL2008 database fields.
I am using the following to get the keypair:
private static AsymmetricCipherKeyPair createASymRandomCipher()
{
RsaKeyPairGenerator r = new RsaKeyPai...
I have a client/server application that depends on MS SQL database for backend storage, the server application is a WCF TCP service that handles the clients requests by selecting from the database set of information.
The service is configured as PerSession and support 500 sessions.
In the client side the user can open different views ea...
Hello everyone,
I am using SQL Server 2005. I have two tables, and they are using different collations. It is not allowed to concatenate columns from tables with different collations, for example the following SQL is not allowed,
select table1column1 + table2column2 from ...
My question is, why concatenation of two columns from diffe...
I have a query, and I need to find the row number that the query return the answer.
I do not have a counter field. How do I do it?
Thanks in advance.
...
Hi there,
can anyone help me with construction of an IF in a stored procedure in sql server.
Basically I have a simple stored procedure but I now need to pass in a new input parameter which depending if it is true I pass the value D and if its false I pass the value A. But the change is in the middle of a subquery.. let me explain... h...
I need to quickly implement a read-only database containing data pulled from two identically structured live databases.
The live dbs are actually company dbs from a Dynamics accounting system so I'm happy for any Dynamics specific advice but this is mostly a SQL question. It's a fairly old version of Dynamics from before Great Plains wa...
Is it possible to have a 'persistent' temp table in MS-SQL? What I mean is that I currently have a background task which generates a global temp table, which is used by a variety of other tasks (which is why I made it global). Unfortunately if the table becomes unused, it gets deleted by SQL automatically - this is gracefully handled b...
This seems like an incredibly dumb question to have to ask, but how do I get SQL Server Management Studio to stop processing a SQL script when it encounters an error?
I have a long script and if there is an error at the start SSMS reports it and then blindly carries on, screwing up things even more. I can't use transactions because the ...
Hello everyone,
For SQL Server 2005/2008, after some self-study, I am not sure whether my understanding about how character data type is physically stored is correct. Please help to review and comment. Here is my understanding, please review and feel free to correct me.
when using unicode character type (e.g. nvarchar), underlying cha...
I came to know about some uses of undocumented stored procedures (such as 'sp_MSforeachdb' ...etc) in MS SQL.
What are they? and Why they are 'undocumented'?
...
How to retrieve the columns (including alias) name, tables involved in a 'View' in C#?
...
i have a table. i have a user defined function(UDF). My UDF returns me a table. i need left outer join my table and my UDF table.
...
I get the following error:
Cannot use empty object or column names. Use a single space if necessary.
Msg 1038, Level 15, State 3, Line 1
and the query command looks like:
SELECT TOP 100 PERCENT
[].[cms_page].[pa_id], [].[cms_page].[pa_key],
[].[cms_page].[pa_title], [].[cms_page].[pa_keywords],
[].[cms_page].[pa_description],...
We have 2 SQL Express (2005) servers.
As you probably know, database mirroring is not enabled in the Express editions, but replication is.
Would it be possible to enable replication between both servers to have some kind of mirroring-like functionality?!
What would be the possible drawbacks if it is possible at all?
...
I have a VB6 application accessing a single table on a MSSQL2000 server via ADO. I'm using read-only access (adOpenStatic, adLockReadOnly) There are other applications in the network which do make changes to the table.
For some reason I'm getting errors about my application being chosen as a deadlock victim.
I'm really confused: Why c...
I am wanting to transfer objects (tables, stored procedures, data etc) between two servers (Dev box and Live box) and was wondering what the best approach for doing this is?
In SQL Server 2000, you could transfer all objects and data between databases. Now all there is is 'copy data' and 'write a query'. Where has the second option gone...
I have a collation problem with my database and I have developed my own solution.
Solution:
DECLARE @new_collation varchar(128),
@conflict_collation varchar(128),
@cmd_holder varchar(2000),
@cmd_complete varchar(2000),
@schema varchar(128),
@table_name varchar(128),
@constraints_name varchar(128),
@column_name varchar(128...
This query is taking long time when endDate is null (i think that its about case statement, before case statement it was fast)
SELECT *
FROM HastaKurumlari
WHERE CONVERT(SMALLDATETIME,'21-05-2009',103)
BETWEEN startDate
AND (CASE WHEN endDate IS NULL THEN GETDATE() ELSE endDate END)
What should i use, when endDate is null to ma...
I am maintaining a classic ASP website that has a SQL Server 2005 backend. For a small piece of new functionality I wrote a stored procedure to do an insert. This is the only user stored procedure in the database.
When I attempt to call the stored procedure from code I get the following error:
Microsoft OLE DB Provider for SQL Serve...
I'm trying to extract monetary sums stored in some poorly formated xml columns (there is no schema defined for the XML column which I guess is part of the problem). I'm getting a conversion error whenever I encounter a node with 0 as its value.
Example:
select xml.value('sum(/List/value)', 'numeric') sum
from (select cast('<List><value...