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 > october 2007 > threads for thursday october 25

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

Summing by Date into a week
Posted by Ant at 10/25/2007 10:02:00 PM
Hi, I have a table which includes a cost column & a date column. The dates are roughly one or two days apart. I need to sum the costs into weekly groups. How can I do this? Many thanks in advance for any ideas on this Ant...more >>


Shareware embeding
Posted by Mark at 10/25/2007 7:58:46 PM
I'm a shareware programmer and I'd like to embed to my VC++ application some appropriate database. Since I have no database experience I'd like to hear references from professional programmers regarding the following- 1. Is sqlserver could be appropriate? 2. Is there any other commercial produ...more >>

One child table, two parents (your opinion?)
Posted by Dean Slindee at 10/25/2007 7:42:26 PM
I recently received a database schema to load. It contains a single child table with two parent tables. The child table contains mailing address columns (address, city, state, zip, etc). The two parent tables contain name parts. One table is for persons, and the other table is for busine...more >>

Scheduling SQL Query - SQL Server 2005
Posted by BLAW at 10/25/2007 6:23:49 PM
What is the easiest/best way to schedule a daily run of SQL update statement. I have read some posting on using the SQL Agent, but what is it, where is it, and how do I use it? I have a SQL statement that I am using to populate a table. ...more >>

Scripting procedure 2005 - no header comments
Posted by Trey Walpole at 10/25/2007 6:00:39 PM
Has anybody run into this? When I'm scripting a procedure in SMS, whether using right-click/[Modify|Script] or the wizard (sp2), none of the header comments appear. (i.e., comments prior to the CREATE) This was happening before I moved to sp2. I just noticed it today, and I'm not sure of t...more >>

Next month
Posted by BLAW at 10/25/2007 5:47:51 PM
How can I limit a query to = next month, I do not want to see any data for this month? ...more >>

Date Wrap Around Problem
Posted by Mark at 10/25/2007 5:23:12 PM
Thanks in Advance, I have the following case statements in a query: CEILING(SUM((CASE WHEN MONTH(dbo.ConvMacDate(due_dt)) - (MONTH(GetDate()) + 3) = 0 THEN ms_qty ELSE 0 END))) AS ItemsPlanned3rdMonthAhead, CEILING(SUM((CASE WHEN MONTH(dbo.ConvMacDate(due_dt)) - (MONTH(GetDate()) + 2) = 0 ...more >>

table schema question [EAV VS Wide Table]
Posted by georgejetson at 10/25/2007 2:39:01 PM
Anyone: (and what really drives this question is question #2 below since I've not had an issue with slow queries yet, I just thought I'd throw it in for good measure) I have a subsystem that logs the same set of data to a table each time a job has completed. I use to have a wide table w...more >>



how to ignore error inside a trigger
Posted by ren reyes at 10/25/2007 2:09:02 PM
i need to do some action when an inserted or deleted record satisfies a certain criteria. and all i really want to do is say send an email. now if this process fails, i might want to log it but i don't want the trigger to abort. the changes should still persist! is there a way to do this? it s...more >>

Outer Join Issues
Posted by Richard J at 10/25/2007 12:05:19 PM
Hello group, I have a puzzle that I am trying to solve and was hoping someone out there would be able to help. I am working as part of a development team that has inherited code initially written 12+ years ago and has not evolved well with the times. The product has used many versions ...more >>

How to update table using SQL query?
Posted by jaroslaw.blonski NO[at]SPAM gmail.com at 10/25/2007 12:04:26 PM
I need to update table in SQL Server. When records have no value, value should be taken from the previous record were value IS NOT NULL. EXAMPLE: ID Value 1 1 2 3 8 4 5 9 6 44 7 8 9 10 11 33 AFTER update values should be as below ID Value 1 1 2 1...more >>

Partitioning, Sliding Window, and Filegroups
Posted by Mitch at 10/25/2007 11:55:05 AM
I'm trying to follow Microsoft's example of partitioning and sliding window in the Adventureworks database, but what I want to do is put the primary table and the archive table in different filegroups (because I just want to back up the archive file group nightly). There's no problems setting...more >>

How to shrink/truncate transaction log file in SQK2K
Posted by Mehbs at 10/25/2007 11:46:55 AM
My transaction log file is pretty big and am trying to run maintenance plan which is setup to clear the unused space etc. But it does not run. It keep erroring out saying administrator has no rights to run. Is there any other way of running or shirinking log file? ...more >>

Stored procedure got destroyed on 2005
Posted by huohaodian NO[at]SPAM gmail.com at 10/25/2007 10:46:27 AM
Hi, I have several stored procedures, if I create them via a sql file together with some other stuff (create couple tables), the creating process always success, then the first time execution for the main store procedure which calls others always goes success, but after that first time one ...more >>

Find customer initial order in Northwind
Posted by Norman Heyen at 10/25/2007 10:12:01 AM
Hi folks, A SQL newbie guy here, so please point me to the straight and narrow... In the real world, I'm trying to build a Business Objects report that will find the new patients by month but I think I can learn from Northwinds at this point. If I decide that a new customer is born fro...more >>

copy data from one server to another
Posted by at 10/25/2007 10:00:45 AM
I have abut 15 million records needed to be copy directly from one server to another what is the fastest way? I use select * into xx from xx.xx.xx thanks ...more >>

WORKING WITH TWO SERVERS AND DATABASE
Posted by at 10/25/2007 9:55:17 AM
Hi, I don't have time to test it out. I am just wondering what is your experience on this. I have migrate data from server1.db1 to server2.db2 However, I only have read only permission from Server1.db1 In my process I must create a table to store data before moving to db2(can't use temp,...more >>

how can I add distinct to this query?
Posted by musosdev at 10/25/2007 8:52:01 AM
Hi I have 2 tables, Stories and StoryImages. I need to a random set of 10 images from StoryImages, but only 1 image from each story. The link field is StoryID - there can be many StoryImages to a Story. Here's what I have so far... SELECT TOP 10 Stories.StoryID, StoryImages.Image, Story...more >>

NORMDIST(X, mean, Standard_Dev,True) in SQL 2005?
Posted by JC at 10/25/2007 8:21:00 AM
Hi, In Excel I can find the normal distribution with the formula: =NORMDIST(x, mean, standard dev, cumulative) How is this done in SQL 2005? I am having a difficult time finding this on the web so hopefully someone can assist me with this or at least point me in the right direction. ...more >>

WHERE IN (@VARIABLE) ???
Posted by Carlos Sosa Albert at 10/25/2007 8:00:00 AM
Hi guys, Is there any way to do something like this? The idea is that I have some updates to do, and I would be passing a list of integers in a @VARIABLE. But I didn't find a way to do it... Thanks a lot! -- ____________________________ Carlos Sosa Albert...more >>

SQL Server 2000 SP4: Weird problems parsing and running a trigger
Posted by JimLad at 10/25/2007 5:13:40 AM
Hi, I got called in this morning to look at a trigger that was leaving a transaction open. From manual inspection there was nothing wrong with the trigger, but when run the trigger was failing at some point after creating a transaction but not producing any error messages. Which is weird as t...more >>

Columns from Storeprocedure
Posted by prakashdehury NO[at]SPAM gmail.com at 10/25/2007 5:05:06 AM
Hi I have store procedure that returns around 100 columns. I just want the 1st columns data of the proc. I cant change anything in the storeprocedure as it is req by other apps. create proc test @ID int, @subID int, @range Int as Begin select col1, col2, ...more >>

How to: Connect to SQL Server Through a Proxy Server
Posted by Konrad Wicński at 10/25/2007 3:33:02 AM
I want to connect to remote sql server via IP, but I am connecting to internet via proxy. How do that?...more >>

Does an indexed view possibly relieve the tables it is based on?
Posted by DC at 10/25/2007 1:12:45 AM
Hi, in my application a lot of simultaneous updates and selects are pondering on one table. Sometimes I need some data of this table in a delayed fashion only. To relax locking on that table I therefore copy (every hour) some columns into an helper table and execute many selects on that table...more >>

isnumeric - identification integer
Posted by Viktor Zavadil at 10/25/2007 12:00:00 AM
declare @var varchar(255) set @var =3D '78D6' if isnumeric(@var) =3D 1 begin select cast(@var as numeric(18,0)) end else begin select 'cannot convert data' end This cast convert varchar to numeric - throw error (error converting = data type varchar to numeric) becouse @var is not...more >>


DevelopmentNow Blog