I've written a plugin for a game that connects to a PHP page and sends it information from the game. The PHP page takes this information, connects to a SQL Server 2005 instance, then inserts the information given into a variety of tables.
I am using Apache (WampServer) to host the PHP page and SQL Server 2005 Express for hosting the da...
Specifically, I wish to get the date format in a pure (ISO) format:
YYYY-MM-DD HH:mm:ss
I'm looking for a SET command or something that I can use.
I do not wish to rely on the culture setting of the server.
Note: I'm interested in the string format in which dates are returned, not entered.
...
I am trying to take a person and display their current insurance along with their former insurance. I guess one could say that I'm trying to flaten my view of customers or people. I'm running into an issue where I'm getting multiple records back due to multiple records existing within my left join subqueries. I had hoped I could solve...
This question is very similar to SQL Server 2005: T-SQL to temporarily disable a trigger
However I do not want to disable all triggers and not even for a batch of commands, but just for one single INSERT.
I have to deal with a shop system where the original author put some application logic into a trigger (bad idea!). That application ...
I have 6 months of data, how do I replicate only the most current 3 months of data to the subscribers?
...
Hi,
I need to produce a SQL report showing the number of times a particular event happened in each hourly period during the day. My table has a date/time column on it containing the time the event occurred.
How do I do a count of the number of rows that fall within each each hourly period during the day?
So I need to see output like t...
Hi,
I've got a query that returns the cost of wages for a given member of staff
SELECT totalhours * staffbaserate AS TotalCost
FROM newrotaRaw
WHERE staffref = @staffref
However I need to do an additional bit of maths if the returned value is > 105. The bit of maths I need to do is that if the value is < 105 the value...
My log file in SQL Server used up all the space on my disk. I run full backups every night, but the log file keeps growing. What can I do?
...
I'm using Linq-to-SQL with a SQL Server backend (of course) as an ORM for a project. I need to get the result set from a stored procedure that returns from a dynamically-created table. Here's what the proc looks like:
CREATE procedure [RetailAdmin].[TitleSearch] (
@isbn varchar(50), @author varchar(50),
@title varchar(50))
as
declare ...
I'm supporting an existing application written by another developer and I have a question as to whether the choices the data type the developer chose to store dates is affecting the performance of certain queries.
Relevant information: The application makes heavy use of a "Business Date" field in one of our tables. The data type for t...
I just recently changed out all my hard drives and in the process of setting up some projects again I noticed that the database file I was backing up was actually the wrong file as it only contains 30% of the database that I had running. I have my old drives and all the data should be intact but I've been unable to actually locate the co...
I need to write a select query that joins the tables based on a condition (in this case, based on a value in one of the columns). I would like to do something like this:
SELECT *
FROM TableA
INNER JOIN TableB ON (TableA.Column1 = TableB.Column1 OR TableA.Column1 = 0) -- Does not work!
...
I am looking to generate a MSSQL schema from an excising industry standard xsd file. Any suggestions on which Tool to use? I have played with XMLspy but I need a little more flexibility in the data type mapping.
...
How to I determine the maximum row size for a table? I'm looking for a tool or script that does this so I don't have to add up each column's size by hand.
My goal is to produce a report of tables that are too wide so we can look into restructing them. I know we have several that are so wide that only 1 row fits on each 8K page, but I wa...
In SQL Server (2000 or 2005) is it possible to set the database or server collation so that identifier names (tables, columns, etc) need to be in the correct case? If so, is that true of all case-sensitive collations or is it a separate setting? (I've always thought of case-sensitivity applying to data, not to names of objects).
Presuma...
Setting up a Windows based web application on Amazon's cloud has definitely been a learning experience. Lots of unexpected hoops to jump through, especially to get around the ephemeral local drives limitations.
I was hoping to tap into the collective wisdom of those who have walked this road ahead of me and get some insight into best p...
In SQL Server, how do you determine the (average or expected) number of rows per page?
I know know how to determine the average and max row size, but I don't know how that relates to actual rows/page.
...
I am trying to set every row's CheckColor to Blue in the table tblCheckbook (why the hell do people add tbl to the start of every table, I think I know it's a table).
I'm using this query
UPDATE tblCheckbook
SET CheckColor = Blue
However, Microsoft SQL Server Management Studio Express complains Invalid column name 'Blue'.
T...
I have two issues both related to (I believe) my SQL Server setup. I have installed SQL Server (the full thing) from MSDN downloads of the x64 version on my Vista 64 Home Premium box. After running into multiple issues I finally got it working. This is a new box so I ported over a database that I need to work on from another server. ...
I want to implement an atomic transaction like the following:
BEGIN TRAN A
SELECT id
FROM Inventory
WITH (???)
WHERE material_id = 25 AND quantity > 10
/*
Process some things using the inventory record and
eventually write some updates that are dependent on the fact that
that specific inventory record had sufficient quantity (greater ...