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 ...
I am using CONTEXT_INFO to pass a username to a delete trigger for the purposes of an audit/history table. I'm trying to understand the scope of CONTEXT_INFO and if I am creating a potential race condition.
Each of my database tables has a stored proc to handle deletes. The delete stored proc takes userId as an parameter, and sets CON...
I have made an application project in Visual Studio 2008 C#, SQL Server from Visual Studio 2008.
The database has like 20 tables and many fields in each.
I have made an interface for adding deleting editing and retrieving data according to predefined needs of the users.
Now I have to
Make to project into software which I can deliver...
So I've got my jquery autocomplete 'working,' but its a little fidgety since I call the webservice method each time a keydown() fires so I get lots of methods hanging and sometimes to get the "auto" to work I have to type it out and backspace a bit because i'm assuming it got its return value a little slow. I've limited the query results...
I have a project that will be using Access 2003 as the font-end and the data being stored in SQL Server. Access will connect to SQL Server via linked tables with all the database logic (stored procedures, views) within SQL Server.
Given this setup, would it be better to use ADO or DAO within Access? Is it just a matter of preference or ...
I have an Incident table with one row that has the value 'out of office' in the Description column.
However the following query does not return that row.
SELECT * FROM Incident
WHERE CONTAINS( (Incident.Description), '"out*"' )
The word 'out' is not in the noise file (I cleared the noise file completely and I rebuilt the index).
Is ...
Lets say UserA and UserB both have an application open and are working with the same type of data. UserA inserts a record into the table with value 10 (PrimaryKey='A'), UserB does not currently see the value UserA entered and attempts to insert a new value of 20 (PrimaryKey='A'). What I wanted in this situation was a DBConcurrencyExcep...
Based on the following table
ID Date State
-----------------------------
1 06/10/2010 Complete
1 06/04/2010 Pending
2 06/06/2010 Active
2 06/05/2010 Pending
I want the following ouptut
ID Date State
---------------------------
1 06/04/2010 Complete
2 06/05/2010 Active
So date is the ea...
I have a table with:
id | parameter
1 | A
1 | B
2 | A
3 | A
3 | B
That represent objects defined with the values as:
1 -> A,B
2 -> A
3 -> A,B
I want to count the number of objects with different parameters using a SQL query, so in this case it would be 2 unique objects as 1 and 3 have the same parameters.
There is no const...
Is there any handy tool that can make updating tables easier? Usually I got an Excel file with the original value in one column and new value in another column. Then I write a formula in Excel to create the 'update' statement. Is there any way to simplify the updating task?
I believe the approach in SQL server 2000 and 2005 would be dif...
My ASP.NET MVC web app has a weird issue. In VS debugging mode it works as expected, but when I publish it to dedicated web server (windows 2003, IIS6) a sql query returns previous data even though underlying data was already updated through the same connection. It looks like as if a query returns cached data. What might be the problem?
...
Hello, I have a very large DB used mostly for analytics. The performance overall is very sluggish. I just noticed that when running the query below, the amount of virtual memory used greatly exceeds the amount of physical memory available. Currently, physical memory is 10GB (10238k bytes) whereas the virtual memory returns significantly...
How to check all stored procedure is ok in sql server if I drop a table or fields?
...
I have been reading that direct access to a SQL Server database over the Internet is insecure, so I am wondering what intermediary I can and should use between the client and the server. What are the best practices in terms of security and performance?
...
i have a asp.net mvc website which runs a number of queries for each page. Should i open up a single connection or open and close a connection on each query?
...
I have a hard time finding a good question title - let me just show you what I have and what the desired outcome is. I hope this can be done in SQL (I have SQL Server 2008).
1) I have a table called Contacts and in that table I have fields like these:
FirstName, LastName, CompanyName
2) Some demo data:
FirstName LastName CompanyName...
I have two tables:
create table [dbo].[Main]
(
[ID] [int] identity(1,1) primary key not null,
[No] [int] not null,
[Sign] [char](1) not null
)
create table [dbo].[Names]
(
[ID_Main][int] primary key not null,
[Name][nvarchar](128) not null,
constraint [FK_Main_Users] foreign key ([ID_Main]) references [dbo].[Ma...
Suppose each Person has a collection of favorite Books.
So I have a table for:
Person
Book
The association between Person and Book (joint table for MxN)
I want to fetch the Persons that are similar to a Person1 based on the favorite Books overlaping. That is: The more books they have in common, the more they are similar.
I don't ha...
Hello! I can't seem to crack this - I have two tables (Persons and Companies), and I'm trying to create a view that:
1) shows all persons
2) also returns companies by themselves once, regardless of how many persons are related to it
3) orders by name across both tables
To clarify, some sample data:
(Table: Companies)
Id Name
1 Ba...
I work for a non-profit organization where we send volunteers to aided schools everyday. I am creating a site to display this info and am using SQL server express. I want some help regarding a query so here's my first post
We have 15 volunteers currently who will go to 4 different schools to teach. Here are some conditions:
We have to...