Groups | Blog | Home


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 > december 2003 > threads for wednesday december 24

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

Multiple date occurrences.
Posted by George Morton at 12/24/2003 10:46:40 PM
I want to be able to delete CUSIPS whenever there are multiple CUSIPS and to retain the latest price. (Column names are Price_Date, Price, and CUSIP). TIA. George. ...more >>

select case return rows in one row (how to group by three column)
Posted by yusuf tulgar at 12/24/2003 8:25:40 PM
I got a question. how can I get this three column in one row ? OTOMATIK_TOPLAM,MANUEL_TOPLAM,NOBET_TOPLAM it returns like this: .. .. BEYHAN,1,NULL,1,NULL BEYHAN,3,3,NULL,NULL DÜNYA,4,NULL,4,NULL DÜNYA,2,2,NULL,NULL .. .. but I want this result like : .. .. BEYHAN,4,3,1,NULL ...more >>

UDF Calling Method
Posted by John De Lello at 12/24/2003 8:12:23 PM
Hey everyone, I am working on an application (PowerBuilder client) that is being developed to be able to run against MS SQL or Sybase ASA. The problem I am running into is that MSSQL requires me to call a UDF prefaced with the owner and ASA does not. What's worse is that the owner in ASA is "d...more >>

image files in SQL
Posted by CRChisholm at 12/24/2003 7:15:39 PM
I need to get employee mug shots into a MS-SQL 2000 table. Given the following structure CREATE TABLE [pictures] ( [empno] [char] (9) NOT NULL , [pic] [image] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] and assuming I have a bunch of jpg files like "12345.jpg" located on \\SERVERHR\EMP\...more >>

Error changing part of the primary key referencing the same table
Posted by Stephan Brunner at 12/24/2003 5:05:58 PM
Hi I get this error when I try to update one part of the primary key in a self referencing table: UPDATE statement conflicted with TABLE SAME TABLE REFERENCE constraint .... What is the best strategy to handle this? Sincerely Stephan Brunner ...more >>

Autoincrement id for newly inserted records returns blank
Posted by Anupam Agarwal at 12/24/2003 3:57:44 PM
I am adding a new record to the database using the following code: RecordId = "someid" Const adOpenKeyset = 1 Const adLockOptimistic = 3 Const adSearchForward = 1 Const adBookmarkFirst = 1 Set Conn = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.Recordset") Conn.Ope...more >>

Row generation w/out records
Posted by Colin Basterfield at 12/24/2003 2:32:39 PM
Hi, I have a query in a stored proc which I have separated out from the original to avoid confusion: select case datepart(dw, max(wet.total_date)) when 1 then 'Sunday' when 2 then 'Monday' when 3 then 'Tuesday' when 4 then 'Wednesday' when 5 then 'Thursday' when 6 then 'Frid...more >>

changinh DB of stored procedure
Posted by David Potahisnsky at 12/24/2003 2:06:01 PM
I have a stored procedure that as one of parameters receiving the database. I need to change the database that SQL statement in store procedure working on according to parameter. I cant find any solution except fill naming and rewiring whole statement depend on parameter or building SQL statem...more >>



OPTION (KEEPFIXED PLAN)
Posted by sap at 12/24/2003 1:42:19 PM
Is it a good idea to write OPTION (KEEPFIXED PLAN) whenever we select data from temp table, table variables. e.g. SELECT @spidlen = convert(varchar(5), isnull(max(len (ltrim(str(spid)))), 1)), @ecidlen = convert(varchar(5), isnull(max(len (ltrim(str(ecid)))), 1)), @l...more >>

SET DEADLOCK_PRIORITY LOW
Posted by san at 12/24/2003 1:25:15 PM
I came across this command SET DEADLOCK_PRIORITY LOW and is curious to know that would it help in avoid deadlocking. happy hoolidays. ...more >>

Expert help needed
Posted by grichardomi NO[at]SPAM yahoo.com at 12/24/2003 12:31:36 PM
table 1 APP_ID 1 3 table 2 APP_ID Profile_NUM 1 001AAA 2 001AAA 3 001AAA 1 000A223 2 000A223 1 01A345 2 01A345 1 0909 3 0909 5 BASS1 6 BASS1 7 BASS1 I would Like to perform the following: . read table 1 . match table 1 against table 2, using App_ID colum...more >>

Group By Week
Posted by don larry at 12/24/2003 12:10:28 PM
Greetings All, Please see comments below CREATE TABLE TblA (Source varchar(10), OrderDate datetime, SKU varchar(3), NetSales money) INSERT INTO tblA (Source, OrderDate, SKU, NetSales) VALUES ('Web', '01/01/2003', 'ABC', 20) INSERT INTO tblA (Source, OrderDate, SKU, NetSales) VALUES ...more >>

SELECT DATE
Posted by hngo01 at 12/24/2003 10:54:00 AM
Hi All, I have table: admitdate is datetime type LastName FirstName admitdate ln1 fn1 01/02/2003 ln2 fn3 01/01/2003 THIS IS MY SELECT STATMENT: select convert(varchar, admitdate,101) from tblscc4 where convert(varchar, admitdate,101) < convert (varchar, '01/03/1999',101) ...more >>

SQL Mail
Posted by kb at 12/24/2003 10:41:05 AM
I got references here before on how to configure SQL mail. I've read everything I can find, configured the system the way it says to (Sql running on a domain account with admin rights, SP3a installed, Outlook 2000 installed and running under the same logon. When I go to support services and try t...more >>

TSQL: In need of business logic solution
Posted by Culam at 12/24/2003 10:27:46 AM
Hi, I am looking for TSQL Codes for the following business logic: if Account with same acct, no and has only two transactions then evaluate the final decision: Accept and Review --> Accept Accept and Accept --> Accept Review and Decline --> Decline Review and Review --> Review If acc...more >>

Update Table ...
Posted by billkellaway NO[at]SPAM hotmail.com at 12/24/2003 10:22:48 AM
I have two tables in the same db. Jobs and ImportedJobs. The ImportedJobs contains jobs that will update multiple records and multiple fields in the jobs table. I can't seem to get this work with even updating one field - I need to potential update all of the fields ... Here's where I'm a...more >>

charindex
Posted by Li at 12/24/2003 10:19:51 AM
I'm using SQL Server 7. How do I use charindex to search a single quote in a varchar field? The following syntax didn't work: select charindex('li''s book','''')...more >>

How many total bytes?
Posted by Simon at 12/24/2003 9:40:08 AM
Somewhat new to MS SQL 2000 I have a column that's varchar(4000) and I'd like to write a query that tells me how many total bytes I'm using for a particular column for all rows in my database. For instance, if I have 5 rows, that means I could be using a possible total of 20,000 bytes (5...more >>

long text input in EM or QA
Posted by Amitai at 12/24/2003 9:09:39 AM
Hi Everybody, I was using Oracle with PL/SQL developer for few years and now started a project with SQL-Server 2000 (MSDE server with SQL-Server client tools, to be exact). I am using the "enterprise manager" and "query analyzer" interfaces. I declared a field of "varchar(8000)" and tried to pa...more >>

View with a cumulative sum column
Posted by LMM at 12/24/2003 9:01:05 AM
How do I create a view with a cumulative sum column? For example a table has a clolumn with with deposits and withdrawels and I want a view that will be used to show a register of transactions with a culumn for the running balance of the account. Thanks much for any help!...more >>

@@error issue
Posted by Manoharan at 12/24/2003 8:35:02 AM
I have a main stored procedure which has a statement like LinkedServer_name.master.dbo.xp_msver. If that fails because of any linked server issue,it doesn't return the error number and I couldn't capture the error number. I would like to continue executing the main stored proc even if the l...more >>

Incorrect syntax near 'ITEM-DESCRIPTION'.
Posted by john at 12/24/2003 8:14:06 AM
Need help. Get the error that the last line has incorrect syntax - but I can't figure out what is wrong with the syntax. Thanks John CREATE FUNCTION "aaaFind duplicates for PO-ITEMS" () RETURNS TABLE AS RETURN (SELECT TOP 100 PERCENT "PO-ITEMS"."ITEM- DESCRIPTION", "PO-ITEMS"."PO-NU...more >>

How to delete all but "n" most recent records
Posted by Tom Roach at 12/24/2003 7:52:26 AM
Sorry for the mundane nature -> presumption of this request, but it's crunch time and my Beginner's SQL manual is still at home unwrapped under the tree: INSERT trigger needs to delete all but the most recent "n" records (say n=100) each time it runs from the trigger(ing) table, which has DateT...more >>

Sql Agent job Data HELP!!
Posted by chenthor at 12/24/2003 7:38:01 AM
I need to gather stats on a sql agent job. I would like to grab the same data that comes from EM -> management->sql agent->jobs->view job history. I am having difficulty finding where the duration time is generated. In msdb..sysjobsteps, there is a column named "Last_Run_Duration", but it i...more >>

TSQL Debugger active instruction line
Posted by Patrick.Simons NO[at]SPAM intecsoft.com at 12/24/2003 4:07:38 AM
I'm using TSQL Debugger from the Query Analyzer for SQL Server 2000 SP3. Sometimes I got the following problem: the instruction pointer (yellow arrow) does not always correspond with the exact line from the source code for the stored procecure i.e. the instruction point is on line 21, which is ...more >>

Unicode in WHERE clause
Posted by Jim Cutler at 12/24/2003 3:51:08 AM
I'm getting strange results when using a WHERE clause on a Unicode (nvarchar) column with ADO 2.8, VB6, and SQL Server 2000 I created table Test with two columns: pKey(int) and nvc1(nvarchar(1)). I have an index for each of the columns. For the test, I inserted rows for all i from x0001 to xd7ff ...more >>

listavailablesqlservers() only returns default instances - please help!
Posted by rearwindow at 12/24/2003 3:30:46 AM
Hiya, I'm trying to write an application in which I call listavailablesqlservers() (using SQLDMO). My intention is to get a list of all available sql server instances available on the network (including the machine on which the app is running). However, listavailablesqlservers() seems to retu...more >>

listavailablesqlservers returns only default instances - help!
Posted by rearwindow at 12/24/2003 1:54:57 AM
Hiya, I'm trying to write an application in which I call listavailablesqlservers() (using SQLDMO). My intention is to get a list of all available sql server instances available on the network (including the machine on which the app is running). However, listavailablesqlservers() seems to retu...more >>

zip sp or xp
Posted by Wayne Sheffield at 12/24/2003 1:50:19 AM
I need to zip up a file from within a sp. The resulting file needs to be pkzip compatible. This needs a compression routine that has free distribution for our clients. Does anyone have, or know of, a sp or xp that meets these requirements? Thanks, Wayne Sheffield ...more >>


DevelopmentNow Blog