Groups | Blog | Home


Archived Months
March 2003
April 2003
May 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
all groups > sql server (microsoft) > january 2005

Filter by week: 1 2 3 4 5

Web Reporting
Posted by Ed. at 1/31/2005 11:09:29 AM
Hello All, We have a long running application running an SQL Server backen and VB Front End. We are looking into creating an online reporting system which queries the database. We are just not sure about the requirements to make this happnen. I assume that the customer would need a window...more >>


Search Performance
Posted by Shabam at 1/30/2005 6:46:51 AM
I have a web application coded in dotnet and ms sql server. It is a multiuser system that lets members search for other members via their profile fields. It gets complicated in that it lets users search based on distance from a zip code, as well as degree of separation. However every time I ...more >>

Flattening SQL Query / Table
Posted by Paul Aspinall at 1/28/2005 11:32:32 PM
Hi I have 2 tables, which consist of: - 1 header table - 1 detail table The key is in both tables, but: Table 1, looks like Key fld,data, data, data Table 2, is: Key Fld, SubKey1, data Key Fld, SubKey2, data Key Fld, SubKey3, data I am looking for a quick way to flatten this structu...more >>

sp_executesql calling stored procedure
Posted by Chuck Jungmann at 1/28/2005 7:02:09 AM
I have an application where my html pages are using XMLHttpRequest to call SQL templates. The templates simply call various stored procedures. I have been using template commands like this: EXEC ('dbo.MyStoredProc ' + @param1 + ', ' + @param2) This works, but I recently read that using sp_...more >>

Bills of Materials using Celko's trees
Posted by Robert Schuldenfrei at 1/27/2005 3:07:08 PM
Dear NG, I am having problems constructing Bills of Materials (BOM) using examples from Joe Celko's book: Trees and Hierarchies in SQL for Smarties. I would like to use what Celko calls the "nested set model." My application works fine if I have but one product with a BOM, but I might hav...more >>

Joe Celko's examples fail
Posted by Robert Schuldenfrei at 1/27/2005 2:36:44 PM
Dear NG, I need to be able to process trees in SQL Server. I bought Joe Celko's book at the recomendation of the C# newsgroup. His book is mostly based on SQL-92. I am new to SQL (of any flavor) and I can not seem to get some very basic procedures to execute. In the following code I am ...more >>

Can CASE-SENSITIVE be changed
Posted by John at 1/27/2005 11:05:13 AM
We are using SQL 2000 Enterprise, and the database was originally set up as Case Sensitive, which sometimes causes us problems. Can this be changed after the inital creation of the database, or am I stuck? John ...more >>

Max Continous Dates
Posted by 4eyed at 1/26/2005 5:04:39 PM
I'm having trouble with a query to come up with the max continous date from a table. By continous i mean that there shouldn't be more than one month of a gap create table testdates(id int,d datetime) insert into testdates(id,d) values(1,'1/31/2004'); insert into testdates(id,d) values(5,'2...more >>



Cast Null in a Sum Numeric column in a group by
Posted by srussell705 at 1/26/2005 8:05:56 AM
I have a 1 : M for Assets : Repairs when I do; Select a.Name, a.OwnerID, Sum(r.RepairCost) as Repairs from Assets A left join Repairs R on a.AID = r.AID group by a.Name, a.OwnerID I can get NULL's in my Repair column. Fine, that is correct, but how can I show a 0 in numeric format to ...more >>

Duplicate Records
Posted by hpets3526 NO[at]SPAM yahoo.com at 1/25/2005 1:10:59 PM
This may be a silly question, but I am having problems with SQL Server 2000 inserting duplicate records. We are using 4 different dup checks in our C# code to prevent dups from entering our database and most of the time this works fine, but occasionally when the volume is high SQL Server will i...more >>

Creating multiple rows of months from a date range
Posted by larrybud2002 NO[at]SPAM yahoo.com at 1/24/2005 9:53:34 AM
Ok, we've got invoices... Invnum, date_start,_date_end,amount. Most invoices are for 1 month, so the data would be 100, 1/1/05, 1/1/05, 500 101, 2/1/05, 2/1/05, 700 But we can also have an invoice that covers 1 year... 102, 1/1/05, 12/1/05, 3600 The $3600 is the total invoice for the...more >>

Stored procedure batch job
Posted by Maziar Aflatoun at 1/23/2005 9:50:43 PM
Hi everyone, I have a stored procedure that takes 2 values (UserID and UserGroup) and it checks a table to see if they exist if not it adds them. How can I provide a list (maybe .txt) and do a batch job? Ex. 1324 2 4545 2 4324 5 4123 6 Thank you Maz. ...more >>

Sql Server 2000 Job
Posted by Maziar Aflatoun at 1/23/2005 2:02:40 PM
Hi everyone, I use the DTS (Data Transformation Services) to grab a copy of a remote database to my local (copy table + objects). How do I make that a job? So I can schedule it to do it automatically? Thank you Maz. ...more >>

Capacity of numeric field exceeded
Posted by George Morton at 1/22/2005 10:40:50 PM
What should I do with a numeric (9,0) field that has exceed nine digits? (Server uses five bytes to hold the nine digits, and to go to ten digits means I need to expand the storage to nine bytes). Is my understanding correct, and what should I do to get around this problem? Any advice is greatly...more >>

Stored procedure to update 2 tables
Posted by Maziar Aflatoun at 1/22/2005 9:18:29 PM
Hi, Can someone show me what the syntax is to query one table for all IDs in that table and updating 2 other tables based on IDs found in the first table? For example, I have table1 -> table1.tid Now I want to go through all ids found in table1 and for each issue 2 updates on 2 oth...more >>

Locking Records
Posted by Mike Curry at 1/22/2005 8:13:32 PM
How would I lock a record or a set of records for an UPDATE query set FIELD1 to "UNAVAILABLE". I want to insure users cannot modify or read the record while I am updating the record. Once I UPDATE the record, it should not show up in clients SELECT * WHERE FIELD1="AVAILABLE" query and I am wo...more >>

Stored procedure
Posted by Maziar Aflatoun at 1/22/2005 7:33:36 PM
Hi everyone, I'm relative new to store procedures and want to know how I can query a table for a record, get the UserID and use it in my INSERT statement? ALTER PROCEDURE AddUserToGroup ( @UserName [varchar](50), @UserGroupID [numeric] ) AS declare @UserID int @UserID = SEL...more >>

Stored procedures
Posted by Maziar Aflatoun at 1/22/2005 7:23:26 PM
Hi everyone, Can someone please tell me how I would be able to the following? Need an assignment here? SELECT UserID FROM Users WHERE (UserName=@UserName) INSERT INTO UsersandGroups (UserID, UserGroupID) VALUES ( @UserID, @UserGroupID_1); First I want to find the UserID for my UserNam...more >>

Linked Server: WHERE clause not being executed
Posted by BoB Teijema at 1/20/2005 10:48:11 AM
Hi all, One of our companies is having problems with a query on a linked server. They have two servers, serverA and serverB. On serverA they have set up a linked server to serverB. Query: select * from oas_company where code = 'TEST' If I look on serverB via Profiler the query is exec...more >>

Best approach - SQL queries
Posted by jbyy4u NO[at]SPAM yahoo.com at 1/20/2005 8:18:39 AM
I have a bunch of tables that contain certain pieces of data that relate to a master table. I want to be able to do one query to relate all of these various pieces of data back to the master table and am not sure the best approach. To better illustrate what I'm talking about let me give a li...more >>

Need SQL Query Help - Please
Posted by jbyy4u NO[at]SPAM yahoo.com at 1/19/2005 9:36:25 AM
I'm thinking this should be simple to do (but I'm still in the learning phase with SQL) and hope someone can help. I have two tables I'll call T1 and T2. The T1 to T2 relationship is a 1 to many. If I'm saying this right 1 row from T1 can match 1 or more records within T2. I want a query ...more >>

Etiquette when distributing software that can use SQL Server
Posted by mageos at 1/18/2005 10:39:51 PM
Good afternoon all, I am currently working on an installation for a software package we are developing. The software is database aware and can use either an access database for small installations or a client\server based installation for larger installation. I am working on the SQL serve...more >>

Checking for a column in SQLServer2000 table
Posted by Dino Buljubasic at 1/18/2005 8:20:07 PM
Hi, I am building a db install program. Can somebody help me with a problem please. I need to know how can I check if a column 'aColName' exists in a table programatically. Any help will be appreciated, Dino...more >>

Accessing named instance remotely
Posted by erithtotl NO[at]SPAM gmail.com at 1/18/2005 11:04:42 AM
I've got an instance of SQL server running on my website. I have port 1433 open and I can connect to it via enterprise manager across the internet just by using the domain name in the server name box. I recently installed SQL 2K5 beta 2 on the same box and gave it a different name. I should ...more >>

How to load a Unicode file into the database in the same order as the file order
Posted by at 1/18/2005 12:23:15 AM
The data file is a simple Unicode file with lines of text. BCP apparently doesn't guarantee this ordering, and neither does the import tool. I want to be able to load the data either sequentially or add line numbering to large Unicode file (1 million lines). I don't want to deal with another p...more >>

Which versions of Server does this work on?
Posted by TheHolmes at 1/17/2005 9:14:44 PM
I have 2 questions which I can't seem to get answered anywhere. #1: Does SQL Server 2000 Developer (8.0) or SQL Server 2000 Standard (7.0) run on Windows Small Business Server 2003 STANDARD edition? I know it come with Professional edition, but will my copy even run on STANDARD edition? For e...more >>

SQL for Dummies
Posted by BF at 1/16/2005 1:08:40 PM
And I mean real dummies! Can anyone explain, in 25 (small) words or less, what SQL is and if / why I should care. An icon has recently shown up on two of my computers (start bar tray) that says that SQL is not connected. I have no idea what I did to cause that. Thanks for any guidance here....more >>

custom transformation and broken FK
Posted by aamirghanchi NO[at]SPAM yahoo.com at 1/15/2005 3:04:44 PM
Hi, I need to do the following through Enterprise Manager (EM). I need to copy the structure of all the tables along with their PK, FK etc and need to copy the data of only select set of tables (not all of them). I tried doing this in EM but lost the relationship between tables in the target ...more >>

Simple Query Question
Posted by Roy at 1/14/2005 12:40:36 PM
Ok. Call me dumb, but why is this occurring. Table firstv has 303,000 records, table lla has 10,000 records. When I run this query though: SELECT IsNull(lla.voy, '') as voy, IsNull(lla.poe, '') as poe, IsNull(firstv.ocean, '') as ocean, IsNull(firstv.car, '') as car, IsNull(firstv.equipment,...more >>

Preventing client connections when restoring database
Posted by andrew NO[at]SPAM duncanhcmc.com at 1/13/2005 1:39:55 AM
Hi, I'm hoping this is something basic and I'm being obtuse. When restoring a database it must not be in use. Is there a way to close connections and prevent new ones being made? My problem was that users were constantly trying to access the system even though we'd alerted everyone that the...more >>

How to recreate/restore the database from the data and log files
Posted by karenmiddleol NO[at]SPAM yahoo.com at 1/12/2005 3:58:30 AM
My development system hard disk crashed and I have lost the Operating system and the SQL executables and the system cannot be salvaged. However at the time of the crash the server was not running and the log files and the data files of the database were on another hard disk. I have managed to ...more >>

Alternative to nullif
Posted by shop NO[at]SPAM pacifictabla.com at 1/11/2005 6:52:59 PM
Hi: I'm using the following code to set Corp_AvgTalkTime to null if there is a division by zero (see nullif below). I might want to set it to zero, or in some cases I might want to replace it with '00:00:00'. Right now I go back over the data and set it using another update, but I would like ...more >>

Yukon Beta 3 Expiration Date
Posted by cyndi_r2000 NO[at]SPAM yahoo.com at 1/11/2005 3:05:15 PM
Hi, Does anyone know the expiration date on Yukon Beta 3? Thanks, Cyndi ...more >>

Silly Question? Exists(SQL Server 2003)?
Posted by kadmon NO[at]SPAM gmail.com at 1/10/2005 3:36:23 AM
Hello all, Despite having a good trawl I am finding it difficult to establish whether this product exists or not - I realise that sounds foolish but I'm genuinely confused. I can find dozens of articles discussing it from before 2003 and various announcements about Yukon being postponed/delay...more >>

How to check in the registry if SQLServer is installed.
Posted by anandsagar NO[at]SPAM gmail.com at 1/10/2005 1:25:15 AM
Iam doing an installer for my .net application. The app uses an SQL Server database. During the installation process, I have to check if SQL Server 2000 is installed in the target machine. For this, I wish to check in the registry (with code) to find out if SqlServer is installed. What entry...more >>

conflicting object names in sql server 2000
Posted by John at 1/8/2005 4:06:00 PM
Hi, I can't seem to solve this problem. I hope someone can help. I have a table which is owned by dbo called xxx. I also have a user define function also called xxx but owned by a different user. Everything works fine on the local database. From query analyzer if I type in select * fr...more >>

Stored Procedure/UDF help
Posted by Steve at 1/7/2005 9:20:04 AM
Hi Guys, I'm trying to write a stored procedure which gets a result set back and stores it to a temporary table. Once this is done, there are some extra columns for each row that will need to be added from another relating result set which is generated from a under-defined function. The p...more >>

ARITHABORT OFF Not working in DTS
Posted by Kayda at 1/5/2005 10:06:20 PM
Hi: I have a script below, when I run it on its own, it is great, but when I run it as an "Execute SQL" task as part of a DTS package, the step fails with a "division by zero" error. Shouldn't it ignore this error due to setting ANSI_WARNINGS and ARITHABORT both to OFF? I get the error in Quer...more >>

Transaction Log increasing
Posted by Florian at 1/5/2005 5:57:05 PM
Hi, We have a SQL database that is constantly being written to, that is every other seconds a few rows are added to a couple of main tables. The database currently has one data file and one log file. I set the initial data file size to 2Gb, about that size I anticipate the database to be...more >>

Converting seconds to HHMMSS
Posted by Kayda at 1/5/2005 10:19:12 AM
Hi there: I have a table that has several different fields with time values in seconds (datatype int). Beside every such column is another varchar column that is meant to represent the same number in HHMMSS. I want to avoid a cursor, but doing a straight UPDATE to me doesn't seem possible beca...more >>

Birthday List based on month and day
Posted by Kim at 1/3/2005 12:57:08 PM
Hello, I am writing a stored procedure that should generate a list of customers that have a birthday three days before today and 14 days after. The way the sproc is currently written has some limitations I would like to change. First, it doesn't accurately capture the window near the change...more >>

sql server & crystal reports
Posted by someguy at 1/1/2005 4:51:02 AM
Hi, I'm semi-new to crystal reports & sql server and what i want is to extract data from a sql server file. I've been able to connect to sql server directly and get the info. i need but is there a way to just open the data file (in crystal reports) without making a server connection? ...more >>


DevelopmentNow Blog