I have three tables, Customers, Sales and Products.
Sales links a CustomerID with a ProductID and has a SalesPrice.
select Products.Category, AVG(SalePrice) from Sales
inner join Products on Products.ProductID = Sales.ProductID
group by Products.Category
This lets me see the average price for all sales by category. However, I only ...
Basically, what I want to do is join 4 tables together and return 1 row for each boat.
Table Layouts
[Boats]
id, date, section, raft
[Photos]
id, boatid, pthurl, purl
[River_Company]
id, sort, company, company_short
[River_Section]
id, section
Its very simple as far as structure, however, I've having the time of my life try...
Hi!
I've got a problem with multiple deadlocks on SQL server 2005.
This one is between an INSERT and a SELECT statement.
There are two tables. Table 1 and Table2. Table2 has Table1's PK (table1_id) as foreign key.
Index on table1_id is clustered.
The INSERT inserts a single row into table2 at a time.
The SELCET joins the 2 tables. (it'...
Here is the situation:
There is a transaction intensive database - used for both routine transactions and reports.
I was wondering if I could isolate these two operations and 2 independent databases, so reports could run off of one database and all the transactions could occur in another one. This would improve performance for the OLTP ...
SELECT
Boats.id, Boats.date, Boats.section, Boats.raft,
river_company.company, river_section.section AS river
FROM Boats
INNER JOIN river_company ON Boats.raft = river_company.id
INNER JOIN river_section ON Boats.section = river_section.id
ORDER BY Boats.date DESC, river, river_company.company
Returns everything I need. But how wo...
I have a TimeSheet table as:
CREATE TABLE TimeSheet
(
timeSheetID
employeeID
setDate
timeIn
outToLunch
returnFromLunch
timeOut
);
Employee will set his/her time sheet daily, i want to ensure that he/she doesn't cheat. What should i do?
Should i create a column that gets date/time of the system when in...
Hi,
How can we check that table have index or not ? if have how to find that index for a particular column for a table?
Regards,
kumar
...
Im using c# .net windows form application. I have created a database which has many tables. In one of the tables I have entered data. In this table I have 4 columns named key, name,age,value. Here the name "key" of the first column is a key word. Now I am trying to get these column names into a combo box. I am unable to get the name "key...
We are planning to move to Silverlight 3 for application development because we want to take advantage of more flexible UIs and easier deployment. We have previously used Winforms with ADO.Net and SQL Server for data driven applications.
I've briefly looked at some of the options for data access with silverlight such as Entity Framework...
Hi,
I couldn't find a quick answer on the official pages,
is it possible to write VB projects in the express edition of Visual Studio that connect to a SQL Server that is not the included 'Express' server ?
Any hints appreciated :-)
...
hi,
I have created a new report server project using the wizard in Business Intelligence Development Studio, which i started as "run as administrator" (since i am using win 7).
I have configured the reporting service and I can access the reporting server from the Internet explorer. I can also upload report files *.rdl. I can also run t...
Here is the SQL
SELECT tal.TrustAccountValue
FROM TrustAccountLog AS tal
INNER JOIN TrustAccount ta ON ta.TrustAccountID = tal.TrustAccountID
INNER JOIN Users usr ON usr.UserID = ta.UserID
WHERE usr.UserID = 70402 AND
ta.TrustAccountID = 117249 AND
tal.trustaccountlogid =
(
SELECT MAX (tal.trustaccountlogid)
FROM TrustAccountLog AS...
I want to move data from one database's table to another database's table. It is giving me a foreign key error. Please tell me how I can insert all those data which is valid except those rows who don't have a foreign key.
I am using SQL Server 2005
My query is :
SET IDENTITY_INSERT City ON
INSERT INTO City ([cityid],[city],[countr...
Hi All,
In my application many I time we use MAX(). How can I write a common function where I can pass table name and column name and get MAX().
I mean single function for any table/field.
Thanks,
Tanmay.
...
Hi
In bulk insertion only in the last record trigger is executing.
If I bulk insert 10 records the trigger is running only for the 10th record. But I need trigger to run on all 10 records.
Please help me with an example
...
For example, i have a column named EmployeeName.
Every time a user changes/fix his name, i need to keep a count. If he changes his name twice, then count is 2. Also, i need to store the time of every change employee makes on EmployeeName e.g. if the name essentially is James and time created is 9:00 AM and then employee changes to John ...
I am new to T-SQL and wanted to know why the following works and does not raise and error:
I have :
DECLARE @aVARCHAR(200), @b VARCHAR(100)
SET @a = (Some complicated SELECT Statement)
SET @b = 'ALTER TABLE abc DROP CONSTRAINT ' + @a; <-------- expected it to contain string.
Exec(@b);
The first set has a complex select statement wh...
Hello!
I have a fact table that has a column with dates loaded from an MS Access source. The thing is, some of the values are NULL and the SSAS won't let me refer my DATE dimension to it.
Is it better to solve it at the SSIS stage or is there some solution at the SSAS?
Thank you very much for you help.
...
Hi
I m retrieving a text from SQL DB based on the Search criteria i give and displaying in the Textbox in asp.net. I need to highlight the words given in the search criteria in the displayed text.
For example : If i give "need" all the word "need" in textbox that is retrieved and displayed should be highlight in yellow color. Provide...
Just tried creating a data connection to a SQL 2000 database in VS2010's Server Explorer using a .NET Framework Data Provider for SQL Server (versus OLE) and found that it didn't work.
VS2010 complained that I had to use SQL Server 2005 and up.
This used to work in VS2008 (using .NET Framework Data Provider for SQL Server instead of th...