in Sql Server 2005, I have a master table, and several other tables which are related to
this master through several one to many relations.
How can I find all tables and fields which are in relation with the
primary key in the master table, on "many" side?
I know I can extract this by querying views from INFORMATION_SCHEMA,
but I don't know where exactly I can find this info.
Thank you
I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?
EDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work.
I have Table with two smalldatetime columns, where one is startTime and other one is endTime.
I need to select all values from table which between times of both columns compared to getdate()' time.
I'm using SQL-Server 2005.
example
startDate endDate value1
2/2/01 16:00 2/2/01 18:00 1
2/2/01 21:00 2/2/01 22:00 2
2/2/01 05:00 2/2/01 22:00 3
getdate() gives 2/2/2000 21:40
so i need to get value1 2 and 3
thanks in advance
I'm trying to compare the schemas of two tables that exist in different databases. So far, I have this query
SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('table1')
The only thing is that I don't know how to use the sys.columns to reference a database other than the one that the query is connected to. I tried this
SELECT * FROM db.sys.columns WHERE object_id = OBJECT_ID('table1')
but it didn't find anything.
I'm using SQL Server 2005
Any suggestions? thanks!
Hi,
I'm using Sql Server 2005 and i'm trying to achieve something like:
In the same select statement i want to get the first x rows and the last x rows.
SELECT TOP(5) BOTTOM(5)
Of course 'bottom' does not exist so i need other solution.
I believe there is an easy and elegant solution that i'm not getting.
Doing the select again with Group By Desc is not an option.
Thanks.
Hello , i have written an sql script for updating a database that runs in SQL server 2005 and I want to make that changes to the production DB server but I dont want to run the query from the query analyzer , is there a way to run the sql script from console?
i am using sql server 2005, please tell me how can i get 6 digits (unique numeric which should be random) value for every row in table.
i have a field in table in which i needs 6 digit numeric value (random and unique).
please help me to do this.
I have 3 computers having the same sql server 2005 database, i would like to gather the data from the 3 computers to another computer which has the same database.
pls help me tnx in advance
So this my first question here, let's look how it works.
I'm working on a project, which has to to provide a "Native XML WebService" on a SQL Server 2005. The web service and the WSDL generation works fine. But there are troubles with the authentication.
Is it possible to turn the authentication off (The tests and the documentation by Microsoft say no.)?
And if so how?
Hi,
Is there any way, to save formatted in database from richtextbox?
I've got richtextbox and some parts of text in this are bold.
string s=richtextbox.Text obviously doesn't work.
And If I can get this formatted text how to save it in Ms Sql Server 2005 ?
Is it possible to find out who called a store procedure. So if you get an error in proc3, I know if it was called by proc1 or proc2.
I'm using SQL Server 2005.
I need to Pass some data to a text file and save that text file in a SQL Server 2005 database.
Then I'll need to be able to load that textfile into a C# WinForms DataGrid.
How do I do that in C#?
I'm working with an old windows app in visual studio 2005. A webserviced referenced in the original app has 2 functions and when i peak inside the auto-generated reference.cs file I notice a couple of other functions to allow async calls have been geenrated i.e. BeginWhateverFunctionNameIsCalled and EndWhateverFunctionNameIsCalled.
My problem is that I've created a new windows app and added the same web references but the Begin and End functions are not generated in my reference.cs proxy class. Anyone know whats going on?
My sql query gives the columns:
product_id (which is an integer)
pnl (which is float - can be negative)
I get more than 100 rows.
I want to filter out the top 40 rows based on abs(pnl).
But the results should be ordered by pnl column only and not by abs(pnl).
I want to do this for MSSQL 2005.
Is there a way to do this?
I'm using ASP.Net and would like to display currencies based on a country.
I've had a look at http://www.xe.com/symbols.ph, http://www.xe.com/iso4217.php and http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm
Is there anywhere I can get something that I can load into a database? Or is there something built in to SQL Server 2005/ASP.Net to help with this?
Does anybody else have this same problem, when you import data from Excel file to MSSQL Server 2005, if some column contains mostly numeric data, but even if you set the column type to varchar, the wizard fails to import those fields that fail to parse as numbers?
Good Morning,
I have connected to my SQL Server 2005 - and have managed to list all of the databases on that server. Now I would like to run a check on each database to see if I have permission to view that database..
How would I go about this?
Many Thanks,
Joel
Is there a way to tell how to get a file size that is uploaded to database?
SELECT [ID]
,[File]
FROM [dbo].[Reports]
I would like to be able to tell user the size of File which is VarBinary(max) field in MS SQL 2005/2008. How to do that?
Maybe the only way to do is to create another column and when inserting file i should also insert it's size in additional column?
I have half a million records in a data set of which 50,000 are updated. Now I need to commit the updated records back to the SQL Server 2005 Database.
What is the best and efficient way to do this considering the fact that such updates could be frequent (though concurrency is not an issue but performance is)
I just want to have a "ModifyDate" column automatically populated for me when a record is either inserted or updated.
Should I be using triggers or is it OK to use a Computed Column?
(Using SSMS2005 and SQL Server 2005 Express)
I am running SQL Server 2005 and I want to dump some dummy data into a large table with about 50 columns (I did not design it :P) - anyone know a tool to do this automatically? I want the rows to have all sorts of different data, and I would rather not write a script if there is already a tool out there - thanks.