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) > february 2004 > threads for february 22 - 28, 2004

Filter by week: 1 2 3 4

Restore databases into a new installation of SQL Server
Posted by seapearl1023 NO[at]SPAM ms65.url.com.tw at 2/28/2004 3:17:35 PM
Hi, I want to restore my databases from the old SQL Server installation into a new installation of SQL Server. My new installation of SQL Server has different data path from the old installation. In addition, the data owners of some databases in the old SQL Server installation are not dbo. I ...more >>


How to write a function that will return true if user is in a certain role?
Posted by tdauria NO[at]SPAM bu.edu at 2/28/2004 12:58:54 PM
I have a SQL database with an Access front end. In the database I have a read only and a read write role. When a read only user opens the database I want all the fields on the form to be locked so that the user will not try to change data and get an error from the server. Right now I am doin...more >>

create an incremental counter in the stored procedure
Posted by Anna Schmidt at 2/28/2004 12:33:27 PM
Hello, I have a following SP I want to add an extra field "ranking" that just increments the row number. Another feature would be: if several users have an equal totalvalue, they should have an equal ranking number. the rankings following users would have to be adjusted as well. thanks SET QU...more >>

Holidays in SQL Server
Posted by Nils Magnus Englund at 2/28/2004 2:55:58 AM
Hi! I have a large table in SQL Server 2000 with a datetime-column 'dt'. I want to select all rows from that table, excluding days which fall on holidays or weekends. What is the best way to accomplish this? I considered creating a new table called "holidays" and then selecting all rows (sort ...more >>

Calling an Oracle Procedure via a DTS
Posted by Jason Leiser at 2/27/2004 7:58:23 PM
Is there a way to call an Oracle Procedure using the MS OLD DB Provider for Oracle object in a SQL Server 2000 DTS package? If it can't be done this way, is there another way to retrieve data from an Oracle database using an Oracle procedure to a SQL Server table? Also, can parameters be passe...more >>

Set operations (EXCEPT/EXCEPT ALL)
Posted by erwin NO[at]SPAM theleonardi.com at 2/27/2004 7:02:29 PM
Hi all, I just start using SQL Server for my project. I have some questions related to set operations. Suppose I have two tables, Table A and Table B, as following. TableA TableB ======= ======= --------------- --------------- | ID | DATA ...more >>

linked tables
Posted by sifre78 NO[at]SPAM yahoo.com at 2/27/2004 4:56:18 PM
I have access tables which are linked to SQL database by ODBC connection. By using Access, i can easily see my table contents. but when i am using ASP, i con not. I am getting this error message Microsoft JET Database Engine (0x80004005) ODBC--connection to 'SQL ServerMYDATABASE' failed. wi...more >>

Creating a Table
Posted by vartegrich NO[at]SPAM aol.com at 2/27/2004 1:38:32 PM
How do you create a new table from a SELECT statement of another table using MS SQL Server. This is part of a distributed database topic for university. Unfortunately I can only seem to get the new table created in Oracle and not MS....more >>



auto recompile in sql server
Posted by chen1999 NO[at]SPAM hotmail.com at 2/27/2004 1:09:29 PM
Hi, I have a question in SQL Server 2K, I use SQL Profile to trace, and find Stored Procedure was auto recompiled, like this row in the trace: SP:Recompile 15 1680 76 2004-02-27 16:01:11.610 How can I stop the auto recompile. Thanks Harold...more >>

stored procedure to create new database
Posted by cakewalkr7 NO[at]SPAM hotmail.com at 2/27/2004 10:16:03 AM
Is there a stored procedure installed by sql server 2000 that I can call and just pass in the name of a new database and have it create the database for me? If not, how do I do it in sql? Thanks....more >>

TempDB tran log growing slowly - yet we are in simple mode!
Posted by trhorner NO[at]SPAM att.net at 2/27/2004 5:34:58 AM
Something strange is happening to our SQL Server DB (2000). The tempdb transaction log file continues to grow (quite slowly) for no apparent reason. We have it in simple mode, and I have tried a manual checkpoint command and manual shrink (of the log file only). There are no unusual SQL's (la...more >>

SQL Agent question
Posted by Wangkhar NO[at]SPAM yahoo.com at 2/27/2004 3:34:12 AM
Dumb question perhaps, but hey. SQL Agent on sql2k, client sp3a, server vanilla. In EM Agent Icon Status does'nt show. Server running status doesnt show till explicitly connected. Agent has both start and stop menu options enabled, and no green arrow/red square (Green Arrow, Red Square ... ...more >>

cluster sql server 2000
Posted by ragaza NO[at]SPAM ozu.es at 2/27/2004 1:30:46 AM
Hi, I need manuals, tecnical papres, instalation guide, etc about how to install one cluster sql server 2000 64 bits with windows server 2003. It`s posible a need one document step by step about this Thanks, RaulGZ....more >>

MSDE & SQL 2000
Posted by CruznOz at 2/26/2004 7:48:25 PM
I have a client that has a server running Windows 2000 Server. another company has installed MSDE (version unknown) on this server. I need to install SQL 2000 on the same server. Will the two coexist peacefully? Tia CruznOz *** Sent via Developersdex http://www.developersdex.com *** ...more >>

Is installation secure ?
Posted by kona_iron NO[at]SPAM yahoo.fr at 2/26/2004 6:21:56 PM
We can find a lot of recommandations about how to secure a SQL*Server configuration. Does anyone have scripts to do it ? Any advices or links are welcome...more >>

Haversine SQL trouble - Distance between zip codes
Posted by christian NO[at]SPAM adminconsole.com at 2/26/2004 6:03:11 PM
I am trying to use the haversine function to find the distance between two points on a sphere, specifically two zip codes in my database. I'm neither horribly familiar with SQL syntax nor math equations :), so I was hoping I could get some help. Below is what I'm using and it is, as best as I ca...more >>

setting the query time out....
Posted by casianspice NO[at]SPAM yahoo.com at 2/26/2004 5:49:34 PM
i am using sqlserver 2000, and i was wondering how do i go about setting the query time out. is there a way to configure the query timeout for a specific user id?...more >>

How to fix SQL Server 2000 after machine name & domain change ?
Posted by Arifi Koseoglu at 2/26/2004 5:23:31 PM
Hello everybody.. Is there a way to fix the SQL Server 2000 installation when the Server after the server has been disjoined form its old domain and added to a new domain with a different computer name too? Sounds like a joke, but stuff happens. TIA -arifi ...more >>

Two tables and count
Posted by Andrew Banks at 2/26/2004 5:22:50 PM
I have two tables in my DB for an e-commerce app. This allows for 1 order to have multiple products. I want to select the OrderID from the Orders table but only when all the corresponding records in the OrderDetails table all have their Despatched value = 0. Can anyone offer any help please? Sim...more >>

Deleting records in the logfile
Posted by Derrick King at 2/26/2004 4:36:30 PM
I have a database that is used to store a lot of data. We load the data on a daily basis, several thousand records per day. The Log file is not needed, so whats the best way to delete the records in it and reduce the size Thanks Derrick ...more >>

Getting Database Stats
Posted by Derrick King at 2/26/2004 4:31:59 PM
COuld someone tell me if its possible to get hold of stats about all Databases on a SQL Server. The sort of things I would like are Name of DB Location of DB Size of DB Location of Logfile Size of DB Owner Users Authorised to access the DB Is there somethi...more >>

Data disappear - SQL server 2000 / ASP interface
Posted by haebin NO[at]SPAM andrew.cmu.edu at 2/26/2004 2:33:05 PM
Hello, What could possibly cause data in the SQL server database to be removed, except being deleted manually? We had a couple of situations where data in certain records disappeared although the records were still there. The data is entered and editted through the web interface in ASP. The w...more >>

Array in Store procedure
Posted by robert.song NO[at]SPAM mda-software.com at 2/26/2004 1:32:57 PM
Dear all, Sometimes I happened the require that the number of input parameters of SP is not fixed, Can sql T-SQL handle the array (dynamic array)? Does anybody ever used an array name as the input parameter to call the SP? thanks, Robert...more >>

Access File/Get Data can't attach to a SQL table.
Posted by bcanavan NO[at]SPAM bmghomes.com at 2/26/2004 12:18:34 PM
In Access 97, I am trying to attach to a table in my SQL Server 2000 db. I use File/Get Data, which displays all the SQL tables including the one I can't attach to. (I can attach to all the other SQL tables.) But, when I select that table I get a message that tells me the name is invalid. ...more >>

SELECT problem...
Posted by Ian T at 2/26/2004 12:17:48 PM
Hi, I've got what I think (probably incorrectly) should be a simple SELECT : Two colums with data like col1 col2 1 50 1 51 2 50 2 51 3 50 3 54 I'm trying to bring back items in col1 that have values of both 50 and 51 ( and potentially m...more >>

search the primary key given the table name
Posted by robert.song NO[at]SPAM mda-software.com at 2/26/2004 12:15:32 PM
Hi all, How can get the primary key string from the given table name? i know it should from system tables of "sysobjects, syscolumns, and sysconstraints", but when i execute the statement like that: select a.name from syscolumns a,sysobjects b,sysconstraints c where a.id = b.id and b.name ...more >>

Converting Rows into Columns MS SQL 2K
Posted by daniel.white NO[at]SPAM perceptivetech.com at 2/26/2004 8:08:10 AM
I have a SP that returns the information I want but it returns it in 2 separate queries. Example: Query 1 Name, Number, Class Row 1- Mike Phillips, 154AA, AA and Query 2 Time, Manual Row 1 -12:45:22,0 Row 2 -13:04:56,0 What I want it to look like is: Name, N...more >>

Combining data from differnet Excel sheets
Posted by levyi NO[at]SPAM walla.co.il at 2/26/2004 7:20:11 AM
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though the records are sorted by row numbers. (I had to split the fields to different sheets because Excel ha...more >>

MS SQL Server XML Query Help
Posted by xml_ NO[at]SPAM hotmail.com at 2/26/2004 6:51:08 AM
Hi all-- I am trying to execute the following query in MS SQL Server 2000. SELECT 1 AS Tag, NULL as parent, 'x' AS [A!1!B], NULL AS [C!48], NULL AS [RepurchaseDetails!49] UNION ALL SELECT 48, 1, NULL, 'y', NULL UNION ALL SELECT 49, 48, NULL, NULL, 'z' ...more >>

Tables in Linked Server
Posted by aaronss NO[at]SPAM the-mdu.com at 2/26/2004 4:03:13 AM
Hi I received the below error when trying to run an update from one SQL Server to another. I can insert and select. I cannot delete or update. The permissions have been changed to allow the linked server user to carry out everything, the linked servers are working but we cannot change the ...more >>

Question : How SQL chooses an index for a process
Posted by Anita at 2/26/2004 3:38:22 AM
I have just tested 3 queries using QA. The complete test information : ------ CREATE TABLE agls1 ( fyear char(4) NULL , fprefix char(3) NULL , fvcno char(20) NULL , fdate datetime NULL , fid char(15) NULL , fiddate datetime NULL , fdesc char(60) NULL , facc char(12) NUL...more >>

Group dates by month
Posted by wantjoule NO[at]SPAM ncl.com at 2/26/2004 2:43:42 AM
I have a table that i want to query and group the records by the month, what SQL stanment would i use? Somthing like this? apart from i know that the "Group BY (MM/YYYY)" wont work !:) Select Date,Name FROM Table Group by (MM/YYYY) Does this make sense? Willa...more >>

Correlated Subquery Efficiency
Posted by hardaway NO[at]SPAM primus.com.au at 2/25/2004 6:05:52 PM
Hello All, I have a SQL Query with multiple correlated Subqueries in it. When it gets executed it runs rather slow due to the size of the QT table. Does anybody have any suggestions how to alter this query to make it run faster, or any index suggestions to assist it with. Query is as follow...more >>

recursive call in stored proc
Posted by robert.song NO[at]SPAM mda-software.com at 2/25/2004 2:52:37 PM
Hi all I am implementing a stored procedure which needs to recursively call itself until specific condition is reached, Could anyone give some advice about that? Thanks a lot Robert Song...more >>

Alter Column Type.
Posted by lhovhannessian NO[at]SPAM hotmail.com at 2/25/2004 9:55:37 AM
Hello, Easy one for the SQL experts. I have a simple table. For the example let's say it looks like this: CREATE TABLE doc_exb ( column_a INT, column_b VARCHAR(20) NULL) Now I want to alter this table and make the column column_a a float instead of an INT. How do I do that? I cannot DR...more >>

back everything up in a single file?
Posted by Bing Du at 2/25/2004 8:50:22 AM
Greetings, Our former SQL Server 2000 DBA backed up everything in a single disk file. By everything I mean, full backup, differential backup and transaction logs. See below for details of how the backup is currently set up. When I did 'view contents' of DBBackup, I saw it contained the ...more >>

sp_spaceused reports over 40 GB unused for a table
Posted by spilich NO[at]SPAM qvc.com at 2/25/2004 8:27:19 AM
I have a large table that I recently purged a year of data from. However, the table size in sp_spaceused hasn't decreased as much as I would expect. (there are no text or large object columns on this table, BTW) Running sp_spaceused on the table shows the following. rows ...more >>

Extra parameters being added onto SP call with ADO?
Posted by dzahn NO[at]SPAM execpc.com at 2/25/2004 6:44:00 AM
We are running into problems on our development environment with extra parameters being added on to a stored procedure call. Instead of the expected stored procedure call, the trace shows something like this: declare @P1 int set @P1=NULL <<expected stored procedure call>> , @P1 output, <<rep...more >>

LAN SQL set up question
Posted by knvsol NO[at]SPAM comcast.net at 2/25/2004 4:36:10 AM
I am trying to set up a production and test machine on a LAN. The LAN is behind a firewall. Machine 1: Production machine. with SQL server (Server name Prod) Machine 2: Test machine. With SQL server (server name Test) trying to register Prod sql server in Test Sql server via Ent Manager. ke...more >>

Cristal Reports for OLAP CUBE
Posted by aprpradeep NO[at]SPAM hotmail.com at 2/25/2004 12:14:13 AM
I have created a crystal report connecting an OLAP cube .But once i try to view a report it took around 15 minutes and finaly gave an error like "cannot retrieve data from cube".I want to know why it is and how can i create a crystal report for OLAP CUB....more >>

aba_lockinfo - new version available
Posted by Erland Sommarskog at 2/24/2004 11:12:16 PM
If you are using my lock-monitoring procedure aba_lockinfo, there is now a new version available at http://www.sommarskog.se/sqlutil/aba_lockinfo.html. I recommend that you replace your existing version with this one. Functionally, there are only minor difference, but the older version did no...more >>

using contains clause
Posted by Rob Wahmann at 2/24/2004 6:57:40 PM
Hello - I'm using the following syntax: WHERE pages.ParentID=0 AND CONTAINS(pages.regionID,'#request.thisRegion#') ....and I get the folowing error: [SQLServer JDBC Driver][SQLServer]Execution of a full-text operation failed. A clause of the query contained only ignored words. I'm tryin...more >>

wmi access to sql server
Posted by Bob & Martha Vera at 2/24/2004 6:09:43 PM
Hello, Forgive a newbie's question ... Can I access SQL Server and the databases and tables within using windows script? If so, could someone point me in the right direction? Regards, Bob ...more >>

changing object owner syntax
Posted by Kelly Prendergast at 2/24/2004 6:03:44 PM
Hi there, We have a user name convention here that specifies users in the following way: jane.doe john.smith In order to change a database object I must specify the owner name along with the object name. Does anyone know the proper syntax for doing this with a user name that contains a per...more >>

Server failure
Posted by Proli at 2/24/2004 11:38:08 AM
Hi, I have lost my win 2k server where I had my Sql 2000 data. Now I need to attach to sql server my database, but I have lost the log file. If I use the enterprise manager I get an error, if I use a stored procedure I get an error. How can I do to attach my .mdf file to Sql Server...more >>

Dynamic Cross-Tab Query too long?
Posted by tim.pascoe NO[at]SPAM cciw.ca at 2/24/2004 8:32:22 AM
I am using the Dynamic Cross-Tab code supplied in an article from SQL Server Magazine (http://www.winnetmag.com/SQLServer/Article/ArticleID/15608/15608.html). I modified the script to generate a temp table inside the stored procedure, and then use this temp table as the source for the cross-tab....more >>

Composite primary key on a table variable?
Posted by sevans2001 NO[at]SPAM hotmail.com at 2/24/2004 6:44:46 AM
Is is possible to create a composite primary key on a table variable? Neither of these two statements are successful: DECLARE @opmcjf TABLE ( jobdetailid INT NOT NULL, cjfid INT NOT NULL, cjfvalue VARCHAR(100) NULL ) ALTER TABLE @opmcjf ADD CONSTRAINT [PK_opmcjf] PRIMARY KEY CLUSTE...more >>

Using OPENXML
Posted by j_mouland NO[at]SPAM hotmail.com at 2/24/2004 6:41:11 AM
I have a SP set up to take an input param and then fire the following sp_xml_preparedocument OPENXML (With a select statement) sp_xml_removedocument This works fine with the XML syntax that microsoft provides in its documentation ... <ROOT> <Customer> <CustomerID>VINET</CustomerID> ...more >>

SQL Server Interview Questions
Posted by kamlesh2000 NO[at]SPAM yahoo.com at 2/24/2004 3:07:21 AM
Hi, Is there any website which lists the various SQL Server related questions which might be helpfull for interviews. I am looking for one that contains complex Queries that includes all kinds of operators like GROUP BY, HAVING etc... Regards, Kamlesh...more >>

ASP, SQL Server and double insert...
Posted by falaweb NO[at]SPAM yahoo.it at 2/24/2004 1:25:51 AM
hello, I have a little (big?) problem with a software in ASP / SQL Server. This is a demo of the problem: ID= 12458 Data=21/01/2004 21:14:45 txt txt txt ID= 12458 Data=21/01/2004 21:14:45 txt txt txt ID= 12458 Data=21/01/2004 21:14:45 txt txt txt ID= 12458 Data=21/01/2004 21:14:45 txt txt tx...more >>

BCP call to stored procedure - broke during upgrade from SQL 7.0 to 2000
Posted by Aston at 2/23/2004 10:03:09 PM
I have this stored procedure that takes a few parameters like date and merchant ID, and basically goes through a set of if-then statements to build a SQL SELECT string. When we upgraded from SQL Server 7.0 to 2000, the stored procedure still worked from Query Analyzer, but not in BCP. It used...more >>

Problem with SQL Statement
Posted by Andrew Banks at 2/23/2004 9:31:58 PM
Can anyone see anything obviously wrong with this statement? I'm not really an SQL kind of guy SELECT ProductID, Title FROM Products WHERE PlatformID LIKE % AND CategoryID = 'f5e45b55-95de-47f4-a79b-b24969178b52' ORDER BY Title PlatformID contains a GUID and I thought passing a wildcard woul...more >>

Exporting MS SQL Server or Oracle Databases to MySQL
Posted by James Alexander Starritt at 2/23/2004 9:29:10 PM
I also posted similarly in mailing.database.mysql I have created a rather large (60 table database) website dealio in PHP that works with MS SQL Server, Oracle, MySQL and presumably any other data base I add to the wrapper functions that I created. All the development was done in Oracle, but...more >>

SQL error
Posted by Jammy G at 2/23/2004 7:38:27 PM
Hello, In the below SQL I am getting Error at COUNT. Can anyone tell me what is wrong with this query: SELECT DISTINCT A.EMP_NO, A.ENT_DT, CASE A.SHIP_NO WHEN (SELECT COUNT(DISTINCT SHIP_NO) FROM EMP_S...more >>

Slow query execution, SQL Server 2000
Posted by M Wells at 2/23/2004 4:30:39 PM
Hi All, I have a table that currently contains approx. 8 million records. I'm running a SELECT query against this table that in some circumstances is either very quick (ie results returned in Query Analyzer almost instantaneously), or very slow (ie 30 to 40 seconds to return results), and I...more >>

how do I query this?
Posted by hymort NO[at]SPAM hotmail.com at 2/23/2004 2:57:20 PM
Hi, I have a table that stores a list of IDENTITIES that references different tables. Two rows in this table refreence the same key from a table: tbl_myTable(myTableID, swUserID, hwUserID, etc...) tbl_user (userID, userName) where swUserID and hwUserID references userID of the tbl_user ...more >>

concatenate two column.
Posted by SWN at 2/23/2004 1:44:25 PM
hi. Trying to concatenate two columns: select uname+' '+uaddress as NameAdr from tblUser I only get the first field, name!!?? The datatype is both nvarchar. 100 and 50 chars long. If I run this query: select uname, uaddress from tblUser theres no problem. Any suggestions? Th...more >>

How to do an update on existing records?
Posted by googlemike NO[at]SPAM hotpop.com at 2/23/2004 12:12:48 PM
I have one table of new records (tableA) that may already exist in tableB. I want to insert these records into tableB with insert if they don't already exist, or update any existing ones with new data if they do already exist. A column (Action) in tableA already tells me whether this is an INSER...more >>

Multithreading?
Posted by mr_fbi2020 NO[at]SPAM yahoo.com at 2/23/2004 11:32:25 AM
Hi Can an application populate two Grids from the database, simultaneously without using the multithreading using ADO.NET Thanks in advance MR_FBI mr_fbi2020@yahoo.com...more >>

How to make full-text search accent-insensitive?
Posted by Matthias HALDIMANN at 2/23/2004 11:22:17 AM
My SQL Server 2000 does not use the accent insensitive collation setting (collation containing _AI) in full-text serches: While SELECT * FROM <table> WHERE <column> LIKE '%a%' returns 'Mäuse', SELECT * FROM <table> WHERE CONTAINS(*, 'a') does not. Setting 'default full-text language' to neutra...more >>

Parent Child Tables
Posted by markoueis NO[at]SPAM hotmail.com at 2/23/2004 10:34:20 AM
In our database we have a list of devices in a "Device" Table, each having one or more IP's located in the "IP" Table linked through a forein key on the DeviceID Column. I would like to retrieve this information as Such DeviceID IpAddress 1 10.0.0.1, 10.0.0.2, 10.0.0.3...more >>

Error 208, Missing Stats
Posted by Wangkhar NO[at]SPAM yahoo.com at 2/23/2004 8:29:02 AM
Hi chaps Just been having my head messed with... I was running a trace capturing all errors and SQL. Had a bucket of error 208's (invalid object name). Found the SQL that caused it - an SP. Ran the sp by hand, no messages come up - error 208 logged in the trace. Couldn't work it out...more >>

1 row retrned for 3 rows of data
Posted by joe NO[at]SPAM signing-services.com at 2/23/2004 7:28:39 AM
Here are my rows TimeIn TimeOut Reason ------------------------------------ 01/01/04 8:00 01/01/04 12:00 Out - Lunch 01/01/04 12:00 01/01/04 1:00 Lunch Hour 01/01/04 1:00 01/01/04 5:00 Out - FTD Here is what I want to return from this data Date In Out/...more >>

Problem convert varbinary to float
Posted by maciej_ty NO[at]SPAM poczta.onet.pl at 2/22/2004 2:11:24 PM
Hello I have some problems with converting varbinary to float in T-SQL stored procedure. In my C# application i have table of structures with double type fields. Size of this table is variant. I have to send this table to SP. Because of performance i want to send it only once and whole. So I hav...more >>


DevelopmentNow Blog