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 wednesday august 8

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

Joining/filtering question.
Posted by at 8/8/2007 9:45:26 PM
Saw some code written like this Select a..* FROM a inner join b on a.1= b.1 and a.2 = 4 would this be faster then the traditional code: Select a.* FROM a inner join b on a.1= b.1 WHERE a.2 = 4 Thanks ...more >>

combine the results
Posted by rodchar at 8/8/2007 8:22:00 PM
hey all, given the following 2 tables: Departments --------------- DepartmentId Name ParentDepartmentId Employees -------------- EmployeeId Name SupervisorId SELECT * FROM Departments SELECT * FROM Employees Isn't there a way to combine the results? If so, once the results ...more >>

Backup Script
Posted by Jordan at 8/8/2007 7:35:33 PM
I have SQL job that backs up a few of the databases to the same tape. I used the wizard to create each step of the job. The first step below erases the tape and labels the media, but it only has the static name and description that I filled in with the wizard. I want to modify the media n...more >>

Parsing CSV Strings : Speed Freaks only.
Posted by Russell Mangel at 8/8/2007 6:17:51 PM
The following code parses a comma seperated list of int's and returns a table. It seems to perform well, It can process a String with 70,000 int's in 4.1339175 seconds. Can anyone improve on this? Thanks Russell Mangel Las Vegas, NV PS Please no comments about parsing strings = bad. ...more >>

Can I update a view on MSSQL 2005
Posted by Robert Johnson at 8/8/2007 5:23:29 PM
Hi all. I have a view on two tables that are related. I need to be able to update the records from my application through the view, is this possible? Looking at MSSQL Server Managment Studio I don't see where I can set the view to allow updates. Did I miss something? Regards, Robert ...more >>

Need help with a trigger
Posted by Blasting Cap at 8/8/2007 5:07:09 PM
I have a table where there's a trigger set on it to do the stuff below when the status field gets set to a 1. The code I'm using to set the status field to a 1: select * from orders where orderid = 15 update orders set status = 1 where orderid = 15 select * from orders where orderid...more >>

Merging 2 databases
Posted by Irene at 8/8/2007 4:39:07 PM
Hi there, I have two databases with the same structure, having 150 tables each. Most of the tables have exactly same data in both databases, while others have different, but I don't know for sure which ones would have disrepancies. Is there any tool that will let me merge the tables that have d...more >>

Select statement
Posted by brandonjack007 NO[at]SPAM gmail.com at 8/8/2007 4:32:33 PM
How will you do something like this. A table has records like shown below. I want to get all the records. However when I encounter the same Id for a different date I want to add the value of AR for the second record: Date Id AR 05/07/2007 100089 30...more >>



SELECT Query Help - Multiple Records
Posted by at 8/8/2007 4:03:11 PM
Hi, Hoping to get some help modifying the following query that I have... TABLE: NAMES ID, FirstName, LastName TABLE: EMAILS ID,LinkID,Email,LastUpdateDate I have two tables, one of Names, one of Emails. Each person only has one record in the Names table. Each person however, may have ...more >>

Selecting products in a category
Posted by MikeB at 8/8/2007 3:58:00 PM
For some reason I am drawing a blank in trying to figure out the best way to select the products in a category. The categories can have multiple sub categories so for example, if a product is part of category 1 - A and category 1 is selected it should show all products in category 1 and ca...more >>

update status
Posted by SOC at 8/8/2007 3:37:18 PM
Hello, Table A has columns a_id and a_status Table B has columns b_id, a_id I would like to set a_status to 1 where a_id exists in table B. Can you advise? Thanks. Soc. ...more >>

Sending email form SQL server 2000
Posted by Mark Goldin at 8/8/2007 2:54:08 PM
What do I need to configure to be able to run xp_sendmail procedure? Thanks ...more >>

Fun with dates
Posted by Carl Henthorn at 8/8/2007 2:52:09 PM
Is there a quick and dirty way to create a table containing all the days of a given month? something like this: Create table Aug (day int, week_num int, week_day varchar(20) ) the contents would look like this: 1 1 Wednesday 2 1 Thursday 3 1 Friday 4 1 Saturday 5 2 Sunday etc ...more >>

Need help in constructing temporary table through stored procedure
Posted by Jack at 8/8/2007 2:04:02 PM
I got a sql server table which is like the following Group Description Amount 3000 Net Sales 100000 5000 Total Var Cost 75000 7000 Total Other Cost 20000 Now I need to make a Net Profic Description field out of the above table So I am thinking of cr...more >>

Simple query help
Posted by Jon at 8/8/2007 1:27:46 PM
I have a table that routinely has upwards of 10 million rows. Our program has the following line in it: X= some integer DELETE FROM ALM WHERE Product = 'ALM' AND DATEDIFF(d, [Date], GETDATE()) >= X This is extremely slow to execute. I know there is another way to do this that is much ...more >>

DateValue function
Posted by jpatterson NO[at]SPAM mikob.com at 8/8/2007 11:48:00 AM
Good afternoon, MS Access has a DateValue function that allows you to take a series of strings and convert the whole mess into a recognized date value. SQL Server does not seem to support any variation of this command. In short, what I need to do is strip out the DD from a mm/dd/yyyy format and...more >>

Trying to append data
Posted by Al at 8/8/2007 10:18:03 AM
I have a table in sql 2000 . I deleted the data from the table. When I tried to append the same data again I got error message saying that" Server: Msg 8152, Level 16, State 2, Line 1 String or binary data would be truncated. The statement has been terminated.".. What does that mean? here is m...more >>

Order of Locks in SQL Server
Posted by Mike at 8/8/2007 10:14:07 AM
I have two processes deadlocking because they are locking resources in different orders: Process 1 (an update) Locks Table A then Table B Process 2 (a select) Locks Table B then Table A Can I control the order in which process 2 (the select statement) locks Table A and B? Thanks, Mike...more >>

Procedure vs. Function performance
Posted by Derekman at 8/8/2007 9:34:03 AM
For logic that can be encapsulated in either a procedure of user defined function, is there any performance difference between the two?...more >>

Isolation Level
Posted by Ed at 8/8/2007 9:20:02 AM
Hi, If I would like to block anyone else from updating/Inserting the table while running the stored procedure, what Isolotion Level should I set? Thanks Ed...more >>

Reporting Services Question
Posted by Bill Yanaire at 8/8/2007 8:20:13 AM
I am running SQL Server 2005 and Visual Studio 2005. I was looking at the reporting services in SQL server. If you open Business Intelligence Studio, Visual Studio will come up as the development arena for reporting services. I can create a report and deploy the report. It seems that repor...more >>

Alter table Add newColumn varchar(20) inside a cursor
Posted by Bob at 8/8/2007 8:02:10 AM
Hello folks... I need to write a report...give the number of issues associated with a specific type of problem category. The categories might change from day to day....I would like the report header to be like this Buyer - prob cat #1 - prob cat #2 - prob cat #3....ect ect so I made ...more >>

Novice: Using UPDATE with WHERE CURRENT OF
Posted by Peter at 8/8/2007 5:32:03 AM
Hello, Thanks for reviewing my question. I am trying to use UPDATE with the current cursor but I get an error "The cursor is READ ONLY." The following is my code DECLARE curTEAM CURSOR SCROLL DYNAMIC FOR SELECT GAMEGUID, TEAMGUID, TEAMNAME, SEQUENCE, MATCHNUMBER FROM temp_TEAMS...more >>

Doing without indexed views
Posted by Yitzak at 8/8/2007 5:19:22 AM
Hi I have a non-relational table. The field of interest is non atomic - its ID + CODE ID is always 10 chars, CODE is always 5 So I'm going to have to write a view to split the field into the 2 fields so I can join ID with another table.. SELECT ....... SUBSTRING(IDCODE,1,10) as ID, SUBSTRI...more >>

Scheduler--Please Help.
Posted by Sujit Mandal at 8/8/2007 4:37:24 AM
Hello I have an application in ASP.NET.I want a database operation will fire every 24 hr.My project is ASP.Net 2.0(c#) and sql server 2005. Please suggest me what should i do? if any reference link or code available than it will be better for me. Thanks in advance. EggHeadCafe.com - .NET De...more >>

Do you want to know about ISLAM
Posted by goglemailll NO[at]SPAM gmail.com at 8/8/2007 3:58:11 AM
Do you want to know about ISLAM, the fastest growing religion in the World ? If yes, please visit this site : http://www.al-sunnah.com/ http://www.islam-qa.com/ http://www.islamzine.com/ http://www.cocg.org http://www.sultan.org Explore & discover & be convinced that ISLAM is the...more >>

Replace function
Posted by hon123456 at 8/8/2007 3:55:33 AM
Dear all, I am trying to use Replace function, I got a table name Carton and the column name is inbound_no. And I use SELECT REPLACE(dbo.Carton.inbound_no, 'abc-2007', 'abc-07'). I am quite sure that I got the correct for the table names and column name. But Query Analyzer retur...more >>

View to display only 3 significant numbers (digits)
Posted by Bobbejaan at 8/8/2007 3:09:01 AM
I am new to SQL queries and this problem is definitely above my level of expertise... I hope somebody will be able to assist me. Any assistance will be greatly appreciated. Thanks. I have a table with character and numeric fields (different definitions in terms of number of decimals, etc.)....more >>

Naming conventions for objects in SQL Server 2005!
Posted by robbanjoh NO[at]SPAM hotmail.com at 8/8/2007 3:01:22 AM
Hello Are there any disadvantages in naming SQL Server 2005 functions with prefix fn_functionanme and stored procedures with usp_procedurename? Are there any naming convension document that describes bestpractices for this? i=B4m asking because i have a diskussion about this with a sql se...more >>

How to Substitute String
Posted by hon123456 at 8/8/2007 2:42:03 AM
Dear all, I got a invoice number which is a combination of date and sequence number. that is FIHI-200708080001 Now I want to change 2007 to 07 in all the invoice number. That is changed from FIHI-200708080001 to FIHI-0708080001. How can I subsititute the Invoice Number. There...more >>

pass variables to ssis package
Posted by farshad at 8/8/2007 1:07:23 AM
Hello, I placed a post regarding this issue previously but no success. So I thought I explain everything properly this time in a new post. Thanks I have created a stored procedure which passes variables to the ssis package and then executes the package. The two variables inside the ssis...more >>

Problem with SQL Queryy
Posted by brandonjack007 NO[at]SPAM gmail.com at 8/8/2007 12:32:45 AM
Select tmp.TransactionDateTime,orderid,sum(Sales) Sales, sum(Received) Received, sum(Cancelled) Cancelled, sum(Refunded) Refund, sum(Sales - Received + Refunded - Cancelled) AR from ( select CONVERT(NVARCHAR(10),od.TransactionDateTime,101) TransactionDateTime, od.Orderid, Case when class = 1 t...more >>

linked server inside a trigger
Posted by Dan at 8/8/2007 12:03:58 AM
Dear all I am trying to use linked server objects inside a trigger and have some major problems. Just to explain what i am trying to achieve: My server A is SQL 2000. When ever a row is added to a table on server A i would like to send some of the inserted values to server B which is a ...more >>

Can I run SSRS reports from my VB6 application?
Posted by Rico at 8/8/2007 12:00:00 AM
Hello, I'd like to run some SSRS reports from my VB6 application. Is this possible? If so, could someone direct me to a good tutorial to do so? Currently I have an installation of SQL 2000 with Reporting Services, on a Win2K3 server box. Thanks! Rick ...more >>

First Record and Last record
Posted by sam at 8/8/2007 12:00:00 AM
How do I with sql get the value of the 1st record in a recordset What I have is a table where numeric values are sorted as strings. I need to get the min and max values BUT because they are strings they are NOT return the result as if they where number Thanking you Sam ...more >>

remove reference of a table from say 100 stored procedures
Posted by ekta at 8/8/2007 12:00:00 AM
Hello All I am working on SQL SERVER 2000 DATABASE. Is there any quick way to Drop the table say TABLE1 from the Database and remove its reference from all stored procs(about 100 Stored Proc's) Pls help me asap. Regards, Ekta ...more >>

Capture error from sub-procedure
Posted by Jay at 8/8/2007 12:00:00 AM
>From VB6.0 I am calling a main procedure in SQL 2000. If there is an error in the main procedure the error is returned to VB and I am able to capture it using the the VB error handling logic (on error goto MyErr...). I don't need to use the Connection object's Errors collection. However, i...more >>


DevelopmentNow Blog