This question seems to come up often ... usually Distinct or Top or the like is suggested. I just have "one" column out of many which I want to be unique, not all of the columns, and if there ...
Getting the aritmetic overflow error and have narrowed it down to one or both of these case statements. Can you please tell me what I am doing wrong...?
I have a Microsoft WIN2K3 R2 STD edition server with existing instances of Microsoft SQL 2000 and Microsoft SQL Express 2005 already installed. I am trying to install a new instance of SQL 20...
This is the age old recursion example. Can someone please write a stored procedure for Microsoft SQL server that takes an employee's id and gets his supervisor, and his supervisor's supervisor...
OK - I have two tables.
HostPhotos contains UR:s to photos and the HostID - We can get a list of all the Hosts that have photos using:
SELECT HostID FROM HostPhotos GROUP BY HostID
I...
Hi,
We are using SQL Server 2000 and we need to write a query that includes a date time conversion based on a user's time zone.
in the database we have a date time stored as 7/16/2008 03...
Ok I have two tables with identical schemas. except the second table has an identity so i can still reference duplicate rows. sql 2005
para | Auth | Asgn
12 1 ...
i have a 70,000 record table but i think it should only have 35,000 because all of the records i looked at (when in id order) has a twin underneath it. is there an easy way of removing one of ...
I'm wondering if I can combine the following two queries to run as one query. The first query is an Insert/select: The second query is an update based on one of the fields being inserted. T...
I'm running the below script but receive a 'Violation of PRIMARY KEY constraint' error.
The primary key is SKU - CHAR(15)
Any suggestions?
Hi,
We have a SQL 2000 server and unfortunatly about 2000 records have been deleted from 4 tables within the system, now I have a backup from last night, however I CANNOT restore the entire...
Im trying to write a sql scripts that deletes similar rows from a SQL database table (2000, and will test it on 2005)
The SQL table column values are all exactly the same except for the ID fi...
I have a table in my SQL Server 2005 database which contains hundreds of records. Each record contains a column marked Revision, incremented by 1 as new versions are uploaded.
The OriginalJob...
I'm trying to dup the data in tables that I have in my database into a flat file. I get the name of tables, pass them to a foreach loop and read the data for each table but the problem is sinc...
I am new to T-SQL and am using reporting services to create reports from the database. However, the database shows a field called Active as 1 or 0. I want it to say Yes if 1 is shown and No if...
Hi Experts
I have a SQL table which contains all Upper Case data. I moving it from this table to another table where the Data is Proper case ( from PAUL to Paul ) I am not having any probl...
I have a stored procedure please see attached.
The procure loops around a several tables to give me an employee count subject to the start date, end date, industry, agreement passed in as v...
I have gotten superb help on a question from others here in Experts exchange, however the answer lead to another snag i am desperate to fix.
The below kode leads to the following error:
AD...
I don't need milliseconds, just Month Day Year Hour Minute Second AM
convert(varchar, CONVERT(datetime, col_datetime), '101')
This doesn't work either:
Select convert(varchar, CONVERT...
Experts:
I'm sure its an easy question..but I'm new to RS. How do I begin to give ACCESS to the reports on my Reports Server WebPage?
I guess I need to add individual USERS....?
Thank...
Hi Experts,
I am trying to get as much information from one sql query as possible. Below is my current Select query which returns AVG,STDEV,MIN, and MAX values with a group by :
Sele...
Hey,
I wish to format all names in my table to have a capital first letter and lower case the rest.
like BILLY should be formatted to Billy etc...
Can you help me please?
I have a table of work schedules, when a person requests vacation for a partial day an entry is made in the schedule table for the hours of vacation requested. My problem is that when the vaca...
Hi experts, I'd just like to total a derived column as per my query but I just get 'invalid column name 'won' from the 4th line below here...
select odds,
count(CASE when win_flag = 1 THE...
Our production server's transaction log file has increased to 10GB over the past two days. this is in turn causing slowdown of our database. How do we track why this is happening?