Archived Months
January 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
all groups > sql server (alternate) > december 2004 > threads for december 8 - 14, 2004

Filter by week: 1 2 3 4 5

Runtime Error: [Microsoft][ODBC SQL Server Driver]Invalid time format
Posted by Tim Groulx at 12/14/2004 11:21:36 PM
Hello All, I am getting the following error when attemping to open a table in SQL2kSP3a. ________________________________________ SQL Server Enterprise Manager Database Server: Microsoft SQL Server Version: 08.00.0760 Runtime Error: [Microsoft][ODBC SQL Server Driver]Invalid time format...more >>


password in a Table
Posted by Anonymous at 12/14/2004 9:34:49 AM
Hi I have a "password" field in a Table. How should I define it, that its output is showed like "******"? Thanks!...more >>

Distributed Transaction takes far too long
Posted by Jo Siffert at 12/14/2004 8:56:24 AM
Hi all, I would like to perform an INSERT INTO LINKEDSVR.dbo.xyz.abc SELECT ... FROM dbo.dfg where LINKEDSVR is a linked server on another machine. Both servers are running SQLServer 2000 and have the DTC running. When I run this batch from QueryAnalyzer without explicitly using t...more >>

Pratical size of a SQL Server database
Posted by josil20 NO[at]SPAM gmail.com at 12/14/2004 7:49:44 AM
Hi, We are in the process of selecting a database for a data warehouse type application. I want to get a feel for how big can a SQL Server database get. As per Microsoft, it can be multiple terabytes. Can you tell me What is the biggest size SQL server database you manage? (I understand big i...more >>

Adding DEFAULT columns
Posted by Paul at 12/14/2004 3:46:57 AM
Hi I have a table that currently has 466 columns and about 700,000 records. Adding a new DEFAULT column to this table takes a long time. It it a lot faster to recreate the table with the new columns and then copy all of the data across. As far as I am aware when you add a DEFAULT column t...more >>

DTS file name to include System Date/Time
Posted by steven virnig at 12/13/2004 9:42:44 PM
We have an application group that wants to pull date from SQL Server and = write it to text file on the server. They want the file format to be = 12100_YYYMMDDHHMM.fr1 for one set of data, 12100_YYYMMDDHHMM.fr2 for a = second set...and so on. The '12100' is fixed, but the rest of the file = na...more >>

database recovery
Posted by WH at 12/13/2004 9:05:08 PM
Hi, I'm no where close to a SQL Server expert but we're using it as a back end to another application. I lost a PC that had MS SQL Server 2000. I was able to recover the .MDF and ..LDF files but nothing else. How can I restore these files to another SQL Server installation on another PC. W...more >>

Help with NOT EXISTS query
Posted by RDRaider at 12/13/2004 8:17:45 PM
Newbie here...looking for help with a NOT EXISTS query or suggestions for a better method. I have 2 linked tables: CUSTOMERS and ADDRESSES common fields are CUS_NO and ADR_CD I need to find records where an address code (ADR_CD) entered into CUSTOMERS does not have that same ADR_CD existing ...more >>



Cursors and dynamic SQL
Posted by Joško_Šugar at 12/13/2004 5:34:53 PM
On this site: http://www.sommarskog.se/dynamic_sql.html I have found an example how to use cursor with dynamic SQL: DECLARE @my_cur CURSOR EXEC sp_executesql N'SET @my_cur = CURSOR FOR SELECT name FROM dbo.sysobjects; OPEN @my_cur', N'@my_cur cursor OUTPUT', @my_cur OUTPU...more >>

SQL crosstab results in numbers on the 'diagonal'
Posted by mehl NO[at]SPAM cyvest.com at 12/13/2004 5:34:47 PM
Hello -- We have annual values for several 'MeasName': Capital expenditure increment Growth rate Subscribers The table has these fields: Year MeasName MeasValue We want the result of the crosstab to look like: MeasName 2005 2006 2007 2008 2009 ------------------...more >>

Query for percentage of a SUM
Posted by Ben at 12/13/2004 5:16:39 PM
I am trying to figure out the syntax for a query that will essentially give me the Percentage each of my areas contributes to the Whole. I know this can be achieved by multiple queries but I would like to keep it intact as one single query if possible. For Example I have the following data se...more >>

sorting problem with linked server
Posted by js at 12/13/2004 4:16:14 PM
I am using SQL Server 2000. I am getting the following error when executing the following query. The query joins a view [Server2].dbx.dbo.vwreports that resides on a linked server. I can sort on fields on D table or R view individually, but some fields take a long time to sort even they are on...more >>

Running out of Sql Connections
Posted by hananiel NO[at]SPAM yahoo.com at 12/13/2004 3:47:28 PM
Hello: We have a a two tier application connecting to sql server through remoting. The business objects are single call objects. We are opening and closing connections using ADO.NET command object. All "ExecuteNonQuery" are closed in finally blocks. We are running out of sql connections because...more >>

Instead of Delete in replication
Posted by cfxchange at 12/13/2004 2:36:31 PM
I am looking into work-arounds for what seems to be a flaw, or "undocumented feature" of SQL Server replication and Instead of Delete triggers not playing together. It seems that if you want to use replication then you cannot use Instead Of triggers as it prohibits the replication triggers from...more >>

Possible DTS File Import Bug
Posted by NickName at 12/13/2004 1:05:03 PM
Env: SQL Server 2000 on in WIN NT 5.x Job: import mutiple flat files into several tables daily. Catch: one or two of the several flat files might be empty. First thought/test: Use [first row as fields] option for the import process. Problem, DTS can't complete (as a package). As an alterna...more >>

Merge two rows in the same table
Posted by laurenq uantrell at 12/13/2004 1:01:51 PM
I want to create a stored procedure that will merge columns from two rows that contain duplicated contacts. I have can easily identify the duplicates and extract the UniqueIDs as parameters, but I can't figure out how to construct the actual update SQL. @KeeperID int, @DupeID int Update...more >>

Declare Variable Dynamically
Posted by tim.pascoe NO[at]SPAM cciw.ca at 12/13/2004 12:52:34 PM
I'm attempting to modify some Crosstab generating code, and I need some advice/examples. Currently, the code uses a single string variable to store the dynamically generated query (www.johnmacintyre.ca). The problem is that I am trying to pivot biological taxonomy information, and may end up ...more >>

Fastest method to copy a file across network?
Posted by louis n at 12/13/2004 12:16:50 PM
I work with databases and some of my backup files are 30-100 gigs in size. I currently use the FastCopy utility to copy files from one server to another. (This is needed when I need to transfer a DB to a different server). FastCopy says its 30 to 50% faster than Windows file copy. I read som...more >>

SQL Server 2000 service not running in local machine
Posted by ausgoodman NO[at]SPAM hotmail.com at 12/12/2004 8:24:18 PM
Hi all, After merged two partitions into one (C:\ and D:\ into one C:\) by using Partition Magic, I can't start SQL Server 2000 which was previously installed in both C:\Program Files\Microsoft SQL Server\80 and D:\Program Files\Microsoft SQL Server\MSSQL The original files in D:\ (every th...more >>

simple explanation please
Posted by Jay at 12/12/2004 2:30:39 PM
PREDICATES Used as a clause. A. What does PREDICATES mean? B. What does it mean when used in a where clause? I checked BOL (Glossary) but get no explanation there. Thanks Jay ...more >>

Updating Column Data on the Fly?
Posted by erikthenomad NO[at]SPAM hotmail.com at 12/12/2004 11:45:40 AM
Hey...newbie question: I've got three columns in my database, the third of which is blank right now, and I need it to equal the value of column one minus column two. While I can accomplish this in the .aspx page with a subroutine, I want to do it in SQL Server so I can simply read the data in ...more >>

Remote server connection
Posted by Mark Fisher at 12/11/2004 5:56:11 PM
We have a database on a shared SQL Server stored on our ISP's server. I can connect to this via Enterprise Manager from our office, but when I try the same from Enterprise Manager on my PC at home I get the following message: A connection could not be established to MFSERVER. Reason: SQL ...more >>

Calling sp_helptext from ASPNET
Posted by Bogdan Rechi at 12/10/2004 5:57:31 PM
Hi, I am executing a call to "sp_helptext" from a web service, in order to obtain the text of a stored procedure. The call itself seems to be ok but eventually it throws an exception saying that the specified object does not exist in the database - which is a false statement, i've checked care...more >>

create relationship with tables in a linked server
Posted by js at 12/10/2004 4:36:33 PM
I need to create a relationship between a local table and tables on a linked server. I used the design table wizard and selected the relationship property wizard. In the reslationship property wizard, the tables that I need to get the keys from in the linked server do not show up. Is there a...more >>

Optimal configuration for report generator
Posted by Gary at 12/10/2004 3:05:29 PM
I am working with a report generator that is based on SQL Server 2000 and uses ASP as the UI. Basically we have a set of reports that end users can execute through a web browser. In general the model works fine, but we are running into some scaling issues. What I'm trying to determine is, what...more >>

Trigger performance
Posted by Scott CM at 12/10/2004 2:55:05 PM
I have a multi-part question regarding trigger performance. First of all, is there performance gain from issuing the following within a trigger: SELECT PrimaryKeyColumn FROM INSERTED opposed to: SELECT * FROM INSERTED Secondly, what is the optimum way to determine which action fired a...more >>

Help with a Join - join only first or max?
Posted by csk at 12/10/2004 12:24:16 PM
Hopefully someone will have some ideas on how to do this. I'm officially stumped. I have two entities to join. Simplified descriptions follow: The first has names and addresses (vwPersonAddress) keyed by PersonID (it is actually a view on two tables, but it works exactly as I want it to...more >>

SP3a and strong password problem
Posted by John Morgan at 12/10/2004 10:19:19 AM
I urgently need tom use SP3a upgrade the instance of SQLServer200 MSDE runing on my local machine but I am having problems in doing so. My first problem is that when I start the set up procedure I get the message "A strong SA password is required for security reasons. Please use SAPWD switch...more >>

Cannot connect to Server through Visual Studio .NET and Query Analyzer
Posted by JM at 12/10/2004 8:36:54 AM
Good day. I was able to connect to a database server using SQL Server Enterprise Manager. The Server name specified on the tree is JOMARGON(Windows NT). But no server was detected using either Visual Studio .NET and SQL Server's query analyzer. I highlighted one database (master) on the SQL Se...more >>

Need help with Avg and decimal
Posted by pkruti NO[at]SPAM hotmail.com at 12/10/2004 8:23:52 AM
i am having trouble the with the line below: SELECT AVG(CAST(RATE1 AS Decimal(9, 2))) AS Expr1 i am trying to do an average on the column "rate1" and want only 2 decimal points but the syntax i wrote doesn't do it. is there something i am missing or doing wrong? when i run the above s...more >>

Need help with count
Posted by kjc at 12/10/2004 6:57:58 AM
Is it possible to obtain a count of the number of rows that would be returned based on the following query. select tableA.*, tableB.fieldA, tableB.fieldB, tableB.fieldC, tableC.fieldA, tableD.fieldA, tableD.fieldB from tabl...more >>

Selecting records where multiple foreign keys are a certain value
Posted by Robert at 12/9/2004 10:53:05 PM
Hi All, I'm trying to solve this for a few days now and I just can't figure it out... I have three tables set up, I'll simplify them for this question: Table 1: HOTELS Columns: HOTEL_ID, HOTEL_NAME Exmple row: 123 || 'Hotel X' Table 2: SERVICES Columns: SERVICE_ID, SERVICE_NAME Exa...more >>

SQL Mail does not send unless Outlook Open!!!
Posted by Auday Alwash at 12/9/2004 10:44:03 PM
Hi, We have a SQL 2000 server (Win 2003 server) latest service packs...connected to Exchange 2000. SQL Mail was set up ages ago and was working fine until 2 weeks ago when I stopped receiving alerts. The Mail session is started and seems fine but when I do a xp_sendmail to my email address ...more >>

Continuation of long SQL statement syntax
Posted by joseph.jasinski NO[at]SPAM quinnipiac.edu at 12/9/2004 3:40:50 PM
Hi All - I am updating four values. What is the proper syntax to have the following 4 update statements as one statement? set objRec = objDB.Execute("Update orientform set session = '" & strSession & "' where id = '" & strid & "'") set objRec = objDB.Execute("Update orientform set fname = '...more >>

Query Analyzer vs Isqlw different Format
Posted by Not4u at 12/9/2004 1:12:32 PM
Hello I have a SQL 2000 server, the server setting is default language : French and all Collation names in French If i launch the 'Query Analyzer' from the SQL Entreprise Manager on my database, and run a T-SQL my dates are in English. If i do a : DBCC USEROPTIONS, my results are language...more >>

Incorrect syntax near the keyword 'Declare'.
Posted by Jeff Magouirk at 12/9/2004 1:04:08 PM
Dear Group, I am trying to create a view and keep getting the Incorrect syntax near the keyword 'Declare'" error. Here is the code I am writing. Create view fixed_airs (sid, fad_a2, fad_a3) as Declare @sid int, @fad_a2 int, @fad_a3 int sel...more >>

dtsrun to start a package - cannot find xp_cmdshell
Posted by Maddman at 12/9/2004 1:03:21 PM
Newbie here. In my database I'm needing to automate some data imports. I have the import set up as a DTS package and it works wonderfully. But I'm having trouble kicking it off as a stored procedure, or even from the Query Analyzer. I used dtsrunui to get a proper connection string, but wh...more >>

Update only one record
Posted by Allan at 12/9/2004 12:45:47 PM
Hello, update table set column = x where b is null I have the above update statement in a transact sql file. I would like to change it so that it will only update 1 of the records in the table, even if there are many records where b is null.... Any ideas would be great. Many thanks, A...more >>

Exporting sql table into csv format retaining the column names
Posted by noor at 12/9/2004 12:00:47 PM
Hi I have been working since 2 days to device a method to export sql table into csv format. I have tried using bcp with format option to keep the column names but I'm unable to transfer the file with column names. and also I'm having problems on columns having decimal data. Can any one suggest ...more >>

LIKE N'@numericvarhere%'
Posted by ujjc001 NO[at]SPAM gmail.com at 12/9/2004 11:28:08 AM
How can I get a stored procedure to accpet this? LIKE N'@numericvarhere%' I.E. list of numbers, I want any one starting with 382 and they can be any length 10-20 long. (BTW LIKE N'382%' works in querey, needs to work w/ a variable and in stored proc) Thanks! Jeff ...more >>

returning string length
Posted by William Kossack at 12/9/2004 11:03:07 AM
I need to write a query that tells me which string values are empty or blank in a table. Is it possible to return the length of the string contained in character field? ...more >>

Fatal System Error
Posted by lbillson NO[at]SPAM netexperts.co.uk at 12/9/2004 9:16:40 AM
Whats happening: Error#: 40002 Error Item: 01000: [Microsoft...][ODBC...][SQL...]The Statement has been terminated. > GETID 'INSERT INTO Table(Column1, Column2, Column 3, Column4, Column5, Column6) VALUES ("","Value1","Value2","Value3","Value4","Value5")' Error Message: 01000: Microsoft....more >>

Connecting sql 2000 sp3 with asp
Posted by Wonder at 12/9/2004 8:59:09 AM
I created a new SQL database using SQL 2000 SP3 on a Windows 2003 server. Now when my wed publisher changes his codes in ASP to point to my new server and SQL database we are getting the message this page can not be displayed when clicking on the web link. The old SQL database was created with...more >>

specify a non-linear order by
Posted by Alpine7 at 12/9/2004 7:53:16 AM
How can I order the results of my query in non-linear fasion. I have a field with these values: Reg S, 144A, US and want to order my results by US, 144A, Reg S. I would prefer not to create another field in the table if possible. ...more >>

Marking a table as a System Table
Posted by Damien at 12/9/2004 7:49:52 AM
Okay, most peoples answer to this may be "Gaaah. Why would you do this?", or the like, but here's the question anyway: Are there any stability issues if I mark one of my user tables as a system table (by switching xtype in sysobjects from 'S' to 'U')? I'm not doing this as "a cleved bit of s...more >>

Recover A Database From Another Hard Disk With A Corrupted Windows 2000 Installation.
Posted by Nate at 12/8/2004 10:31:33 PM
Hello, I am trying to recover a SQL Server 7 database from another hard disk drive that has a corrupted Windows 2000 Advanced Server installation. I am not able to repair the corrupted Windows 2000 Advanced Server installation but the file system is intact. I have installed a new copy of SQL ...more >>

Transaction - Newbie Question
Posted by Prodigy at 12/8/2004 9:28:39 PM
Im new to SQL Server and have a problem. I places many insert commands between BEGIN TRAN and COMMIT TRAN and expect all or none inserts to work. However, if 1 fails the rest work. Why is this? and how do i get round this? Thanks ...more >>

Query to group sequential items
Posted by cyrus.kapadia NO[at]SPAM us.pm.com at 12/8/2004 7:23:57 PM
Let's say I have the following table: entry product quality 1 A 80 2 A 70 3 A 80 4 B 60 5 B 90 6 C 80 7 D 80 8 A 50 9 C 70 I'm looking ...more >>

Connect to remote server
Posted by Mark Fisher at 12/8/2004 6:48:01 PM
From Enterprise Manager on my PC, how do I connect to a remote server over the internet - I have the IP address, User Name and Password. Thanks ...more >>

Newbie: analytical vs. production database?
Posted by david9000s NO[at]SPAM earthlink.net at 12/8/2004 6:34:54 PM
Hi all, Currently I administer an Access database used as an order-taking, PO and invoice generator, and sales reporting database. We are a retailer taking orders over the phone, and the db has been developed by a collection of students and self-taught developers over the past several years...more >>

Filtering duplicate ID's?
Posted by J Belly at 12/8/2004 4:14:17 PM
Hi, all: I'm having trouble with something that probably has a simple solution. I have linking tables that can list a particular MemberID multiple times. Is there a way to run a query so that a specific ID will show up once? Here is an example of the tables I've set up -- MemberTabl...more >>

Upgrade Client connectiviity tools on client machines
Posted by eddiekwang NO[at]SPAM hotmail.com at 12/8/2004 3:28:56 PM
Hello, Is it necessary to upgrade the Client Connectivity Tools on all client machines after the SQL Server database server is upgraded from Version 7.0 to 2000? Thank you in advance! Eddy ...more >>

Repost : Using forms with Sql Server
Posted by Info at 12/8/2004 3:09:14 PM
Howdy, Does anyone know of any packages that you can create a form and via a ODBC connection save the data to a table ? If it is possible to compile the form as I don't want clients to change the forms ? Any idea/thoughts would be most welcome ? Regards Andrew...more >>

staff ratios
Posted by dalst36 at 12/8/2004 2:13:10 PM
i am doing some statistics for staff ratios and have had no luck finding any DBA's per sql server or DBA's per sql databases. If anyone has any numbers, i would greatly appreciate. Thanks! ...more >>

Query in bat file?
Posted by blueghost73 NO[at]SPAM yahoo.com at 12/8/2004 1:55:21 PM
Ok, I know this is a stupid newbie question, but I'm a stupid newbie, so it fits. I've got a query that writes a basic report, and I need to be able to give it to a user who doesn't even know how to spell SQL to run. Basically, I want her to be able to double click on a bat file on her comput...more >>

Triggers Won't Script
Posted by tim.pascoe NO[at]SPAM cciw.ca at 12/8/2004 1:05:57 PM
I'm trying to generate scrips for a database, and everything so far has worked fine, except for the triggers. When I try and script existing triggers, all I get is a blank file - no SQL script. I tried single files for each object, all in one file, triggers only, the entire database. I can't fig...more >>

Concurrency (recap and idea).....
Posted by Robin Tucker at 12/8/2004 10:35:06 AM
With respect to my (now not so recent) thread on Concurrency, I would like to run my idea past you gurus to see if its a runner. First, a brief recap: I have a single user system (one user, one copy of the software, one copy of MSDE, one machine) that I wish to convert into a multi-user/sing...more >>

Simple way of telling if I'm using MSDE or full SQL Server?
Posted by Robin Tucker at 12/8/2004 10:28:31 AM
I'm looking for a simple way of telling (inside a stored procedure) if I'm currently using MSDE or a full SQL server. Ideally, there is some pre-defined environment variable that won't cause me too much overhead. The reason I'm doing this is because my system "rolls over" databases when it...more >>

Primary Key / Referntial Integrity Question
Posted by Rodney King at 12/8/2004 9:46:37 AM
Hi, I am supporting an application that was converted from ACCESS to SQL Server 2000. My question focuses on two particuliar tables. The parent table has 14000 rows while child table has over 9 million rows. Referential integrity is set up between the two tables. The parent table has a com...more >>

SQL Server Agent overhead / sysperfinfo
Posted by utefan001 NO[at]SPAM gmail.com at 12/8/2004 9:24:03 AM
I would like to capture about 20 rows from the sysperfinfo table every 30 secs on a production server. I am thinking of ways I can reduce the disk (not network) I/O overhead of this process. Instead of reading the table from a local SQL Agent job and writing to a local table, I am wondering if...more >>

Different execution plans - same data, same server
Posted by james NO[at]SPAM jimw.co.uk at 12/8/2004 4:31:46 AM
Hi there - hoping someone can help me here! I have a database that has been underperforming on a number of queries recently - in a test environment they take only a few seconds, but on the live data they take up to a minute or so to run. This is using the same data. Every evening a copy of ...more >>

Update clustered column in place?
Posted by Danny at 12/8/2004 4:08:21 AM
Is there any way to update a column in a clustered index without incurring the cost of reordering. Example: Create table TableX ( Col1 int, Col2 smalldatetime, Col3 varchar(10)) go create clustered indext ix_test on tableX (Col2, Col1) go update TableX set Col2 = '2004-12-07' -- Yes ...more >>

Consuming results sets in a calling SQL procedure
Posted by p_le_sueur_1 NO[at]SPAM hotmail.com at 12/8/2004 2:06:08 AM
Dear All, This is a query surrounding a problem I encountered yesterday. In SQL Server, it is possible to write a procedure that has one or more select statements in it. The results from these select statements will all be individually returned to SQL Query Analyser where they can be vi...more >>

Query dbowner
Posted by paulwragg2323 NO[at]SPAM hotmail.com at 12/8/2004 1:40:20 AM
Hi We have a script that allows customers to change the users of the database including the database owner. This script can be run at any time. However, sometimes (and it really is only sometimes!) when the following statement executes: "exec sp_changedbowner @USER_OWNER" the following e...more >>


DevelopmentNow Blog