|
You need to perform the entire query with T-SQL as follows:
<br />
use master<br />
go<br />
execute sp_configure 'allow updates',1<br />
go<br />
reconfigure with override<br />
go<br />
drop procedure sp_who<br />
go<br />
execute sp_configure 'allow updates',0<br />
go<br />
reconfigure with override<br />
go<br />
|
|
|
|
|
thanks that worked , thanks for your help.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
Is it possible to specify the port of a server in a DSN (when it not 1433, for instance)?
|
|
|
|
|
Yes it is:
connection.ConnectionString="driver={SQL Server};server=myserver;port=5000;uid=myuser;pwd=mypassword;database=mydatabase;"
|
|
|
|
|
Does anybody know of any SQL tools that allow me to formally verify that differently structured SQL statements would result in the same result set?
Thanks,
Ian
--
Ian Darling
|
|
|
|
|
I haven't ever come across any tools like this (so if anyone knows of any tool like this I'd be interested too.)
What you can do is execute the statements into two global temp tables and then compare the temp tables with one of the numerous table diff tools out there.
|
|
|
|
|
Ian Darling wrote:
Does anybody know of any SQL tools that allow me to formally verify that differently structured SQL statements would result in the same result set?
If you are using SQL Server you can use Query Analyzer and dump the results to a file (this is a menu option). Then use WinDiff against another dataset that you have dumped to compare.
-Nick Parker
|
|
|
|
|
That's a good way, but you could also write some SQL to do it:
SELECT * FROM query1name INNER JOIN query2name ON query1name.primarykey < > qurery2name.primarykey;
If you get anything back, you know that they return different results (at least in the current situation).
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
This would only verify that the same primary keys exist but does not necessarily verify that the other fields in the rows are the same.
|
|
|
|
|
But they are returning results from the same table, so if the primary key was the same, then the results would be the same, right?
Maybe I was taking it as a given that this was so - are you talking about comparing results from different tables?
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
The following two select statements return different results even though they return the same keys, so the results are different:
select prkey, name, address from mytable
select prkey, name, address, dob from mytable
So, effectively, the resultsets are different.
|
|
|
|
|
You're right.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
what is the syntax for executing oracle queries directly
like what i want to do is , on the click of a button on a form in vb.net , i want to delete the rows in a table
ie the query should be (delete qset )
|
|
|
|
|
how convert a ado connection to a oledbconnection ?
how can i?
|
|
|
|
|
wangzhibin wrote:
how convert a ado connection to a oledbconnection ?
how can i?
Are you using ADO 2.5 or ADO.NET? If you are using .NET, you can use the OleDbConnection class. If you are using ADO 2.5 (pre .NET) then you need to add "Provider=sqloledb;" as part of your connection string to the database.
-Nick Parker
|
|
|
|
|
hello @all,
if i merge one e.g. access data base in a c++ or a java program over ODBC/JDBC, must i have installed then access on the pc?
thank you very much
sunny
|
|
|
|
|
I think you just have to have the Jet database engine. This is installed when access is installed, but you can also redistribute it. I don't know what the licensing is, but you can probably find out on www.microsoft.com.
Do unto others as you would have them do unto you - Jesus
An eye for an eye only makes the whole world blind - Mahatma Gandhi
|
|
|
|
|
Is there a method to detect if a column has a primary key set, using ADO for C++.
Thanks
|
|
|
|
|
I had created a database(SQL Server) few motnhs before but
unfortunately the database is now missing ,i have only the .mdf file of that database(.ldf is also missing),Can someone tell me how to recover the database from the .mdf file.
Thanx
Pradipta
|
|
|
|
|
You should be able to reattach the .mdf file to sql server. You can do this with Enterprise Manager, or the sp_attach_db system stored proc.
You may get a warning about not having the corresponding .ldf.
Without nipples, breasts would be pointless.
|
|
|
|
|
I tried the following
EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\mssql7\data\pubs.mdf'
But I am getting following error using the above Stored procedure
--------------------------------------------------------
Server: Msg 5105, Level 16, State 4, Line 1
Device activation error. The physical file name 'c:\mssql7\data\pubs.mdf' may be incorrect.
------------------------------------------------------
But the physical path is correct.I also tried with
sp_attach_single_file_db but same error results.
How can i do the same using Enterprise Manager,It will be highly appreciated if u tell me step by step.
|
|
|
|
|
pradipta wrote:
N'c:\mssql7\data\pubs.mdf'
Are you using SQL Server 7? I can explain how I do it with 2000, but I assume it would be similar process.
Open Enterprise Manager.
Expand the tree until you find your database server instance. Expand that.
Right-click on Databases, select All Tasks -> Attach Database.
Browse [...] for your database file.
As for the error you are receiving, I don't know what the problem might be.
Was the file detached from the original database, or just copied? That may cause problems potentially. But I'm no DBA, so I can't say for sure.
Good luck
Without nipples, breasts would be pointless.
|
|
|
|
|
Thanx a lot,Yeah this is working as per my requirement
Thanx again
With Regards
Pradipta
|
|
|
|
|
Hi all,
How can I create a textual dump of a SQL Server 7 database? I have used MySQL and it provides a feature to take a textual dump, with either structure or structure plus data. So if I want to create the same database elsewhere I can use the DDl statements in the dump to create the same tables.
There are other ways to transfer DB's in SQL server. But I'd like to know if SQL Server supports textual dumps or not. This is mainly for me to transfer a DB in SQL Server 7 in a remote offline system to a SQL server 6 in another system. The export-transfer-import mechanism fails somehow
Thanks
Smitha
It is better to be hated for what you are than to be loved for what you are not.
-- Andre Gide
|
|
|
|
|
Hi,
I want to call an INSERT into my access database via ADO.
To do that operation I use the Execute fonction.
CString query = "INSERT INTO Clinic
VALUE(ClinicID,ClinicName,Address,City,PostalCode,PhoneNumb,FaxNumber,Email,Notes)";
m_pCmdChange->ActiveConnection = m_pConn;
m_pCmdChange->CommandText = (_bstr_t)query;
// CommandText property already set before function was called.
m_pCmdChange->Execute(NULL, NULL, adCmdText);
Into my table, I have a fields named ClinicID that is a Access AutoNumber.
If I execute the preceding code, it work fine except the fact that I have to enter ClinicID that is a autonumber.
My problem is that if I do an execute() I have to add an imput for each fields including ClinicID.
So my question is How can I add a new record into my table without the obligation to enter ClinicID?
thanks
Everything's beautiful if you look at it long enough...
|
|
|
|