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 > may 2005 > threads for thursday may 19

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

ROWNUM In Oracle
Posted by Renjith at 5/19/2005 10:51:02 PM
Is there any way to implement ROWNUM in Oracle to select row no. Is there any way to select the row no when retrieving records as 1 Tv 2 Fridge 3 Radio...more >>

Format a string
Posted by Mohd Sufian at 5/19/2005 10:03:01 PM
Hi all, My company haa a big detabase and i am working on a marketing and sale report. i had lot of junk data like: D-CAB PZTN4-3553-01 TOYOTA,Plate Hook A,7.0mm,(SET) TOYOTA LINER D-CAB (PZO53-0K003), Plate, Robot Hook A, 7.0 MM. i want to take out only ( D-CAB) but i coudnt make it from the...more >>

permissions for user to rename a table
Posted by Tarren at 5/19/2005 9:57:52 PM
What permissions must I grant to allow a user to rename a table? I have my stored procedure rename a table when it is done, but it fails and says the user does not have permission. Thanks ...more >>

Is it possible to select * from StoredProcedure into #tmptable
Posted by Joe at 5/19/2005 7:48:38 PM
Is it possible to do something like this? select * into #tmptable from sp_executesql... ...more >>

Newbie, Howto create trigger to delete an external image file
Posted by robdob2003 NO[at]SPAM yahoo.com at 5/19/2005 6:51:05 PM
Hello, I'm using SQL2000 and I have a table which has a field within it called "ImageFileName", what I would like to do is create a trigger to automatcially delete the disk resident image file that is contained within the "ImageFileName" field of the table upon the deletion of any of these...more >>

DTS for Import Export TO And From EXCEL
Posted by Prabhat at 5/19/2005 6:42:28 PM
Hi All, I want to design a DTS Package that will read an EXCEL Document (One Data Source) and ONE SQL Server (2nd Data Source) and Execute one Query which will have a JOIN from Both the source and Export the result to another Excel Document. How Can I perform that using DTS? I have took ...more >>

Stored Procedures and temp tables
Posted by Joe at 5/19/2005 6:30:06 PM
I have a stored procedure that calls several other stored procedures. Is there anyway that a stored procedure can access a temp table created by another stored procedure? ...more >>

Handling Errors
Posted by Dave at 5/19/2005 4:54:41 PM
Is it possible to handle an FK violation error in SQL Server 2000? IOW, if I encounter this error, is it possible for the code in my proc to execute alternative code rather than immediately exiting with an error message? I can write code to always test for a FK violation before I try to inse...more >>



DROP Temp table and creating not working ... any reason...
Posted by Rajesh at 5/19/2005 3:12:01 PM
if exists (select * from sysobjects where id = object_id('#Tab1')) begin print 'Dropping old version of table: #Tab1' print '' drop table #Tab1 end CREATE TABLE #Tab1 ( StateCd CHAR(2) , AvgMonths INT ) Is any problem with the above code .. ...more >>

Calling program from SQL Stored Procedure
Posted by Monster T at 5/19/2005 3:06:04 PM
Hello, I don't know if this can be done, I'm not an SQL Server expert; But can you start a program ( VB app ) with a stored procedure. For instance if a record is written to a sql table then a trigger could be set to start a vb app from sql???? I'm trying to come up with a way to recogn...more >>

Differential Backup Script
Posted by Joe K. at 5/19/2005 2:37:13 PM
I would like to test if the day is Sunday (listed below), if 'YES' then delete the files in the directory with following critieria (E:\NewOrleans\*FULL.BAK) and create a new full backup file. If 'NO' (Sunday) create check to see if a E:\NewOrleans\*FULL.BAK file exist if 'NO' (E:\NewOrlea...more >>

table as an argument to a stored procedure
Posted by tygrus at 5/19/2005 2:28:59 PM
Is it possible to pass a table to a stored procedure as an argument? ...more >>

Query, help with where clause to reduce resultset
Posted by ted at 5/19/2005 2:19:58 PM
I need some help with the @LanguageId part of this query to exclude/include rows to be returned. ctbl_content_rel can contain rows with different language ids, e.g 'dk' and 'nn'. If rows with the specified @LanguageId exists, then I want only those rows, otherwise I want only the 'nn' rows...more >>

fn Now()
Posted by rkasse at 5/19/2005 1:58:05 PM
SELECT {fn NOW()} SELECT GETDATE() Both return the current datetime but I cannot find a reference anywhere to fn Now(). Can anyone explain what fn NOW() is? Ron...more >>

SQLAgentMail
Posted by Todd Bright at 5/19/2005 1:32:02 PM
I've configured my SQL Mail profile in SQL Server. In SQL Server Agent Properties it shows me my profile. I choose my profile (the same one that tested successfully in SQL Mail) and press 'Test' and I get the following error message... "Error 22022: SQLServerAgent Error: Unable to get th...more >>

Sql to Update every other
Posted by JLS at 5/19/2005 12:58:02 PM
I have a query that shows me which records will be duplicate; (Database schema is changing in next version, and the last column is no = longer part of the key structure, therefore, duplicate.) Query: select a.gl_cmp_key, a.sl_ledger_key, a.sl_acct_keyvalue1, = a.sl_dist_key, a.sl_dist_seqno ...more >>

SQL Procedure Encryption Question
Posted by Mark at 5/19/2005 11:51:10 AM
Hi All: I am curious to know how SQL Server Procedure, View and other DB Object encryption work at the architecture level. Does SQL Server call any DLL or EXE off the bin directory for text encryption or what? Reason why I am sking this is we all know that SQL Server encryption can be easily ...more >>

Metadata for SP parameter default values
Posted by Joel Reinford at 5/19/2005 11:13:55 AM
I am looking for a way to list any default values for stored procedure parameters. For example with this stored procedure: CREATE PROC dbo.pr_GetSomeData ( @SomeInt int, @AnotherInt int = 0, @SomeDate datetime = NULL ) I'd like to be able to create a table that would look like this ...more >>

[OT] Network cables
Posted by Mike Labosh at 5/19/2005 10:49:29 AM
I just absolutely had to share this. The below email just arrived at our helpdesk from one of the suits upstairs: <suit> Just a quick one. When I hooked up my PC I plugged in grey cable that was about 20 feet long. It works but I'm wondering if I really need a proper Ethernet cable (usual...more >>

Help w/ a SQL Query
Posted by George Durzi at 5/19/2005 10:46:58 AM
In a sales software system that I built, a sales person belongs to a department within the company. However, during their employment with the company, they might work in several departments. So I implemented department logging in the system. CREATE TABLE [USER_DepartmentLog] ( [UserId] [i...more >>

Auto Incrementing field
Posted by macca via SQLMonster.com at 5/19/2005 10:45:59 AM
I have a asp.net form which is for orders with a field for numbers in it. What I want is when a user raises a new order the Order number field will be populated automatically with the next order number. I want this order number to be incremented on the database table. The order number is of the...more >>

Simple concatenation not working...
Posted by Matt at 5/19/2005 10:38:51 AM
Hi all, I am trying to do the simplest of concatenating... select lastname + ', ' + firstname from usertbl (example right out of BOL) however, I alwyas get: "Syntax error converting the varchar value 'Adkins' to a column of data type smallint." Something not set right on the serv...more >>

Long Running Queries in Procedure
Posted by Derek Fisher at 5/19/2005 10:35:22 AM
derek@programmer.net May 19, 12:57 pm show options From: "d...@programmer.net" <d...@programmer.net> - Find messages by this author Date: Thu, 19 May 2005 09:57:29 -0700 Local: Thurs,May 19 2005 12:57 pm Subject: Long Running Queries in Procedure Reply | Reply to Author | Forw...more >>

Argument data type ntext is invalid for argument 1 of rtrim function.
Posted by Touchring at 5/19/2005 10:07:04 AM
Hi, i'm getting this error after switching a field, outcontent from VARCHAR to NTEXT. select * from loglog where (ltrim(rtrim(outcontent))<>'') go Argument data type ntext is invalid for argument 1 of rtrim function. Can someone help advise how i should removed spaces from a field return...more >>

Difference between unique constraint and primary key
Posted by Ray5531 at 5/19/2005 9:51:26 AM
Hi, Functionality wise is there any difference between unique constarint and primary key? thanks ...more >>

Create Tables or Views in a Store
Posted by Danky at 5/19/2005 9:35:25 AM
Hello, Buddies Anybody Know if is possible to create tables or views in a store procedure? and if it is, Has it exceptions? where I can find references? Thanks in advence...more >>

Text files into SQL
Posted by Mal at 5/19/2005 9:34:03 AM
Hi I need to upload and XML file into SQL. I cannot use openxml beucause it's a relational xml file. I cannot get enough info on sqlxml to use that so I'm uploading it via xp_cmdshell via dos command "type" . This text I insert into a table and apply whatever manipulations on it. The pro...more >>

DTS in SQL Server Workgroup or Personal Edition?
Posted by ChristyWarner at 5/19/2005 9:23:18 AM
Hi, I see that DTS is not available in the Workgroup edition of SQL server. Does anyone know if it's available in the Personal edition? If DTS is not available in an edition of SQL server, can I still use DTSPUMP functions in VB on the SQL server? Thanks in advance, -- Christy Warne...more >>

Making a 'sort-of' unique ID field
Posted by darrel at 5/19/2005 9:16:15 AM
(I posted this in another newsgroup and it was recommended to me that I post in here) OK, that's an odd subject line. Let me try to explain what we have in our table: item language collectionID GUID the form1 english 1 5 el form1 spanish 1 ...more >>

does sp_xml_concat work
Posted by woody hagar at 5/19/2005 9:01:23 AM
Hi All, I am trying to get the sp_xml_concat (http://www.awprofessional.com/articles/article.asp?p=102307&seqNum=16) to work will no luck. Here is the errors I am getting: Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near '('. Server: Msg 137, Level 15, State 1, Lin...more >>

Data security/filtering on field values
Posted by Guy at 5/19/2005 8:57:57 AM
My team is developing a new software system that is replacing several existing applications. The applications being replaced focus on billing and customer relationship management. Our company is an international corporation that serves a large number of customers (hundreds of thousands) sp...more >>

sp_helpserver Question
Posted by Todd Bright at 5/19/2005 8:39:02 AM
I've got a SQL job I've set up that I'm issuing a call to 'sp_helpserver' in to determine if a given remote server is linked with the local server. If the remote server is not linked at the time of the call, I get an error... 'The server 'dbserver' does not exist. Use sp_helpserver to show a...more >>

group by
Posted by shine at 5/19/2005 8:15:26 AM
I've created a table containing columns date, cost, orders etc. I want to write a query group by the month part of the date. Is it possible to write it. if yes how. Any suggestion would be greatly appreciated. regards shine...more >>

group by
Posted by shine at 5/19/2005 8:15:18 AM
I've created a table containing columns date, cost, orders etc. I want to write a query group by the month part of the date. Is it possible to write it. if yes how. Any suggestion would be greatly appreciated. regards shine...more >>

Row by Row Processing
Posted by Lyners at 5/19/2005 7:44:03 AM
I am trying to create a procedure within SQL Server 2000 that will update a table for viewing over our intranet(nightly process). The final output will show current balances within accounts. The way the logic works for calculating the accounts is that the accounts are allocated by years. ...more >>

connecting nodes and calculating paths
Posted by Richard Wilde at 5/19/2005 7:00:59 AM
I have an interesting problem where I need to calculate paths between connecting nodes. For example:- Node 1 is connected to Node 2 Node 1 is connected to Node 4 Node 2 is connected to Node 3 Node 3 is connected to Node 4 Want I need to return if I search connections between these two ...more >>

Schema question -- storing paths through a graph
Posted by Julian at 5/19/2005 6:58:13 AM
I'm modelling an approval process as a graph. Each node represents a stage in the approval process and each edge represents a transition from one stage to another. To move from one stage to another requires someone to take an action. To define who can do what at each stage, each transition is ...more >>

identify rows (for cleanup) with special characters
Posted by The Gekkster via SQLMonster.com at 5/19/2005 6:40:18 AM
Hey all, I need to do a bit of cleanup on some existing data that includes special characters (e.g. '@', '#', '<', '%' etc). If the column holds anything other than a-z and 0-9 then I need to change it. The column in question is varchar (100). UPDATE tbl1 SET col1 = NULL WHERE col1 (???) ...more >>

How to define a description for the table in SQL like in Access
Posted by karenmiddleol NO[at]SPAM yahoo.com at 5/19/2005 6:17:40 AM
In Access our users are able to define descriptions for the tables and views(queries). We migrated a few Access applications to SQL Server and our users are asking for the same functionality against the SQL Server tables and views they could define descriptions. I see we can define description...more >>

Database transfer
Posted by Philip Germanos at 5/19/2005 4:52:02 AM
hello, I have my database server environment on the same pc where i have my development environment because i am still in the testing mode, but when i want to switch to the production mode, i want to install my db server on a separate computer so that clients can use the application. The ques...more >>

Restore Database from MDF file without LDF
Posted by Shansinn at 5/19/2005 4:45:21 AM
Shansinn wrote: > *Iam having SQL Database MDF file how can i restore the database > without LDF.Please anyone reply me and this is very very urgent * -- Shansinn ------------------------------------------------------------------------ Posted via http://www.codecomments.com ----------...more >>

Restore Database from MDF file without LDF
Posted by Shansinn at 5/19/2005 4:43:55 AM
Iam having SQL Database MDF file how can i restore the database without LDF.Please anyone reply me and this is very very urgent -- Shansinn ------------------------------------------------------------------------ Posted via http://www.codecomments.com ----------------------------------...more >>

Store Procedure to extract string tokens
Posted by mbellardi NO[at]SPAM ferraniait.com at 5/19/2005 4:39:06 AM
Hi everybody, i need to write a store procedure thar recive as input a string composed in this way: TEXT1.TEXT2.TEXT3.......TEXTn Store procedure has to extract TEXT1 TEXT2 and so on, then use those single strings to various purpouse. can someone show me the manner to tokenize string ind...more >>

Allocate Range of AutoNumber ID's to each user
Posted by MarkCapo at 5/19/2005 2:39:08 AM
I have a non standard requirement that about 5 different users from different departments require sequential numbering for there records, however I want all records to be in the one central table. This comes about as each departments records ID's have a 4 letter acronym before the AutoNumber ...more >>

Problem with query(difficult aggregation)
Posted by Leila at 5/19/2005 1:19:17 AM
Hi, In northwind DB I calculate the total value of orders for each customer by this query: select o.customerid,sum(od.unitprice*od.quantity) as s from [order details] od join orders o on o.orderid=od.orderid group by o.customerid Now I want to know which customer has been the best in ...more >>

keyword search in dynamic stored procedure
Posted by pagino NO[at]SPAM pagino-dot-com.no-spam.invalid at 5/19/2005 1:02:09 AM
Hello Gang . I have a dynamic stored procedure which needs to be able to process a part of it's search a form field which may contain several word seperated by a space. ie: earth diamonds brazil ocea My dynamic stored procedure works great, right now the paramete containing the form input is a...more >>

Select Textpointer on a word in a text typedata field
Posted by Christian Perthen at 5/19/2005 12:11:51 AM
Hi, Quick question I have problem getting the pointer position on a word in a text typedatefield. I am getting the error "NULL textptr (text, ntext, or image pointer) passed to UpdateText function.' ..... SELECT @Bptr = textptr(strData), @Bpos = charindex('replaceText' , strData)-1 FR...more >>


DevelopmentNow Blog