Hello All,
I'm looking for some help building a query which has currently got my head spinning right around.
I have several entities, these look something like this:
SaleOrder
--------
SaleOrder_ID
SaleOrderItem
-----------
SaleOrderItem_ID
SaleOrder_ID
Manufacturer_ID
Manufacturer...
Hello Guys,
I'm looking for some help on writing a query which is going to be used for populating an auto-suggest field for a list of customers.
The customer table which I'm querying has three fields which comprise the customers name.
Salutation
FirstName
LastName
The form the user fills in...
Hello Guys,
I have a query which looks something like this:
Select COUNT(SaleOrder_ID) AS ThisWeekByMemberCount
From SaleOrder
Where Placed IS NOT NULL
And Placed after start of current calendar week
Can someone help me complete the puzzle? I'm used to using DateAdd and could quite...
Hello Guys,
I'm looking for some help on this query:
Select Account_Type.Name,
Count(Account.Account_ID) As Accounts
From Account_Type
Left Outer Join Account On Account_Type.Account_Type_ID = Account.Account_Type_ID
Group By Account_Type.Name
This runs just fine and produces a fair...
Hello Guys,
I have a scheduled script that runs every day and I want to pull a list of customers who should be billed on this day of the month.
Now, I've mocked up a little data to show you how I want this to work.
DECLARE @Customers TABLE (
Customer_ID int IDENTITY(1,1) NOT NULL...
Hello Guys,
I've been having this problem: http://www.tek-tips.com/viewthread.cfm?qid=1555259&page=1
Seems that DTA has crashed at some point and left lots (295) statistics on my database and it's causing problems :-)
I need a query which will delete all statistics from a table which are...
Hello Guys,
Just wanted to run this past you as I have what I think to be odd behaviour on one of my maintenance tasks. The task does all the usual things created by the maintenance plan wizard on a handfull of databases, such as check integrity, rebuild indexes, reorganize indexes, shrink...
Good Morning Guys,
I'm looking for some advice on how best to manage my disks and partitions on the server. It's only a small box, at the moment we just have a single physical disk with a single partition which contains everything, windows, applications, sql server and all the databases.
My...
Hello Guys,
I thought I'd ask your advice on this one, quite commonly within my applications I'll have a query which has optional WHERE clauses in it, so sometimes the query is executed looking like this:
Select Username
From Users
Where FirstName = 'Dave'
This is not the real query, I'm...
Hello Chaps,
I've got a site configured in IIS6 which I need to ensure is only accessible as https so that nobody is simply finding the paths of resources within the site and then hitting them over standard http.
I've played in the past with using server side code to check the url and pass the...
Hello Guys,
I'm relatively inexperienced when it comes to MySQL, this morning I've been working on a maintenance script for the database which optimizes tables within, deletes a bunch of old data and does a bunch of other small tasks.
I've saved this into a .SQL script, which I'm now planning...
Hello Guys,
I've got a query which looks something like:
Insert Into MyTable (
Something,
Another,
OneMore
)
Values (
100,
Name,
300
)
Now what I want to do is insert a random...
Morning Chaps,
As ever I'm after a little advice on the optimal way to achieve a task. I have the following query at the moment:
SELECT thinktank.thinktank_ID
, ThinkTank.Name
, ThinkTank.Installed
, RemoteAddress.Address
, RemoteAddress.DateTime
FROM ThinkTank
INNER...
Hello Guys,
I have a tables which looks somewhat like this:
CustomerTransaction
----------------------
CustomerTransaction_ID - Int - PK - Identity
Customer_ID - Int
Description - Varchar
TransactionDateTime - DateTime
What I want to do is given a datetime range and a customer_id INSERT...
Hello Chaps,
I've got a requirement here whereby we charge customers for registering with our service however on certain dates we place in a new price increase, customers that have registered before this date will still be charged the old price however any new registrations will be charged the...
Hello Guys,
I've got the following example dataset for you to play with, basicly its a set of very basic weather data, you'll see at the moment that it calculates the average temperature for the records which are pulled out.
Declare @WeatherReport Table (
Location_ID int,
Description...
Hello Chaps,
I have the following query:
Select Campaign.Campaign_ID,
Campaign.Name,
Event.ID,
Media.Name As MessageName,
Media.Type
From Campaign
Left Join Event On Campaign.Campaign_ID = Event.Campaign_ID
Left Join Media On Event.Media_ID = Media.Media_ID
Where Campaign.Owner_ID =...
This has to be the simplest query I've not been able to get working, I hang my head on this and hope you wont judge me ;-)
I have this query:
Delete From ThinkTankGroup
Where ThinkTankGroup_ID Not In (
Select ThinkTankGroup_ID
From ThinkTank
)
Now, this is meant...
Hello Guys,
Looking for a little help forming this query as the concept is currently confusing me. The end goal is to pull data which I can use to create a 'tag' or 'keyword' cloud.
I have three tables which look like this:
Media
------
Media_ID
Media_Lnk_MediaTag
------------------...
Morning guys,
I used a maintenance plan to setup a bunch of tasks for shrinking and backing up the database on a nightly basis about 2 weeks ago. At the moment all the backup files sit in directory on the disk, however, I really only need the last couple of days of full backups.
Is it possible...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.