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
all groups > sql server programming > may 2005 > threads for wednesday may 25

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

replication with java
Posted by inder at 5/25/2005 11:39:01 PM
Hi all, I'm trying to develop a Java application that will manipulate and transfer data from sql server X to sql server Y (transactional replication is not an option). I'm pretty new to this sort of thing, but how can my Java application be notified when a record is updated/inserted i...more >>


storing email in sql db
Posted by tejas dandekar at 5/25/2005 10:52:02 PM
i have stored email address in a column by the name email(nvarchar 100) in a table. i want that when i fetch the date on the aspx page the email address thats displayed should be clickable link that shud take the users to outlook. but its not happenning how can i achieve that?...more >>

TRANSPOSE QUERY fat fingers
Posted by Candor Feg at 5/25/2005 10:03:34 PM
7745884438834 I would like a query that pulls back pairs of numbers that should be the same, but one was mistyped. Specifically, I am looking for numbers where two neighboring digits were transposed in one of the numbers. If you do well with this one, I will ask for more. Please don't ...more >>

No Cursor
Posted by Paul Ilacqua at 5/25/2005 7:17:36 PM
How would I take the total of the failures column below so I can do %'s of the total. I can do it with an ADO recordset from VB, but I'm trying to do it in TSQL 1st. Thanks Paul DECLARE @BeginDate DateTime DECLARE @EndDate DateTime Set @BeginDate = '2005-05-12' Set @EndDate = '2005-05-...more >>

Problem with restore: odbc sqlstate: 42000
Posted by culam at 5/25/2005 6:49:02 PM
I got this error when I do a manual restore: "odbc sqlstate: 42000" Please help, Culam...more >>

1 to (1,2) relationship
Posted by John at 5/25/2005 4:16:03 PM
I have a scenario where I need to model the following relationship 'X has one or two Y, where Y is independent of X'. Here is a fictitious sample to try to explain the scenario. Given the tables below, for each front tire maintenance order, I'd like to track the tire models that are be...more >>

Correlated subqueries? Please help!
Posted by Paul Dussault at 5/25/2005 4:08:41 PM
Hi there, I want to do something very simple, but in the most efficient way possible. Let's say I have these two tables: tblContacts(contact_id, contact_name) tblPhones(phone_id, contact_id, phone_number, phone_rank) When querying my contacts, I need to get the phone numbers in tblPhones ...more >>

Distinct list
Posted by danlin at 5/25/2005 3:50:02 PM
Let’s say we have two tables with the following values: Table p1: Product Table p2: Product ------- ------- A B B C C D C D...more >>



Sorry for the dumb question, but...
Posted by Paul Pedersen at 5/25/2005 3:19:57 PM
.... why am I getting an error? This works fine: create table test (testid int identity (7567, 1)) But this: create table test (testid int) alter table test alter column testid int identity (7567, 1) gives the error: Incorrect syntax near the keyword 'identity'. Why? ...more >>

using format files for fixed width data source
Posted by Munch at 5/25/2005 2:40:01 PM
Suppose I have a .txt file as such: a111b222c3333 h999i1111r6666 I want to use bulk copy or bulk insert and I realize I need to create a format file, but there is no column deliminator in the file. column 1 has a len of 1 column 2 has a len of 3 column 3 has a len of 3 column 4 has a...more >>

need help to excute bcp statement
Posted by Bhaskar at 5/25/2005 1:55:05 PM
Hi, I getting the 'access denied ' error while executing the below bcp statement. i have access to the file location and able to open the file form my machine also. i am not sure why i am getting the access denied error. Could any body can throw light on this pls? BULK INSERT #Temp FR...more >>

WHERE trouble (I think)
Posted by Chris Lieb at 5/25/2005 1:28:01 PM
I have some code that I am using to import a flat file into a bunch of related tables. I am trying to make it so that new records are added to the related tables of a new value appears. However, my code thinks that every value is new and unique and creates a new entry for it. For example, o...more >>

openrowset question (T-SQL)
Posted by Joe Palm at 5/25/2005 12:06:01 PM
I'm trying to run a new stored proc that uses the OpenRowSet function. When I try to execute the stored proc (via Query Analyzer), I get this message: Server: Msg 7405, Level 16, State 1, Line 1 Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connect...more >>

NONCLUSTERED?
Posted by js at 5/25/2005 11:51:48 AM
CREATE NONCLUSTERED INDEX Hi, What's diff between NONCLUSTERED and CLUSTERED? thanks ...more >>

Dynamic Column Alias Name...
Posted by Diablo at 5/25/2005 11:36:02 AM
Hello All, Here is my question; I am trying to dynamically assign a Column Alias in a Select Statement to a variable, in which case the variable was assigned the value of another select statement??? This is a simplified version of what I am trying to do, but would compliment the results ...more >>

2 Counts from 1 table in one select
Posted by Nevyn Twyll at 5/25/2005 11:27:38 AM
I have a list of students' tests in a table [Tests]: School, Grade_tested, StudentID, Score I want a result set that gives me, for each school and grade, how many students tested, and how many passed. Students may have tested multiple times (and thus have duplicate ids in the source data). ...more >>

SQL Server Mobile 2005 Transactions
Posted by msmith NO[at]SPAM noemail.nospam at 5/25/2005 11:25:30 AM
The documentation sais it supports parallel transactions through ADO. Does anybody no anymore details on what that means? For example do the parallel transactions see what the other is doing and so forth. Or are they totally isolated transactions. Thanks Mike Smith --------------------...more >>

3 Table join question
Posted by Geoff at 5/25/2005 10:44:02 AM
3 Table join question. Here are 3 tables. T1 ----------- ID VAL A 0 B 0 C 0 D 0 E 0 T2 ------------- ID METER A 1 X 1 B 1 Y 1 T3 ----------- ID NUM B 2 H 2 R ...more >>

Where clause help
Posted by Warren at 5/25/2005 10:35:27 AM
Hi, I've done this before ,but forgotten. Can anyone help? I have a (varchar) column with some nulls in it. the rest of the values are in the datetimestamp form of MM/DD/YYYY/HH:MM:SS. I need to do a query to change all the nulls in this column to 01/01/2005 12:00:00. What does the w...more >>

36 digit number
Posted by Candor Feg at 5/25/2005 10:17:07 AM
Hi I have this column numbers as varchars. Length is 36 I need them to be numeric so I can run calcs on them I can't find a datatype that allows that. what the heck? thanks ...more >>

How to take big raw text in SP as a paremeter!...............
Posted by tom d at 5/25/2005 10:15:02 AM
Hi all, I have raw text like these: 'test1111111111111111111111111111111111 test2222222222222222222222222222222222 test3333333333333333333333333333333333 test4444444444444444444444444444444444 test5555555555555555555555555555555555' I want to create a SP that take these raw text as a pare...more >>

How to convert 5/20/2005 to string MAY05?
Posted by chrisben at 5/25/2005 9:36:10 AM
Hi, I try to query a table with one datetime field, while my parameter is in string format as MMYY(or MMMYY) as MAY05. How can I convert the datetime to this format and make a comparison in my query? Thanks for the help Chris...more >>

Calling WS from Sproc
Posted by Garth Wells at 5/25/2005 9:26:22 AM
The client wants to update Active Directory from a Sproc via a Web Service. I found an example in Google Archives, but it won't work...the call to a method generates the error listed below. Please note that a straight disco call does work. Wondering if it's a versioning issue. Thanks for any s...more >>

Grouping query
Posted by Griff at 5/25/2005 9:09:18 AM
Bit stumped by this one, any advice would be appreciated. I have two tables ([owner] and [cars]) which have a one-2-many relationship (i.e. one owner can own one or multiple cars, a car can have but one owner). The cars have several properties: number-plate, make, model, colour & fuel, so ...more >>

Count statement
Posted by tarheels4025 at 5/25/2005 8:45:24 AM
Below is a query. I have a question about the count case with an * in front of it. I'd like to count all id_code_1 = 'DB' and response_code <> '00' and where the id_number_1 are the same and the settlement_batch_num are the same. Can you have them equal each other or is there another way ...more >>

Error Description: 37000
Posted by Newbie at 5/25/2005 7:54:19 AM
Hello, Does anyone know how I can reslove this error message: VB Error: 40002 Generated by: MSRDO20.DLL Description: 37000 [Microsoft][ODBC SQL Server Driver] [SQL Server] Cannot open cursor-refereced object "name" during dynamic fetch. This error message is being generated in sql serve...more >>

Encryption and SSL and Email
Posted by SQL Brad at 5/25/2005 7:20:07 AM
I am running MS 2003 Server with SQL Server 2000 including SP4 which I installed yesterday. In addition, I have also installed SOAP Toolkit 3.0, SQLXML 3.0 SP3 and SQLNS 2.0 SP1....not sure how much of this is relavent to my question.... I am designing a web-page which sits behind an SSL.....more >>

future of English Query???
Posted by Kam at 5/25/2005 7:10:14 AM
I think English Query is a great utility, but I didn't hear anything about the improvement and enhancement in SQL 2005. Does anyone know the future of English Query? We should continue using English Query in the development or we should decommission it?...more >>

how to update a field for every row in the table,
Posted by Ann at 5/25/2005 6:49:23 AM
Hi, I have a temp table,which lists all products and how many customers bought the structure like this productID CustomerCount 1 100 2 80 there is another invoice table I need to update CustomerCount using a join of productID and invoice, Can I do i...more >>

Database Mirgration
Posted by Ed at 5/25/2005 6:31:04 AM
Hi, When I do the database migration from one server to another using attach deattach /backup Restore, do all the users and roles of the database automatically be migrated as well. I am under the impression that the users and roles are in Master database. Do I need to use Transfer Login...more >>

error 8152
Posted by nonno at 5/25/2005 6:31:01 AM
I read the Error Handling article by Erland Sommarskog, he said when ANSI_WARNINGS is OFF, assigning a char column a value that exceeds the max length of the column will not result any error. But I still get error 8152: String or binary data would be truncated, within a trigger, even I set A...more >>

Can a stored procedure use the OpenRowSet function to get DB2 data
Posted by Joe Palm at 5/25/2005 6:07:03 AM
If so, does anyone have an example? Background: We have a MSFT Reporting Services report that uses the OpenRowSet function to get both DB2 and SQL Server data in one SQL statement. Since userid and psw are parms to this function, it is not an option to hard-code them into the OpenRowSet p...more >>

Simple SQL--I think, but I CAN'T see it!
Posted by l.woods at 5/25/2005 5:50:29 AM
I have two tables: Table 1: ID as int Name as varChar Table 2: ID as int Val as varChar Key as varChar Table 1 - Table 2: 1-many; ID=ID I want ALL Name,Val values, based upon a given Key value, regardless of whether there is a value for Key or not. This looks to be a simple OUT...more >>

How can I obtain the tine via Query Analyzer??
Posted by Enric at 5/25/2005 5:03:17 AM
I know that that is a stupid thing but I can't remember it. thanks thousands...more >>

nested select
Posted by ofir at 5/25/2005 4:59:03 AM
is it possible to make this query right? SELECT name ,(select count(*) FROM NAME) FROM sysobjects WHERE xtype='U' I'm trying to get the list of the tables names from the current database and for each table to get it's rows number. I dont want to use functions. I need to do it in one query. ...more >>

Does all of WHERE clause get executed?
Posted by len at 5/25/2005 4:44:03 AM
Hi there. I have an update statement that wishes to update certain fields depending on a column that may or may not contain numeric values (the field is varchar but may contain '001', '002' etc. For the WHERE clause, I need to convert the MaybeNumeric field into an integer BUT... I know the...more >>

SQL-Server (2000) Insert Performance problem, large number of rows
Posted by stein at 5/25/2005 4:04:03 AM
Hi Any suggestion about how to optimize insert-performance for a VB6 application which inserting large number of rows in a table would be appreciated. 1. Table definition tuning ?? 2. ADO vs OLEDB vs ?? 2. Recordset.add vs SQL-Insert vs. "stored procedure" vs ?? We are making a...more >>

Populating SQL Server with Field Names & Values from Active Direco
Posted by Claire S at 5/25/2005 4:00:04 AM
Does anyone know how i can populate SQL Server with OUs, Usernames, Tels etc etc... from Active Directory.... I will then access this in SQL via ASP and also create additional tables in the SQL DB. Any help at all will be helpful thankyou Claire ...more >>

database cleanup
Posted by nonno at 5/25/2005 12:14:01 AM
is there any SQL statement that can clear all rows in each table in a database?...more >>

TSQL Case Statement with multiple criteria in SQL 2K
Posted by Steve House at 5/25/2005 12:00:00 AM
I have a case statement that works in SQL 2K but seems a bit kludgy. How do I express a case statement in TSQL with less verbage than what I have? CASE (Type) WHEN 'T3' THEN InitialPremium WHEN 'T6' THEN InitialPremium WHEN 'T8' THEN InitialPremium ELSE 0 END AS LostPremium. All of the exampl...more >>

Unique listing select statement ... stuck.
Posted by Rick at 5/25/2005 12:00:00 AM
I am really stuck on something I think may be a simple query for many. Here is the table structure: StateAbbr Code VA 22180 VA 22180 VA 22182 VA 20151 MD 30001 MD 30002 DC 20002 I am trying to ...more >>

DMO
Posted by Frank Ashley at 5/25/2005 12:00:00 AM
Although this is a client side issue (VB.NET) I was wondering if anyone could help. I'm iterating through the stored procedures for the names but its missing some out and duplicating or triplicating others. The count of sprocs is correct, does this mean that a sql system table is incorrect. ...more >>

Deleting transaction log file
Posted by Tor Inge Rislaa at 5/25/2005 12:00:00 AM
Deleting transaction log file Is it OK to delete the transaction log file and create a new one after I have done a successful backup of both the database and the transaction log. My problem is that the size of the file is unrestricted in file growth. When I try to restrict the file growth ...more >>

Help to deleting n numbers of records
Posted by Steen Persson at 5/25/2005 12:00:00 AM
Hi One of our users have by mistake created a number of dublicate records in the database. Now I need to delete the "faulty" records from the table and just keep one of them. The records are linked to a customer table, so I have a Recordid column in the table that I can use to group on. E.g...more >>

database's default fill factor?
Posted by js at 5/25/2005 12:00:00 AM
>>Shows the fill factor that specifies how full each index page can be. If a >>fill factor is not specified, the database's default fill factor is used. Hi, what's database's default factor? ...more >>

create DTS programmly
Posted by ofir at 5/25/2005 12:00:00 AM
is it possible to create DTS programmly and is there a real file for each DTS in my SQL SERVER? Regards, Ofir ...more >>

translating integers to labels
Posted by Jason at 5/25/2005 12:00:00 AM
hi, I have a view where some columns are integers. In another table i have the description of the integer value. How can retrieve all records on one side if no integer is available and have records returned which do have a integer ...more >>

A simple loop
Posted by Lasse Edsvik at 5/25/2005 12:00:00 AM
Hello Was wondering if you guys could show me how to do a simple loop, Im trying to execute a sp and pass the parameter CustomerID as parameter from the select im looping through /Lasse ...more >>

select on column index (not column name)
Posted by Soeren S. Joergensen at 5/25/2005 12:00:00 AM
Hi, I need to write some procedures where, up front, I don't know the names of columns to be included in some select statements, I only know the column index's. How is this done ?? Soren ...more >>

Query returns results that vary from one run to another, a bug?
Posted by Berend de Boer at 5/25/2005 12:00:00 AM
Hello All, Have a serious problem with SQL Server 2000 SP3 and 4. This query: select "id_node" from "node" where "parent_node" is not Null and "parent_node" not in (select "id_node" from "node") returns all kinds of different answers. Sometimes it returns 0 ro...more >>

Storing ranges in a table
Posted by ninel gorbunov via SQLMonster.com at 5/25/2005 12:00:00 AM
I work for a telemarketing company. They pay their reps based on the rep's total calltimes. I have the following payrates that I need stored in a table: Level PayRate Range 1 $6.15 1st 20 hours of dialing 2 $8.50 From 21st hour of dialing to the 90th day o...more >>

SMTP mail
Posted by MAQ at 5/25/2005 12:00:00 AM
Hi, I want to send emails from MSSQL server. But as i understand, we need a mail client with mail profile configured, and sql services should be running under the same user. BUT. we only have access to an SMTP server sql services has to run under localsystem account. no pop3 server is a...more >>

all stored procedures are user stored procedures
Posted by Thomas Berg at 5/25/2005 12:00:00 AM
Looking (in Enterprise Manager) at the stored procedure list of a database yesterday, I noticed that all the procedures were listed as "user" procedures, including dt_addtosourcecontrol and the like, which are usually system procedures, and on every other database on the server are system pr...more >>


DevelopmentNow Blog