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 > april 2004 > threads for thursday april 1

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

How to Search New line character in a column
Posted by Sumit Jain at 4/1/2004 11:12:41 PM
Hi, I have data in a table and have New line character in some of the columns, but i am not finding a way or query which searches New Line character in that column. I tried Using char(13) , char(10) etc. but cant succeed. Can anyone suggest me a query or where clause which searches for Ne...more >>


How can I tell if the SQL Statement was successful in MS SQL Server program
Posted by Ravi at 4/1/2004 10:44:29 PM
In DB2, SQLCODE = 100 and SQLCODE = 0 are the key validations one would make after an SQL statement to see if the query was run successfully or not. If the query returned any rows or not. Is there an equivalent syntax in MS SQL ? ...more >>

Help with Stored proc speed
Posted by Willie Neal at 4/1/2004 9:32:35 PM
I have a Stored procedure which includes several Table variables which have joins to other table with in the database. What is my best strategy to aid in the stored proc's speed. Thank you ...more >>

Using SQL to talk to COM objects. It works, but I have questions!
Posted by JT Lovell at 4/1/2004 9:24:53 PM
I wrote a small DLL to convert RTF text to plain text and then wrote the = following SQL script to execute it for one row (this works): -------------------------------------------------------------------------= -------------------------------------- /* run this part once to create and populate...more >>

Counting items and returning values
Posted by Andrew Banks at 4/1/2004 9:03:12 PM
I have a table of product orders. It contains a row for "platform" and I need to return how many times each platform is listed in the DB Example data for platform could be: XBOX XBOX XBOX PLAYSTATION PLAYSTATION GAMECUBE PLAYSTATION I'd like the data to be returned as XBOX - 3 PLAY...more >>

Table locks
Posted by Rajesh Kumar Choudhary at 4/1/2004 8:06:03 PM
I wanna to find out tables names which are locked by any process.Also the process name also ...more >>

Classes Element
Posted by Sal.hijazi NO[at]SPAM oxon.com.au at 4/1/2004 6:19:16 PM
Can I use the Classes Element to affect the outcome of a report; my understanding is that this class can call classes during report initialization; based on the outcome of my classes I want to either permit the report to run or cancel the opening of the report. Thanks...more >>

help with query
Posted by Jen at 4/1/2004 6:06:05 PM
Hi I am struggling to write a query. I have 2 tables transaction and detail. one transaction could have 1 or 2 details with it. transaction transaction i first nam last name emai addres telephon detail: (if a transactin has 1 detail amount and fee both have data, if a transactin has 2 deta...more >>



loop question
Posted by chris at 4/1/2004 5:31:04 PM
hi how can i create a loop to run 7 times? i want to execute a procedure 7 timesand then store the outputs in a table? is there a 'for' loop for this thanks...more >>

Table Sizes
Posted by Mark Scholes at 4/1/2004 4:57:05 PM
Hi, I need to find the table size of all the tables in a database. I have seen a query to do this, but I cann't recall where it was, can any one help. Thanks MarkS...more >>

Using Results from one SP in another
Posted by Ian Kelly at 4/1/2004 4:55:43 PM
Hi there, I realize I can do this with multiple select statements in one stored procedure, but was wondering if the following is possible. Create procedure GetCustList @DesiredDate datetime AS SELECT CustID FROM [Orders] WHERE [Order Date] = @DesiredDate GO __________ Create Proced...more >>

concatenate names
Posted by shank at 4/1/2004 4:51:00 PM
How can I query 2 columns like the following and get results like the below? In short, I want to concatenate the FirstNames into one field. thanks! FName LName ------ ------ Tom Smith Bill Smith Jane Smith Suzy Smith Betty Smith Frank Smith...more >>

stored procedure using bcp
Posted by mcr at 4/1/2004 4:41:03 PM
I am trying to get an xml query output to a file usin a stored procedure and bcp. The filename needs to be i yyyymmdd format. I keep getting an error Can someone help me with this , I think it may just be a quote in the wrong place. thanks, mc -------- CREATE PROCEDURE sproc_GetXML_tes...more >>

Is Copying multiple tables possible without cursors?
Posted by Dan at 4/1/2004 4:25:46 PM
I need to be able to copy parent rows and their child rows into the same tables and set the new child's ParentID to equal the newly copied parents . How would I do this without using cursors? CREATE TABLE ParentTbl( ParentTblID int IDENTITY(1,1), Name varchar(50), CONSTRAINT PK_P...more >>

help for join
Posted by Terry at 4/1/2004 4:22:40 PM
( accessing a access 2000 database) I am attempting to write a sql select statement. The competitor table has two fields which link to data in two other tables. Fields in the rider table and fields in the bracket table. First I tried joining one table as in the following: SELECT c.cmp_ag...more >>

Insert Trigger help needed
Posted by Totto at 4/1/2004 4:10:29 PM
Hi Need some help with a trigger. Here is what I want to do: I have a table that is updated once every day. The table consists of two fields; TotalHours, TotalHoursLastDay. When there is inserted a new record only the TotalHours is added. In the trigger I whant to update TotalHoursLastDay for ...more >>

Customized Error Message
Posted by Amin Sobati at 4/1/2004 4:08:02 PM
Hi, I have a table like this: CREATE TABLE Table1 ( [ID] int NOT NULL Primary Key) After inserting some records, obviously when I try to update all records to a particular value, SQL server raises an error (number 2627) that indicates the "Violation of PRIMARY KEY constraint" ha...more >>

Stored Procedure
Posted by Joseph at 4/1/2004 4:01:06 PM
I have one stored procedure that runs very slow. It takes several parameters and does a bunch of calculations and returns a recordset CREATE PROCEDURE report @param1 char(8) @param2 char(8) @param3 char(20) @param4 char(2 A ... ... ... SELECT ...... FROM .... G EXECUTE report "...",...more >>

Problem with trigger and if statement
Posted by ThunderMusic at 4/1/2004 2:41:09 PM
hi, I have a trigger on the table 'Issue' when it is updated. Actually, what it should do is pretty simple but I can't manage to make it work correctly. When a field is updated, I want the trigger to insert a new record into the table 'Issue_History'. What is does now is correct in 3 cases out of...more >>

SIMPLE, SHORT AND EASY: Constant values
Posted by Kevin at 4/1/2004 2:17:44 PM
Hi, What is best way to create constant values which can be used for calculation in different store procedures, queries, etc. Eg. I'd like to define price for 1MB and then do something like this: SELECT (file_size+mail_size)*PRICE_FOR_MB As price FROM DataTable WHERE userID=1234 I try to use...more >>

Parent/Child concept in SQl tables - How do I
Posted by Mark Andrews at 4/1/2004 2:16:34 PM
What is the best approach to pull information from a table which has an ID and a ParentID? For example one table which desribes a directory tree structure: Department/MIS/DesignDocuments/MyDoc this would be 4 records in one table: ID ParentID Desc 1 0 Department...more >>

Table Link
Posted by Max at 4/1/2004 1:58:55 PM
Hi, how can i link the table form one database, into another database ? Thanks ...more >>

SQL ASP syntax
Posted by rsl at 4/1/2004 1:51:02 PM
Hi I have an ASP form that submits data to a DB, by way of a confirmation page (user enters data into a form on register.asp, which is sent to confirm.asp, which then sends the data to submit.asp, which populates the DB). On the submit.asp page, I need to display results from a query based on the...more >>

Performance tuning question
Posted by alien2_51 at 4/1/2004 1:45:17 PM
I have a query and for some reason when I put paren's around an OR clause I'm using, the query is smoking fast, w/o the parens it's dog slow, the execution plan is showing table scans w/o the parens and none with the parens, here's the query.. select ro.*, CASE WHEN (SELECT count(*) ...more >>

CHAR vs VARCHAR
Posted by A.M at 4/1/2004 1:19:53 PM
Hi, Considering strings less than 20 characters, I am trying to compare CHAR and VARCHAR datatypes, to know in which circumstances, which one of datatypes would be the best choice. Could anybody refer me to related resources? Thanks, Ali ...more >>

Alias and Where clause problem
Posted by David at 4/1/2004 12:40:18 PM
Why I can't use alias name in a where clause? Does a work around exist? The reason I want to use alias is that the field (id in the following example) could by a long expression. SELECT id as myID FROM table1 WHERE myID = 1...more >>

SQL Server Trigger does not fire through web application but works in Query Analyzer
Posted by mayur_hirpara NO[at]SPAM hotmail.com at 4/1/2004 12:26:28 PM
Hi... I have a INSERT and a DELETE trigger defined on a table (for e.g. TableA). So that when a row is inserted/deleted from it the appropriate trigger will either copy the inserted row in my Backup table (for e.g. TableZ) or delete the corresponding row from the Backup table i.e. TableZ. Ho...more >>

Stored Procedure Changes
Posted by Maher K. Al-Jendasi at 4/1/2004 11:45:58 AM
Hello All, Can any body tell me how could I know the date, and user who changed a specific Stored Procedure?? and if possible what he change Thanks in advance NOTE: Sorry for cross-posting -- Please feel free to contact/instant message me at: Maher mkaljendasi@hotmail.com ...more >>

How do you progammatically add a line to a stored procedure
Posted by Todd at 4/1/2004 11:41:25 AM
I have several hundred stored procedures in 7 databases and I need a way to programmatically add the following line of code to them. SET TRANSACTION ISOLATION LEVEL READ COMMITTED. Is there a way to write a script to add this line to all of my stored procedures without having to manually edit all of...more >>

SQL script help
Posted by Bob at 4/1/2004 11:40:50 AM
Hi, I have two datable tables as following: tblID tbl2ID tbl2Flds ========================= 101 121 John 101 122 Joe 101 123 Jay 102 124 Joe tblID tbl3ID tbl3Flds ========================= 101 221 100.0 101 222 121.0 102 223 200.5 102 224 232.0 W...more >>

Upgrade 7 ->2K My cursor is closing after first pass...
Posted by JDP NO[at]SPAM Work at 4/1/2004 11:01:35 AM
I'm sorry if a solution to this has been posted before.... My cursor was written a few years ago and has been in production and used on a daily basis. I have An outer cursor open an inner cursor open ...work.... close, another inner cursor open ...work... close fetch next from outer cursor.....more >>

Retrieve Data from a row selected randomly using SELECT...WHERE...
Posted by Rajan at 4/1/2004 10:56:08 AM
Hello, I want to retrieve data from a random row within a SELECT statement which includes a search criteria. e.g. SELECT (**DATA FROM A RANDOM ROW** - viz. member_first_name, member_age) from tMember WHERE member_gender = 'M' AND member_state = 'NJ' I would appreciate your help. ...more >>

deleting in blocks
Posted by chris at 4/1/2004 10:44:04 AM
I was wanting to delete in blocks of 100 to avoid blocking. I thought this code would do it, but I've got less than 3000 rows and it never completes. set rowcount 100 delete Table1 where ProcessDate = '9/11/82' while @@rowcount=100 delete Table1 where ProcessDate = '9/11/82' set rowco...more >>

Select top n query
Posted by Sunanda at 4/1/2004 10:21:15 AM
Hi, I have a view which calls another view. But both the views do not have any order-by clause. Now my I do a "select top n" on the view from an asp page. The asp page basically opens the recordset and displays it page by page. But since no order by clause is specified , some rows are not b...more >>

help with stored procedure!
Posted by Jason Thibeault at 4/1/2004 10:06:12 AM
I am having trouble putting a stored procedure I have a table with about 1000 records. One of the columns in this table is called "make" (nvarchar). Many of the records have the same "make" (i.e., Ford) but with different "models" (another column) I need to create a stored procedure that returns...more >>

Timestamp data type
Posted by Andy at 4/1/2004 9:07:07 AM
Is it possible to decript a timestamp filed into a meaningful date and time? Thanks Andy...more >>

Clustered Index Question
Posted by Alec Gagne at 4/1/2004 7:57:23 AM
Hi All, Hope this the correct NG for this question: In a situation with a parent table and 3 or 4 child tables, where you rarely search on data from the child tables but frequently select all the child records linked to a specific parent record, would it be advisable to make the foreign key fi...more >>

Joins over the equality sign
Posted by Anya at 4/1/2004 7:47:26 AM
Does anyone knows whether it's better to use and inner/outter join in a query or a equality sign "="? For example, select a.field_name, b.field_name from table_name a, table_name b where a.f_name = b.f_name or select a.field_name, b.field_name from table_name a inner join table_name b...more >>

Migrating to SQL
Posted by Ricardo at 4/1/2004 6:05:07 AM
Hello, I am thinking in migrating my server side access database to SQL, keeping the client side access database with its code, is that possible? Is there any document with the changes y must do to the access97 code? Any Help would be greatly appreciated. ...more >>

PK Columns
Posted by Konstantinos Michas at 4/1/2004 4:03:44 AM
Hello Experts, How to find the primary key columns of a table using the system tables? Thanks in advance....more >>

Newbie: SQL Server permissions problem
Posted by Myk Quayce at 4/1/2004 2:32:29 AM
How come I can connect to an SQL Server database from a C# app I wrote but not from an ASP.NET webpage? The code is exactly the same for both programs... SqlConnection sqlConnection = new SqlConnection("server=Barton2800;database=northwind;Integrated Security=SSPI;"); sqlConnection...more >>

temp store
Posted by Be Learning at 4/1/2004 1:48:03 AM
I have a small problem like this: ---- .... IF ( EXISTS ( SELECT * FROM table ) ) BEGIN PRINT 'What you expeted is here: ' SELECT * FROM table END .... --- The code above means: if we get something from the query statement, we should print the notice and follow by the result. T...more >>

Why does this not work?
Posted by Pete Burton at 4/1/2004 12:56:06 AM
can anyone explain why this select query is pulling out dates from as far back as 1998??? (when the database started select order_no as 'Order No', prty_id as 'Property', work_type as 'Work Type', convert(varchar(10),reg_date,103) as 'Reg Date from hpmordh where (convert(varchar(10), reg_date, 1...more >>

Yukon: Process Priorities
Posted by Larry at 4/1/2004 12:31:06 AM
Does anyone know if Microsoft plans to provide process priorities in Yukon? For example, I would like to assign a low priority to a long batch query, but assign high priorities to on-line users....more >>


DevelopmentNow Blog