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 monday october 15

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 rounded perventages to 100
Posted by Mikael at 10/15/2007 10:22:08 PM
Hi I have percentages that sums to 100%, but the business people wants to show the percentages with one decimal only. I understand why some numbers are rounded up, others down and why they don’t always add up to 100% afterwards. Does anyone have any good suggestions for a rounding algorithm ...more >>


Table design for logging application
Posted by Koger at 10/15/2007 10:16:55 PM
Hello I have to log some data and I'm trying to figure out the best way to store the data. As the database I will be using MSSQL express and disk space used by the database is a big concern of mine. The application is made in .Net. Here is a bit info about the data I will be logging: 1) Da...more >>

How to cancel long query
Posted by Ron J at 10/15/2007 5:36:09 PM
In a web page, the user can start a long query on SQL server. How can I stop the query if its taking too long? ...more >>

T-SQL instead of Cursor
Posted by Pasha at 10/15/2007 5:24:01 PM
Hi All, I have a cursor that compares rows and applies business rules (in cursor), but it is very slow, because of large number of rows. What would be the best approach for this scenario (row-by-row processing)? GO /****** Object: StoredProcedure [dbo].[usp_sessionization] Script Dat...more >>

Nesting an IF in the ELSE of a WHEN
Posted by jonefer at 10/15/2007 5:07:00 PM
I have a Case Statement that almost works. I have marked the troublesome pseudo portion with [[ around my desired outcome ]] CASE WHEN EXISTS (SELECT * FROM tbl_DelSup WHERE DelID = purchasing_reg.tbl_delega...more >>

Translation solutions
Posted by Paddy at 10/15/2007 3:33:24 PM
I have an application which needs to work in French & English. Now the actual .Net application handles this in the code, but I need to handle it as I create the data warehouse. All column headings need to be in the language of choice. Data is not affected. Any thought on how I could do this?...more >>

hi all urgent help with subquery in sql server
Posted by Dhananjay at 10/15/2007 3:03:59 PM
hi all can anybody tell me where i am doing mistake in this query :- SELECT logUpdate.author, logUpdate.dateAdded, logUpdate.dateEdited, logUpdate.effectiveDate = select logUpdate.effectiveDate FROM logUpdate WHERE (effectiveDate BETWEEN CONVERT(DATETIME, '" & txtFromEffective.Text & ...more >>

Create index on table variable
Posted by Tim Kelley at 10/15/2007 12:56:09 PM
Is it possible to create an index on a table type variable? If so, is it limited to Primary or Unique type? The column I need an index on would not contain unique data. Thanks. ...more >>



How to write a query statement that does this?
Posted by Nestor at 10/15/2007 11:55:16 AM
Hi all, I've been trying to figure out if there's a way to write a set based query statement that does this Compare record 1 against record 2 on a criteria and based on these 2 values Example: Key Column1 Column2 a test 1 a test2 2 b test3 3 I want to write a query ...more >>

Need help with the SELECT statement
Posted by Lam Nguyen at 10/15/2007 11:01:01 AM
Need help with the SELECT statement Hi all, I am get stuck with the queries below. Please see the requirements describe below and help me correct the sequel statements below to return corrct results set. As always, thank you for your help. IF OBJECT_ID('Tempdb.dbo.#DeviceStatus',...more >>

indexing
Posted by at 10/15/2007 10:19:46 AM
should I create 4 individual indexes on a table or 1 composite index. and the table is Temp Table Thanks This is my temp table: #Temp col1, col2, col3, col4 my query is something like this select xxxx >From #Temp A INNER JOIN (select xxx. FROM #Temp Group ...more >>

calling stored procedures inside stored procedures
Posted by rodchar at 10/15/2007 9:41:01 AM
hey all, .... AS BEGIN -- Insert statements for procedure here EXEC [dbo].[usp_myproc] @EmployeeID = @employeeId, @StartDate = @startDate is it ok to have @EmployeeID = @employeeId differ by only casing? or should i name the local variable something obviously different? thanks, ro...more >>

TSQL and Access qyery problem
Posted by Ed Dror at 10/15/2007 9:29:40 AM
Hi there, I'm using Access 2007 and SQL Server 2005 What is the equivalent code in TSQL to the Access query look like this SELECT Customers.CustomerID, Customers.CompanyName FROM Customers WHERE (((Customers.CompanyName)=[What Company])) OR (((Customers.CompanyName) Like [What Company] ...more >>

constants in sql 2005
Posted by rodchar at 10/15/2007 9:27:00 AM
hey all, how do you create a constant in a sql server 2005 stored proc? thanks, rodchar...more >>

Parse and Merge two fields
Posted by JR at 10/15/2007 9:25:46 AM
I have kind of a complex situation and wondering if this could be scripted: Contains two columns of data, "field1" and "field2" Sample data: Field1: joe|sam|pete|mike Field2: Manager|Team Lead|Worker Ant|Worker Ant So you can see a field1 contains multiple names, and Field2 contains the...more >>

vacation accruals design
Posted by rodchar at 10/15/2007 9:13:00 AM
hey all, i was task with tracking vacation hours for each employee in a company. the way i did it was i calculated the accruals and hours taken on the fly in a stored procedure and it worked just fine. but then some changes came along and the solution discovered was to save the totals in the ...more >>

Multi-field result assignment to a variable.
Posted by Chris C at 10/15/2007 9:07:02 AM
Hey. I'm trying to take the following kind of result (a grouping aggregation): Field, Count field1, 10 field2, 943 field3, 238 etc... ....And assign this to a variable for use later in a print statement. So, something like select @group_result = (yadda yadda...) I have a feeling I'm...more >>

2 week window
Posted by Joe at 10/15/2007 9:03:47 AM
I have the following table (yes it at the moment is using non-valid naming conventions) where I'm looking for procedure code can be ('22558','22612','22630'). If it finds this code; using the DOS (date of service); I want it to give me a list of all rows 1 week behind and 1 week ahead. C...more >>

SQl administration from my client Computer - beginners learning cu
Posted by Noncentz303 at 10/15/2007 9:03:02 AM
Hello all, I am fairly new to the whole SQL enviorment as a whole, it was kind of pushed apon me as the IT guy of course. Currently I have a couple of databases that I have to create tables, views and triggers for but I would like to write them from say my laptop. I heard there was a manag...more >>

Trace Flag Deadlock errorlog data
Posted by tpullen NO[at]SPAM rm.com at 10/15/2007 7:48:44 AM
I am trying to troubleshoot deadlocks in SQL Server 2000. I have the relevant trace flags enabled, and I am getting the dealock info in the error log. I have nested SPs, one may call many others, which may in turn call others. My question is, in the deadlock info, I have a Line Number. Does this...more >>

TimeOut Expired
Posted by LUIS at 10/15/2007 6:28:00 AM
I am using VB6 with SQL 2000. I made a query and tested it in SQL Analyzer, takes about 30 seconds but works very well. I rewrite it as an Stored Procedured and use it in my VB App, but it does not finished, I supposed, and send me an ERROR: TimeOut Expired. What can I do? It is possible to in...more >>

Script to create sql to update one db structure to another?
Posted by bz at 10/15/2007 4:54:37 AM
Hi, In other database environments, (FoxPro and Access in particularily), I created code that allow me to 1. create the database at first run, so I don't have to deploy the application with a ready made copy of the database. This also allowed me to automate the build provcess of the applica...more >>

dynamic xpath in XQUERY exist() function
Posted by Schwartzenberg at 10/15/2007 4:10:00 AM
I’m using SQL Server 2005, and this concerns making the xpath part of the XQUERY exist() function dynamic. I've combed the net and there (is yet) nothing on this (as far as i could tell). I'm using the stored procedure below to make a Selection. In the Where clause i use an XQUERY exist...more >>

Force shrink on tempdb
Posted by Bob at 10/15/2007 2:28:01 AM
Getting this error when trying to shrink tempdb: Page 1:123 could not be moved because it is a work table page Is there any way to: a) find out what this table is ( eg DBCC PAGE examples ? ) b) find out which process created it / is using it c) move the table to the start of the tempdb file...more >>

Allowing Local and Remote connections breaks SQL queries
Posted by cw1972 at 10/15/2007 2:18:22 AM
hello I have a remote server in a datacentre that hosts our website (www.sheffcare.co.uk) and we have an online backup service that tries to backup out \inetpub\www and SQL files. The thing is, that everytime the the backup runs, the website SQL queries break, with the following errors: ...more >>

Address issues in SQL
Posted by Harold Moorhead at 10/15/2007 12:00:00 AM
Hi, I have an issue with address information. I need to be able to take one column containing City, State, and Zip and split them up into their own columns. My current queries use the comma after city as a reference point to select left as City, select substring 2, +2 as State and select l...more >>

View first paragraph
Posted by Dooza at 10/15/2007 12:00:00 AM
Hi there, I am in the process of creating an RSS news feed from our website. The news items are all in HTML stored in a table column of type Text. I chose text as it can take the most amount of text. The news items could be really large with all the HTML formatting, but if I am using the wr...more >>

add administrator user
Posted by JFB at 10/15/2007 12:00:00 AM
Hi All, I got a new administrator user, he is part of my admin domamin MYDOMAIN\userName. I included this user in my login sql server 2005 and give sysadmin permissions. He can't connect to the sql server... What is the problem? Tks JFB ...more >>

get date question
Posted by Mike at 10/15/2007 12:00:00 AM
I have a column in my table that stores a date the job was run (IE: = 10/15/007). How can I determine 10 days prior to that date? So for example, I need to get my data column and 10 days back and remove = them from the table. So I need to get everything that equals today minus 10 days and re...more >>

timeout problems on large table
Posted by Smokey Grindel at 10/15/2007 12:00:00 AM
I have a very large table that stores what is now Image fields... it's about 5GB in size and I want to change it to a varbinary(max) for sql server 2005 since image has been depriciated... but when I try to alter the table it comes back with a timeout error because of how many records are in i...more >>

Scheduled queries, duplicated/overlapping results
Posted by Claire at 10/15/2007 12:00:00 AM
Hi, I'm sorry but I'm not quite sure how to describe this problem. I'm running a series of tasks from a service application at a time interval that may be hourly/daily etc. I don't want to force a schedule to suit my software/ease of processing. The tasks consist of sending automated emails/...more >>


DevelopmentNow Blog