|
I'm trying to add a fairly simple assembly to SQL server 2005; but keep getting a message:
6218 : Assembly 'EnableIrelandSystem' failed verification, run peverify on the assembly.
So - the only thing remotely controversial in th eassembly is a reference to System.Runtime.Interopservices (for <StructLayout()> ).
Any ideas?
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Hi there,
How can I make a relation between two or more databases in one server?
Thank you in advance.
|
|
|
|
|
In a table how to check only primary key fields are there or not
Please help me.
Thanks in Advance,
Pothirajan C
|
|
|
|
|
Pothirajan C wrote:
In a table how to check only primary key fields are there or not
I'm not sure what you mean.
Do you mean: How do I check if a table contains a primary key or not?
IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE TABLE_SCHEMA = 'dbo'
AND TABLE_NAME = 'Orders'
AND CONSTRAINT_TYPE = 'PRIMARY KEY')
BEGIN
-- The primary key exists
END
ELSE
BEGIN
-- The primary key does not exist
END
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hello firends!!!
I have question!
for example lets consider one table where i have three fields like Id , Name ,Country
I am using Sql server2000 and i want out put like
Id---FirstName---Country
10---John--------A
20---Mack
30---Rock
40---Silk--------B
-----Mann--------C
I just explain @ my output suppose if any above column there is duplicate values coming then that should be group by only one like 'A' or like '40'. Only one output should display once.
note : - To looks like grid i put that dotted line
Is that possible?
Please Help Me Out
Thanks In Advance
Shashank
|
|
|
|
|
hi everybody.
now ı can develop a database application but ı'm not sure that the application is multi user. to it be a multi user program what must I do? for example if two or five or ten people want to do something at the same time what can do? thanks a lot.
|
|
|
|
|
pirogramci wrote:
to it be a multi user program what must I do? for example if two or five or ten people want to do something at the same time what can do?
The database is just one layer of the application. What about the other layers? For instance, is it a web application or a windows forms application?
Most databases are designed to be multi user and you can have many connections open to them at the same time. MS Access and MSDE do impose limits however.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
This error occurs while trying delete a column in SQL Server 2000. First I tried using CONSTRAINT statement, for deleting Indexes. But it seems to be an auto-increment column.
My general problem are two identical tables. While doing RDA Synchronization, two Rows are added to one of them, making it impossible to copy one into the other.
|
|
|
|
|
this is a function that give me the the monthly installment by dividing the total amount on payment plan ,but with every thing ok i cant get it to work :
CREATE FUNCTION mia (installment int)
RETURNS real AS
BEGIN
declare @x real
select @x=sum(totalamount/paymentplan)
where istallmentid=@installmentid
return @x
END
any suggestion will be helpfull:>
|
|
|
|
|
|
yes thx,
i can see this now the correct function is,
CREATE FUNCTION getamountdue (@customerid int)
RETURNS float AS
BEGIN
declare @x float
select @x=sum(totalamount-amountpaid)
from (installments inner join orders on installments.installmentid=orders.installmentid)
inner join customers on orders.customerid=customers.customerid
where customers. customerid=@customerid
return @x
END
|
|
|
|
|
Hi,
I'm new to programming and need some advice...
I have a windows application that I want to be running on several networked computers and accessing the same db (ms access file). I'm worried that there may be times when two user will access the db file at the same time and give an connection open error (when using ExecuteNonQuery). I've played around a little bit and have noticed that using the DataAdapter to Fill and Update does not give any connection open errors (even if the connection is open by mistake or if another Fill is happening).
So what's the best plan?
If I have a situation of multiple users of a db, should I try and use the DataAdapter as much as possible to avoid db status=open errors (and needing try/catch statement)?
Thanks for any advice you can give,
Ron
|
|
|
|
|
Does your database not handle multiple users ? What are you using ? SQL Server handles multiple users, and even MSDE handles up to 5 ( from memory ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian,
I'm using a MS Access 2000 database (I believe it's a Jet database?). SQL Server or MSDE might be too much for an end user with min. computer knowledge to install.
Ron
|
|
|
|
|
OK - Access is crap for this stuff. You basically have a problem, and the problem is that your technology is not up to the task.
You can easily deploy an app where the installer installs and sets up MSDE, I've done it myself with complete success.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Just to add to what Christian said. OleDbDataAdapter uses a OleDbCommand object internally to get the data from the database. There is no advantage, in terms of contentious resources (multiple opens), to using an OleDbDataAdapter over a OleDbCommand. The only advantage you get is that an OleDbDataAdapter will open a connection if it is shut already (by calling OleDbConnection.Open() ) and will shut it afterwards, if it opened it. It is generally good practice, if you are using the Command objects to open the connection, run the query and close the connection again rather than just leave it open.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
I have an ASP.NET application that needs to access a SQL Server. I was planning on using the MS Data Access Application Block (DAAB) but do not want to store SQL Server login credentials in config file as the DAAB seems to suggest. I want to collect the SQL Server account's username and password at runtime with a standard login webform.
Am I missing something, or does the DAAB not easily handle this? I am not using Windows Integrated security, I am using SQL Server security.
Has anyone been able to assign SQL Server login credentials to the DAAB at runtime as I was hoping to do?
I'd greatly appreciate any suggestions.
Thanks.
|
|
|
|
|
I'm using sql server 2000.
Is it possible to use a parameter passed to a stored procedure as the name of a table in a query? If I hardcode the table name into the query it works fine. But when I try changing the procedure to have the name passed, the syntax check fails with "Error 170: line 2: Incorrect synatax Near '@Tablename'."
[code]
CREATE PROCEDURE CreateTestTable2 @Tablename char(30) AS
CREATE TABLE @Tablename
(
TestID INT PRIMARY KEY NOT NULL,
TestInt INT,
TestString VARCHAR(10)
)
GO
[/code]
|
|
|
|
|
You cannot do this in the way you are trying. However, you can create some dynamic SQL and execute that.
What you do is create a string in SQL Server, say a varchar(1000) , and build the CREATE TABLE statement into the string.
Once you have built the string you can then do EXEC(@MySqlStatement)
However, be aware that this carries a security risk with it as it could more easily be the weak point for a SQL Injection Attack (See SQL Injection Attacks and Tips on How to Prevent Them[^] for more information).
To help mitigate the risk your stored procedure should ensure that the @Tablename parameter contains only valid characters (say 0-9, a-z, and an underscore) before building the dynamic SQL Statment and running it.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Colin Angus Mackay wrote:
Does this help?
Yes. Thankyou. At the moment I'm just playing around with sql and ado.net to see what I can do so the security problem''s not an immediate concern.
|
|
|
|
|
While using the SqlDataReader, there is often a NULL value giving back when I read it with GetString(index). It's possible to check this with "IsDbNull", but is there a better way to solve this problem ?
|
|
|
|
|
No.
You could change your database schema so that columns don't allow NULL values, and instead provided a default value (such as an empty string.)
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Miekec wrote:
but is there a better way to solve this problem ?
There isn't a better way than that. However Luis did come up with an alternative, which was to have the database query omit some sort of default value in place of a NULL. Sometimes people treat the empty string like a NULL value. However, be aware that NULL values have an important meaning. They exist to say that this is the total absence of a value, whereas an empty string is a value, that happens to be a string of zero length.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
How can I get product of two columns.
example Column1 * Column2 = Result
I used this to be more clearly...
|
|
|
|
|
You need to give the column an alias.
e.g.
SELECT 1 * 2 AS total FROM tablename
|
|
|
|