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
August 2008


all groups > sql server programming > october 2007 > threads for tuesday october 2

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

Unexpected result from NOT IN
Posted by Leila at 10/2/2007 11:35:54 PM
Hi, When I run this code, it returns "2" which is expected: declare @x table(col1 int) insert @x select 1 insert @x select 2 select * from @x where col1 not in (1) But when NULL is added to the list of IN, then "2" disappears from te resultset: declare @x table(col1 int) insert @x se...more >>

List as an aggregate function...
Posted by Alex Castillo at 10/2/2007 4:54:43 PM
Currently I'm rewriting SQL code written for Sybase SQL Anywhere into MS SQL 2000. I'm learning a lot of stuff... the latest is I can not use List() as an aggregate funcion... Does anyone know any workaround to get such function working? Thanks..! ...more >>

Help with BCP Data file
Posted by Matt Williamson at 10/2/2007 4:54:33 PM
I'm trying to import a csv file using a BCP Data task in a DTS package in SQL 2000. I can't seem to get the format file for BCP right. The file I want to import has 8 columns of data. The table I'm importing into has 9 columns. The first column is an ID column and I want it to generate during ...more >>

Select Query: Incorrect Result
Posted by brandon at 10/2/2007 4:38:53 PM
The query returns: EventId EventTitle Active Registration Addendum 2 Test -1 7 7 3 Future -1 0 0 4 Construction 0 0 0 The Numb...more >>

UTC converted to local time, current and historical?
Posted by Michael MacGregor at 10/2/2007 3:21:46 PM
We store all of our dates as UTC however we would like to retrieve these according to the local time zone setting for both current and historical dates and times. There doesn't seem to be a function that performs the reverse of GETUTCDATE(), i.e. it gets the local date & time based on the cu...more >>

Calling a view within a sp
Posted by Hols at 10/2/2007 3:18:07 PM
I have an issues with a sp that is calling a view. Basically in Profiler it is showing the entire View: select * from contact c join contact_stuff cs on c.id = cs.id where c.status = 'A' -- count 1 million records sp: select * from view where v.id = 15 When running this and viewi...more >>

Using OPENROWSET not returning all columns
Posted by gv at 10/2/2007 2:04:40 PM
Hi all, This works but will not return all the columns on the sheet? Willn't return the last 10 columns. I even went into DTS and doesn't see the last 10 columns? SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=\\MyServer\MyShare\test.XLS', 'SELECT * FROM [Result...more >>

MCITP: Database Administrator
Posted by CLM at 10/2/2007 1:28:18 PM
I have a couple of q's after reading the link regarding getting the above certification. (Note: I do not have my 2000 MCDBA certification.) http://www.microsoft.com/learning/mcp/mcitp/dbadmin/default.mspx 1. Do you have to take all the courses for each of the two required exams? I notice...more >>



Query Help
Posted by amj1020 at 10/2/2007 1:24:13 PM
I need to join on two tables by a symbol field. The problem is that one table contains the symbol but with a prefix and a suffix Table 1 Symbol 0.1PGOmPLECINWE 0.1PGOmPLEF Table 2 Symbol_ID #DF0.1PGOmPLECINWEJ08 #DF0.1PGOmPLEFC07 I can't use substring because the symbol_id is not a c...more >>

group by query
Posted by Andy at 10/2/2007 12:55:00 PM
Here is my issue. This is not the complete table structure, but only the fields that are necessary for this discussion. CREATE TABLE Loads (LoadNumber int NOT NULL, Bounced bit NOT NULL) INSERT INTO Loads VALUES (1,1) INSERT INTO Loads VALUES (1,0) INSER...more >>

Run SQL statement in Query Analyzer as...
Posted by Curious at 10/2/2007 11:56:58 AM
I want to run a SQL statement in Query Analyzer as user, "developer". Here's how I did it: Select Start->All Programs->SQL Tools->Microsoft SQL Server->Query Analyzer. Then I right-mouse click "Run As" It at first gives me a dialog to prompt for user name and password. I entered "develope...more >>

Run SQL statement in Query Analyzer as...
Posted by Curious at 10/2/2007 11:56:54 AM
I want to run a SQL statement in Query Analyzer as user, "developer". Here's how I did it: Select Start->All Programs->SQL Tools->Microsoft SQL Server->Query Analyzer. Then I right-mouse click "Run As" It at first gives me a dialog to prompt for user name and password. I entered "develope...more >>

Run SQL Statement in Query Analyzer As...
Posted by Curious at 10/2/2007 11:54:15 AM
I want to run a SQL statement in Query Analyzer as user, "developer". Here's how I did it: Select Start->All Programs->SQL Tools->Microsoft SQL Server->Query Analyzer. Then I right-mouse click "Run As" It at first gives me a dialog to prompt for user name and password. I entered "develope...more >>

Select Query Analyzer and then select "Run as..."
Posted by Curious at 10/2/2007 11:19:03 AM
I want to run an SQL statement by a user, "developers". I was told that I could do this by selecting Start->All Programs->SQL Tools->Microsoft SQL Server->Query Analyzer, then clicking on the right mouse button and selecting "Run as..." . At first, it gives me a screen ("Run as") to prompt m...more >>

2005 MCDBA
Posted by CLM at 10/2/2007 11:15:01 AM
I cannot find the link that has the 2005 MCDBA course requirements. I have found the SS 2000 MCDBA. If someone could post the link, I'd appreciate it......more >>

Why cann't I delete or edit my data in a table?
Posted by Al at 10/2/2007 11:11:06 AM
I have a table in sql 2k. the table has only 3 fields as follow: RequestTypeID char(10) not null Activities varchar(255) not null BD int(4) not null When I tried to copy and paste some data within the activities field, I got the following message: .."key column information is insufficient...more >>

SQL Query help
Posted by SJ at 10/2/2007 10:51:01 AM
I am trying to get the patient’s time in treatment in days by comparing multiple records in a table. The DDL for the table is CREATE TABLE #temp (patient_id int not null, clinic_id char(9) null, service_date datetime null) A patient will ...more >>

xml parameter
Posted by Arne Garvander at 10/2/2007 10:02:00 AM
What is the best way of passing a dataset from .net to to a SQL Stored procedure? I a would like to use the xml datatype or xml as a string. How would I process the xml once it arrives at a stored proc? -- Arne Garvander Certified Geek Professional Data Dude...more >>

Update query not working
Posted by spurvia at 10/2/2007 8:45:04 AM
I am trying to update a column with two criteria and it will not accept the second criteria statement. update dbo.Rates set RetainedCost = 8 (select ModelNo, Month from dbo.Rates where ModelNo Like '%10' and Month = '04') This is one table that is being updated. The retained cost is updat...more >>

Subquery returned more than 1 value
Posted by kw_uh97 at 10/2/2007 7:48:01 AM
Hello All, thought I'd ask here first. Has anyone experience this error message "Subquery returned more than 1 value" when the query has multiple joins on several tables but no subqueries written in the SQL syntax? SELECT D.*, l.[Column] , l.[Column2] As AliasColumn3, r.[Column3] FROM Tab...more >>

Problem with ISNUMERIC function
Posted by Frank Uray at 10/2/2007 7:44:04 AM
Hi all I have a funny little problem ... I am trying to use the function ISNUMERIC like in the following examples: ***************************************** DECLARE @TestString varchar(50) SET @TestString = 'Hi Newsgroup' SELECT CASE WHEN ISNUMERIC(@TestString) = 1 THEN CONVER...more >>

Use of a reserved keyword in a query
Posted by Jean at 10/2/2007 6:58:40 AM
Hello, I am currently writing a query using a DB which someone else designed. One of the tables uses a reserved keyword, namely dbo.User. Everytime I included this table in my SQL, I get the error "Invalid object name 'dbo.User'." I have tried including brackets like [dbo.User] . The SQL pa...more >>

Conditional Join Condition
Posted by joker197cinque at 10/2/2007 3:36:32 AM
I'm trying to join 2 tables in a conditional way: select llt.* from llt join v on case v.tipo when 2 then 's' when 12 then 'n' else '' end = llt.flag The aim is to join v table rows to llt table rows following these assumptions: if v.tipo value is 2 then join v table rows to llt table ...more >>

Update failed to an image field when data > 256 MByte
Posted by Imre Ament at 10/2/2007 3:10:00 AM
Hi, I receive an E_FAIL error when my program try to update a column. The bug arise only when the data > 256 MByte (and < 2GByte). column type : image Server : MSDE 2000, version - 8.0.2039 (sp 4???) technology : OLEDB, from C++ -> CDynamicAccessor As I see the provider read all data fro...more >>

Speed of Stored Procedure
Posted by Aussie Matt at 10/2/2007 2:41:01 AM
Hi Guys, This is going to sound like a newbie question, but I feel I need to ask it, I have 2 variations of the same SP with the only difference being the where clause Version 1 CREATE PROCEDURE [dbo].[USP_FMSRX140] (@X int, @Y int) AS --Delare the StartIndex Variable declare @StartIn...more >>

How to back up SQL Server 2005 database to 2000 format
Posted by Juan Manuel Alegría B. at 10/2/2007 12:00:00 AM
Hi, I have a problem, I´m working with SQL Server 2005 database but I need that database in a SQL Server 2000 database format. Thanks for your help. ...more >>

sys.database information available in 2000
Posted by Paddy at 10/2/2007 12:00:00 AM
Hello I am trying to list all the particular properties of my databases, in a mixed server environment. Specifically I am interested in the recovery mode, so in 2005 and use select [name], recovery_model_desc from sys.databases order by 2 asc however this s not an option on th...more >>

MSSQL Group By
Posted by Ken at 10/2/2007 12:00:00 AM
Dear All, I am working on both SQL2005 and MYSQL4.0. There are some great = functions / features in MYSQL that is missing in MSSQL. In MYSQL, GROUP BY can let you to use non-aggregated columns in SELECT = that do not appear in GROUP BY clause: http://dev.mysql.com/doc/refman/5.0/en/group-by...more >>

Procedure Cache Issue? (SQL Server 2005 EE, Service Pack 2)
Posted by Leila at 10/2/2007 12:00:00 AM
Hi, One of our customers has strange problem with their SQL Server. We have written an SP for them that retrieves 12 rows from 12 light queries and inserts into a table variable. Finally selects all rows from table variable and returns to the caller. In normal situation this SP finishes within...more >>

Returning the lowest price
Posted by gv at 10/2/2007 12:00:00 AM
Hello everyone,Example table:+--------+------------+-------+ | type | variety | price | +--------+------------+-------+ | apple | gala | 2.79 | | apple | fuji | 0.24 | | apple | limbertwig | 2.87 | | orange | valencia | 3.59 | | orange | navel | 9.36 | | pear ...more >>


DevelopmentNow Blog