Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
all groups > sql server programming > august 2007 > threads for friday august 31

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Pivot query problems - Sum by Row type
Posted by morleyc NO[at]SPAM gmail.com at 8/31/2007 11:31:18 PM
Hi, i am trying to get a pivot/crosstab query working but i am having a hard time working out what im doing wrong. I have googled for a number of samples for use with my database but i cant apply to my scenario so i would appreciate some guidance. I have an employee's table, and an AsencesTabl...more >>


Scripting Extended Properties
Posted by Mark Assousa at 8/31/2007 7:34:41 PM
I am running on SQL Server 2000 SP4. I am attempting to generate SQL Script and include extended properties. When doing so, the extended properties for one table (i.e. Column Description) are not generated. Extended properties for all other tables script just fine. I've even gone so far a...more >>

SSIS on SQL 2000 to SQL 2000 ?
Posted by at 8/31/2007 5:09:14 PM
Can SSIS moving data from one SQL 2000 db to another SQL 2000 db? If so, can anyone tell me what i need to do this? Execute SQL Task ? Data Flow Task ? OLE DB Source ? OLE DB Destination? It's a little confusing even after reading for a day. Any examples great appreciate and will award ...more >>

SQL Select
Posted by brandon at 8/31/2007 4:58:56 PM
I have following tables: 1. Registration with RegistrationId, Name 2. EventMeal with MealId, MealFee 3. RegistrationMeal with RegistrationId, MealId, MealQuantity (this can have more than one row for same RegistrationId) 4. EventSession with SessionId, SessionFee 5. RegistrationSession with Re...more >>

Calculate time intervals
Posted by Mark Goldin at 8/31/2007 4:17:54 PM
I have data as following: create table #test (jobcategory int, startsusptime datetime, endsusptime datetime) nsert into #test values (1, '2007-05-03 14:12:39.033', '2007-05-04 06 insert into #test values (2, '2007-05-03 14:19:26.547', '2007-05-03 14:21:53.890') insert into #test values ...more >>

How can I find out the size of a database?
Posted by PSULionRP at 8/31/2007 12:42:02 PM
How can I find out the size of our SQL Server Database??? Any help would be greatly appreciated. Thanks in advance for your help. PSULionRP...more >>

query
Posted by bobby at 8/31/2007 12:42:01 PM
The following gives me the error u.username is invalid in seklect list because it is not contained in either an aggregate function or the group by clause SELECT u.Username, u.Email, ar.RoleName, uc.LastActivityDtm, COUNT(t_Proxy.ProxyUserID) AS Expr1 FROM t_Roles AS uar INNER JOIN ...more >>

History question: when did the sp_oa_* procs get introduced?
Posted by KJ at 8/31/2007 12:41:47 PM
I'm doing a bit of research for a short posting on the sp_oa_* procedures, used to handle COM objects in SQL Server. Can anyone provide the history of these, including in which version of SQL Server they made there first appearance? Thanks in advance, KJ ...more >>



calling a function
Posted by seema at 8/31/2007 12:16:03 PM
how can i call a function from a stored procedure...more >>

Combine rows in single row
Posted by seema at 8/31/2007 11:44:01 AM
I have a table username Roles Seema Admin Seema AppAdmin Seema Testing Bobby Manager Bobby Admin I want a query so that i can get something like seema Admin, AppAdmin, Testing Bobby Manager, Admin...more >>

rebuild Index
Posted by at 8/31/2007 10:12:33 AM
I want to rebuild index on all the tables on my database with the exception of 7 tables. how can I do that? Thanks ...more >>

Best Practices
Posted by Mike DeYoung at 8/31/2007 9:14:02 AM
I have a small client who wants to consolidate Terminal Services and SQL Server on the same box to save money. I have never been a proponent of this but I also can't find a Microsoft best practice that addresses this. Has anybody seen a Microsoft blessed best practice on this? Do you know w...more >>

grouping records into half hour slots
Posted by VJB at 8/31/2007 8:25:45 AM
Hi, I have 2 tables: one with real time data, and another is lookup Table Data col1 date col2 amount table lookup col1 identity col col2 slot col3 alias col4 start_time sample of table data dt amount 2007-08-06 00:01:00.000 0 2007-08-06 00:01:23.000 0 2007-08-06 00:02...more >>

INSERT trigger doing the wrong thing on multiple insert
Posted by francis.moore NO[at]SPAM gmail.com at 8/31/2007 8:06:16 AM
Hi, I posted some trigger code yesterday that somebody was kind enough to fix, but further testing has thrown up another problem with the code. What I want to do is add a subnet into Table B for every IP that gets inserted into Table A, if that subnet does not already exist. If I add an IP ...more >>

YOU MUST KNOW THIS MAN
Posted by abdo911 at 8/31/2007 7:27:09 AM
Allow me to share with you here some information about one man his name is muhammad. In The Name Of Allaah, Most Gracious, Most Merciful YOU MUST KNOW THIS MAN MUHAMMAD (May peace and blessings of God Almighty be upon him) You may be an atheist or an agnostic; or you may belong to anyon...more >>

CrossTab Query Question
Posted by PeterNEA NO[at]SPAM gmail.com at 8/31/2007 6:44:22 AM
Hi, I have a SQL table that has data like this: Title Month Info 1 ---- 7 ---- 100 1 ---- 7 ---- 100 1 ---- 8 ---- 200 1 ---- 8 ---- 250 2 ---- 7 ---- 150 2 ---- 7 ---- 150 2 ---- 8 ---- 300 2 ---- 8 ---- 300 3 ---- 7 ---- 250 3 ---- 7 ---- 250 3 ---- 8 ---- 100 3 ---- 8 ---- 200 ...more >>

Debugging SQL
Posted by Doogie at 8/31/2007 6:26:42 AM
Hi, I'm sure this is probably a silly question, but I'll ask anyhow. I'm trying to debug a large proc (sigh) and am putting print statements in it to do so. Working fine, but everytime it does a update or insert it prints out the rows affected as well, like the example below. This adds a lot o...more >>

Combine Query results side-by-side as one query
Posted by morleyc NO[at]SPAM gmail.com at 8/31/2007 6:21:29 AM
Hi, i have two queries with the following data: Hours worked query: EmployeeID_FK HoursWorked OvertimeHours Absences query: EmployeeID_FK SickTaken HolidayTaken They are independant calculated columns (from hours worked table and absences table), however the EmployeeID_FK is como...more >>

Fetching records - Cursor or not?
Posted by Harish Mohanbabu at 8/31/2007 6:18:03 AM
Hi, I have two tables - Table1 and Table2. Table 1 contains dates and Table 2 contains records. I need to get first two records from Table1. And in table 2 I need to get all records falling within those two dates in Table1. After that I need to move to next two records in Table1 until ...more >>

Select latest entries
Posted by billy.watt NO[at]SPAM nov.com at 8/31/2007 6:01:26 AM
I require a query from a login audit table that will select the latest entry only for each user. The data I want to see consists of three fields: 1. username 2. login_date 3. login_time I can get as far as creating a temporary table with the entries sorted by username, login_date (descendin...more >>

out of time
Posted by Hans - DiaGraphIT - at 8/31/2007 2:50:01 AM
Hi! what am I doing wrong. declare @val1 int set @val1 = cast (count (Select * From table1 where col1 is not null) as int) update table2 set mycol = Case @val1 = 0 then 3 else case @val1 > 2 then 1 else 0 end where mycol is null ...more >>

SQL Server 2000 Lock question
Posted by Jason Huang at 8/31/2007 12:00:00 AM
Hi, In my application, I have some SQL like SELECT Max(No) FROM Prod My app coding logic is if the max no is now 1000, then the new No for the inserting Prod will be added 1, namely 1001. Now comes the situation, if many users are inserting the Prod and the concurrent connection is als...more >>

How to improve this query
Posted by Faye at 8/31/2007 12:00:00 AM
This query works beautifully. What I want to do is, select the SURV_YY_DT available in the table and sum without having to hard code each year. SELECT ABA_NR , SUM(CASE YEAR(SURV_YY_DT) WHEN 2006 THEN 1 ELSE 0 END) AS c2006, SUM(CASE YEAR(SURV_YY_DT) WHEN 2005 THEN 1 ELSE 0...more >>

Schema XML on column
Posted by Franck at 8/31/2007 12:00:00 AM
Hello I would like to know on the xml column if there is a schema associated. What query must i use ? Franck ...more >>

IN / AND differences curiosity
Posted by luna at 8/31/2007 12:00:00 AM
Just playing around and i came across the IN function eg select name from table where name in('smith',jones') or you could just select name from table where name='smith' or name='jones' they both do the same thing, only issue i found was you cant seem to use wildcards unless you do a sub...more >>

Transaction failure when remoting
Posted by Johan Karlsson at 8/31/2007 12:00:00 AM
Hi! I have an application where the client call the server over .net remoting (tcp). The application has three parts (Database on server A) -> (BI Services on server B) -> (Testclient on server B) The final code to be called looks something like this: Public Sub Update() Usin...more >>


DevelopmentNow Blog