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) > september 2006

Filter by week: 1 2 3 4 5

drop down list
Posted by brino at 9/30/2006 5:30:05 PM
hi all ! i'm kind of new to MYSQL so am still learning basics. my question is how do you create a drop down list in a field in an SQL database ? thanks brino ...more >>


A script to delete views
Posted by namewitheldbyrequest NO[at]SPAM gmail.com at 9/30/2006 1:18:43 PM
Hi, I need a script that I can run from ASP .Net that will delete all views that start with "Search". My site creates them on the fly and they tend to accumulate as more users visit the site. Is there a good SQL help web site that I can refer to that will be me started? Thanks, Bill Ci...more >>

how to query for text containing parens?
Posted by Terry Olsen at 9/29/2006 8:13:57 PM
I have an SQL database with rows that have parens in the data. If I run a select statement such as: SELECT SongName FROM Songs WHERE SongName = 'John Jacob (Jingleheimer Schmidt)' It returns zero rows. This also: SELECT SongName FROM Songs WHERE SongName LIKE '%John Jacob (Jingleheim...more >>

Replace Multiple LIKEs
Posted by laurenquantrell at 9/29/2006 6:53:22 PM
I have a query below that performs horribly: @KeywordOne char(6), @KeywordTwo char(6), @KeywordThree char(6), @KeywordFour char(6), @KeywordFive char(6) SELECT c.Something FROM dbo.tblStuff c WHERE c.SomeColumnName = 0 AND (c.Keyword LIKE '%' + @KeywordOne + '%' OR @KeywordOne is N...more >>

ALL and empty set
Posted by Dimitri Furman at 9/29/2006 3:24:09 AM
SQL Server 2000 SP4. Hoping to find a logical explanation for a certain behavior. Consider this script: USE pubs GO IF 1 = ALL (SELECT contract FROM dbo.authors WHERE state = 'CA') PRINT 'TRUE' ELSE PRINT 'FALSE' This, as expected, prints FALSE, since not all authors in CA are...more >>

Unexpected Casting With Sum & Coalesce
Posted by Don at 9/28/2006 8:37:33 PM
If I have an SQL query which returns an aggregate of several decimal fields like so: (sum(COALESCE(myDecimal1, 0)+ sum(COALESCE(myDecimal2, 0)+ sum(COALESCE(myDecimal3, 0)) as MyTotal I get an rounded integer in MyTotal. However, if I do the following: sum(COALESCE(...more >>

how to change default data directory for SQL 2005
Posted by Eric Bragas at 9/28/2006 11:43:35 AM
Hi, I've installed SQL 2005 and failed to change the default data location during installation. Now I want to change it. Can I do this without having to uninstall and reinstall? And furthermore, is there a system stored procedure I can use to move existing data and log files (master, msdb, A...more >>

Update Query containg static data and data from another table.
Posted by holmm at 9/28/2006 7:24:36 AM
Hi, First post so apologies if this sounds a bit confusing!! I'm trying to run the following update. On a weekly basis i want to insert all the active users ids from a users table into a timesheets table along with the last day of the week and a submitted flag set to 0. I plan then on creat...more >>



Subquery doesnt work!!!!!!!!!!!
Posted by sanju at 9/28/2006 12:27:13 AM
Hi all, I am sanju, To generate report I am using table named as "tempTest" for displaying count of dealer. On back end i am using oracle. I am unable to insert the second qry The datatype of the table is as follows select * from tempTest CREATE table tempTest ( DEALER_NAME varchar2(50), ...more >>

Searching problem
Posted by dcousineau NO[at]SPAM gmail.com at 9/27/2006 3:00:02 PM
Hi! I'm working with a database of news clippings. The database has fields for the title of the article and the text of the article (also other fields for things like sources and categories, but those have no relevance to the question). We have a single search box that normally searches both t...more >>

this is very, very, very frustrating!!!!!!
Posted by a_dba_used_to_oracle at 9/27/2006 1:06:22 PM
I give up - will someone please tell me why in _Oracle_ I can do something like: select 'CREATE PUBLIC SYNONYM '||table_name||' FOR SYSADM.'||TABLE_NAME||';' from dba_tables where owner='SYSADM'; and get: CREATE PUBLIC SYNONYM CHAINED_ROWS FOR SYSADM.CHAINED_ROWS; CREATE PUBLIC SYNONY...more >>

get todays date and a certain time
Posted by AKorsakova NO[at]SPAM gmail.com at 9/27/2006 11:36:59 AM
Hi Everyone, I am trying to write something to give me back all the data for a sertain time range for today. So for example: I need to get all records where change_date is <= today 2pm and > today at 8pm. I know i can get just the date for today by using CONVERT(CHAR(10),getdate(),102) but c...more >>

Q on joining tables with nullable fields
Posted by mike at 9/27/2006 9:31:52 AM
Question. I have a new table that I am adding to a script that I wrote. This table has 3 fields, the first 2 fields are used in the on statement as being = other fields in the script. The first field always has data in it, but the 2nd field is sometimes null. So my problem is if both fiel...more >>

Non English Characters
Posted by saygin NO[at]SPAM gmail.com at 9/27/2006 5:53:59 AM
Hi, We are developing a small web interface to a local ERP software, which uses SQL Server 2000 as database. The database uses SQL_Latin1_CP1 collation, and the fields are varchar (not nvarchar), however, the main program inserts and reads non-English (Turkish) characters into these columns. Ho...more >>

question on reindex
Posted by paul at 9/27/2006 12:00:00 AM
Hi, i have several tables in production whose contents are renewd totally in 1 week. So everyd day we delete ~15% records and then insert 15% new. And after a few days, the performances drops : TABLE level scan performed. - Pages Scanned................................: 169617 - Extents Scan...more >>

datetime columns
Posted by davep at 9/26/2006 7:03:39 PM
hi, is there a function in ms-sql to get the date only from a datetime column example column 2006-09-26 00:00:00 i would like to see 2006-09-26 tia Dave ...more >>

Oracle Pl/Sql Developer --- Opportunity
Posted by nirmal.spectraforce NO[at]SPAM gmail.com at 9/26/2006 2:18:29 PM
Hello, Please find the requirement details as follows Oracle Pl/Sql Developer Location: Louisville, KY Duration: Long-term Start date: Immediate Rate: 42$/Hr Experience: 3-5Yrs Required Skills: =D8 Oracle Pl/Sql with VB experience. If any body interested in the above opportunity, p...more >>

Update Query Help!!
Posted by sbowman at 9/26/2006 11:51:03 AM
I ran the following update query in Sql Server 8.0: update _SMDBA_._CUSTOMER_ set _SMDBA_._CUSTOMER_.client = dbo.results.adid from _SMDBA_._CUSTOMER_, dbo.results where _SMDBA_._CUSTOMER_.client = dbo.results.clientid; I got the following error: Server: Msg 2627, Level 14, State 2, Line 1...more >>

How accurate is GetDate() ?
Posted by jim_geissman NO[at]SPAM countrywide.com at 9/26/2006 11:28:07 AM
According to MS, GetLocalTime() (in C++) is only accurate to approx a second, even though it reports milliseconds, and calling it twice and computing the interval can on occasion lead to a negative interval. Is T-SQL's GetDate() more accurate than that, or at least non-decreasing? Thanks,...more >>

Date comparison problem
Posted by noone at 9/25/2006 5:59:17 PM
Hi, I am designing an application which displays news topics until midnight on the DisplayUntil date and then they should drop out. Unfortunately, they seem to be dropping out at mid-day. I'm storing the 'DisplayFrom' and 'DisplayUntil' dates as SmallDateTime fields so the date is in the...more >>

Date comparison problem
Posted by noone at 9/25/2006 5:49:33 PM
Hi, I am designing an application which displays news topics until midnight on the DisplayUntil date and then they should drop out. Unfortunately, they seem to be dropping out at mid-day. I'm storing the 'DisplayFrom' and 'DisplayUntil' dates as SmallDateTime fields so the date is in the...more >>

store db objects in *.ndf vs. *.mdf??
Posted by tlyczko at 9/25/2006 12:13:23 PM
I am new to SS2005, and I've just started working on a small test/dev database. I recently read that one should store things like tables, views, constraints, etc. in the *.ndf file rather than in the *.mdf file. Does this make it any easier to transfer/copy files or databases or other items...more >>

set default value for a char column??
Posted by tlyczko at 9/25/2006 11:18:46 AM
I have a char(11) for SSN, and I would like to default it to 123-45-6789 so I can avoid having nulls in this column, and so I can easily find the rows in which I need to have a 'correct' SSN entered/updated. I tried using just 123-45-6789, and SQL2005 doesn't seem to be defaulting to this va...more >>

insert statement blocked
Posted by nano2k at 9/25/2006 3:04:37 AM
Hi Shortly, I keep invoices in a table. Occasionally, someone will fire the execution of a stored procedure (SP) that performs several UPDATEs against (potentially) all invoices OLDER than a date that is supplied to the SP as a parameter. The SP is usually a lengthy process (it takes at least...more >>

what should i do when i want to save a select resultset,but not in a new table,in memory is the best?
Posted by yicong at 9/25/2006 12:00:00 AM
What should i do when i want to save a select resultset,but not in a new table,in memory is the best? thanks! ...more >>

reset sa password msde (sql server 7)
Posted by eddie at 9/24/2006 2:10:15 PM
Hi Guys, We've lost the password for the sa. No other users belong to the admin group. I've tried logging in using osql -E (windows authentication) without success. Is there anyway to reset the sa password? The database is MSDE and the version seems to be 7 (sql server 7 folder on pc). It is ru...more >>

Better way to use BETWEEN Begin and End Dates
Posted by serge at 9/24/2006 12:48:20 PM
/* Subject: How best to use BETWEEN Begin and End Dates to find out if an employee was/is member of any group for a certain date range? You can copy/paste this whole post in SQL Query Analyzer or Management Studio and run it once you've made sure there is no harmful code. I am working o...more >>

how to get this resultset...
Posted by ibiza at 9/23/2006 6:46:00 PM
Hi, I have 3 tables as follow : Kanji : kanji_id .... References : ref_id .... KanjiRefs kref_idkanji kref_idref kref_value .... So, there is a many-to-many relationship between Kanjis and References (one kanji may have more than one reference type, and a reference type may ...more >>

Master File not Accessible for Copying
Posted by Zach at 9/23/2006 2:43:53 PM
Re SQL Server 2005 Express When I attempt to copy the master file for backing up, it is being used by another application, even after shutting down the PC completely and powering it up again. What can I do to make back-ups? Zach ...more >>

DTS Works, job fails!(data source Foxpro and destination SQL Server 2000
Posted by Biodigit NO[at]SPAM gmail.com at 9/23/2006 9:05:01 AM
The DTS works perfectly when I run it manually. However, when I run it as a job it fails. Before you ask if i'm running it under different security context. I have already made sure of that. I was logged into the server through remote viewer, when I created and ran the package, as well as schedu...more >>

Insert trigger to populate other columns in same row
Posted by mike NO[at]SPAM barrodale.com at 9/22/2006 1:11:12 PM
I'm looking for an efficient way to populate derived columns when I insert data into a table in SQL Server. In Informix and PostgreSQL this is easily done using the "for each row..." syntax, but all I've been able to come up with for SQL Server is the following: create table testtrigger(id in...more >>

SQL Address
Posted by dynamota at 9/22/2006 8:05:16 AM
Hi All, We have an MS SQL server that is within the company firewall. We want a particular database to be availabe to a vendor to build a website. When we had to develop a website on another vendors machine they gave us following details. SQL Address: testdata.data.com SQL Port: 1234 SQ...more >>

SSIS Newbie help please.
Posted by Bishman at 9/21/2006 10:55:16 PM
Hi, I am trying to export rows from SQL2005 linked to coresponding rows from Oracle to an Excel spreadsheet using SQL Server 2005 Integration Services (DTS as it was) I really am not sure what I ought to be attempting to do, however I seem to be able to create two OLE DB source 'objects' a...more >>

Breaking down Total Hours worked into Day and Evening hours
Posted by Beowulf at 9/21/2006 4:40:36 PM
I have data coming from a telephony system that keeps track of when an employee makes a phone call to conduct a survey and which project number is being billed for the time the employee spends on that phone call in a MS SQL Server 2000 database (which I don't own). The data is being returne...more >>

Point in Time Backup (impossible for some points?)
Posted by mcaglar NO[at]SPAM cs.ucf.edu at 9/21/2006 1:30:43 PM
Hello, I am using SQL Server 2000 with SP4. I have a database with two full backups at 4:00 PM and 5:00 PM and a transactional log backup at 5:30 PM. Is there a possible way to do a point in time restore to 4:30 PM, that is between two full backups? When I try to use the transactional log b...more >>

Using USER value in SQL code
Posted by billharrison9 NO[at]SPAM gmail.com at 9/21/2006 12:43:33 PM
I need to be able to drop a table after a user is done with it. I have tried something like, DROP TABLE USER.tblEducation_SAP1 but I get an error. Can someone suggest the way I should be using the USER value in this instance? Thanks! ...more >>

QUESTION: Performance issue on *one* database on a server
Posted by BD at 9/21/2006 10:13:41 AM
Hi there. I'm on a SQL 2000 SP4 machine. This is a development machine, with only a couple of small databases on it. Yesterday I needed to recover a table from backup, so I went through the following process: -Used 'Create SQL script' to generate a create db statement from the current...more >>

Question on moving logs
Posted by DataPro at 9/21/2006 6:44:56 AM
Running SQL Server 2000. I have been asked to move the transaction logs to another drive. I was able to do that for the user databases using detach/attach. However I don't see that as an option for moving the logs for the system databases. Is there any way I can move the system database logs?...more >>

Dyamic view/function based on table data (?)
Posted by Matik at 9/21/2006 6:29:49 AM
Hey, First, sorry if this post appear twice, because, I can not find my post recently send, trying to post it once again. I'm out of ideas, so, I thought, will search help here again :( I'm trying to prepare a view for ext. app. This is in normal cases very easy, but what if the view struct...more >>

UNION / INTERSECT / EXCEPT in SQL Server 2000
Posted by James Foreman at 9/21/2006 3:59:53 AM
Hi, I'm coming back to Sql Server after 4 years away, using other RDBMS, and there's a few things I'm struggling to remember how to do (if I could do them in the first place...) Main amongst those is EXCEPT syntax. In DB2, if I have two sets of data and I want to exclude the second set f...more >>

Obtain the query plan of a running process
Posted by Thyagu at 9/21/2006 3:26:59 AM
Hi, Is there a way to findout the query plan of the executing process using the SPID/KPID information. Thanks in advance, Thyagu.D ...more >>

Create Procedure Permission ONLY
Posted by masri999 NO[at]SPAM gmail.com at 9/21/2006 3:03:25 AM
I have a requirement in SQL 2005 in Development database 1. Schema dbo owns all objects (tables,views,SPs,UDFs etc) . 2. Only DBA's ( who are database owners ) can create, alter tables . Developer's should not create or alter tables . 3. Developers can create/alter Stored Procedure/User Defin...more >>

Migrating data from SQL Server 6.5 to SQL Server 2005
Posted by info.nrieger NO[at]SPAM web.de at 9/21/2006 12:26:08 AM
Hello, I'm not very familiar to SQL Server, but I've to upgrade a DBMS from V6.5 to V2005. >From the V6.5 I've got a backup file and a dump file (which seems to be the same, at least it has the same size). After installing V2005 - at another system - I could not find any option to import...more >>

about efficiency(rephrased)
Posted by yicong at 9/21/2006 12:00:00 AM
hi,All could you tell me which case is more efficiency?(my tables have no index) And does it has any else case more efficiency? case1: "select sum(Invoice_Production.Quantity) from Invoice_Production,(select [dat_Item].ItemCode from [dat_Item],(select [dat_MachineType].MachineTypeID fr...more >>

about Efficiency
Posted by yicong at 9/20/2006 4:51:49 PM
I want to select one field from a table,but it should on some conditions which refer to 5 table ,such as A.FILED1=B.FIELD1 AND B.FIELD2=C.FIELD3 AND .... Should I use case "select sum(a.amount) from a,b,c,... where a.field1=b.field1 and b.field2=c.field2 and ..." or "select sum(a.amount) fr...more >>

cursor to compare/report on the same fields in 2 tables
Posted by SQLNewbie at 9/20/2006 12:00:10 PM
I have the following cursor that I am comparing 2 tables, the production table and a copy of the production table, I want results of all address's that are like the address1 field...the problem is...my results are giving me every field and if there is more than one, it is putting it in a grid......more >>

help with Select statement
Posted by Zvonko at 9/20/2006 10:48:59 AM
Hi! This is my table: CREATE TABLE [Query_Result] ( sifrob VARCHAR(13), katbroj VARCHAR(15), kol FLOAT ) This is some values: INSERT INTO [Query_Result] ([sifrob], [katbroj], [kol]) VALUES ('49501879', 'G-46052', 1) INSERT ...more >>

Question on System and Data Restore
Posted by DataPro at 9/20/2006 8:00:16 AM
new to SQL Server 2000. We have an obsolete database that we need to save off for x number of years. DB2 has utilities (DB2Look/Export) that allows for the export of the data along with a schema and script that enables the future recreation of the structure of the databases and tables to includ...more >>

Character set support
Posted by oraustin NO[at]SPAM hotmail.com at 9/20/2006 1:26:51 AM
I'm looking at an MS SQL server database and it stores city names across the world. All a arabic , chinese etc names are converted to the latin alphabet. I feel it is probably critical we support accents as a means to distinguish between cities that would be converted to the same Latin alphab...more >>

DELETE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'
Posted by ilo at 9/20/2006 1:17:38 AM
When I want to delete a data from a table that this tabl has a trigger and this trigger reached another tables to delete the data in cursor I have this messeage: DELETE failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. My trigger : CREATE TRIGGER [TOPBA...more >>


DevelopmentNow Blog