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 > september 2003 > threads for thursday september 18

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 delete one word from memo field ?
Posted by meh at 9/18/2003 11:07:39 PM
A = 'test test1 test2 test3' Suppose above is a memo field and I want to get rid of first element. In this case the first element is test but it could be anything separated by space. I just want to get rid of first element. I would appreciate if someone please help. Thanks. ...more >>


Opening a large table in Enterprise Manager
Posted by Grace at 9/18/2003 10:50:26 PM
Hi, I'm using SQL Server 2000 and I have a table that holds around 45,000 records. When I open it in Enterprise Manager by selecting return all rows, all transactions that access this table from my application will give a time out error until I close the table from Enterprise Manager. ...more >>

returning data
Posted by john smith at 9/18/2003 9:46:35 PM
I am trying to get a query to work using grouping by days SELECT CAST(datepart(dd,date_created) AS int) AS DOW, SUM(prod_unique) as unique_count, COUNT(prod_id) as total_hits, (COUNT(prod_id) - SUM(prod_unique)) AS total_returns FROM crm_ecom_tracker WHERE datepart(yyyy,date_created) = @spYea...more >>

Adding Foreign keys risky late in the game?
Posted by rooster575 at 9/18/2003 9:28:41 PM
I have 3 clients with the same database structure. Recently, I have been asked to create a Diagram, but I have never created Foreign keys which would make the mapping diagram process easier. My question is, now that these databases are >650MB, it is risky to be adding hundreds of foreign key...more >>

Comprehensive TSQL Book
Posted by Abhishek Srivastava at 9/18/2003 8:24:15 PM
Hello All, What is the best book to learn TSQL programming? I want to be very good in writing stored procedures on SQL Server. BTW, is there any point in learning TSQL now? since MS in last years teched had announced that the new version of SQL Server Yukon will support C# stored procedur...more >>

Alter Database
Posted by Ron Isley at 9/18/2003 7:38:12 PM
How can I use a query to set the database to single user mode?...more >>

Update Query Help
Posted by Samuel Perkins at 9/18/2003 6:35:42 PM
I made a mistake and changed the Grades in my Class table without making a backup but I have a older copy that called Class2 that I can afford to use can someone please help!! The Class_ID(PK) is found in both tables. I was using this I know its wrong... Update Class with (Select * fr...more >>

Insert Query Help!!!!!!!!EASY Question
Posted by Samuel Perkins at 9/18/2003 6:20:34 PM
Hello I using the following query: Insert into Class Select * from Teacher where Grades= 'A' I want to insert this data and have it override the data that is there so when I perform a count its the same as before I perform the query. ...more >>



Simple Count query
Posted by Tabmeer Qusar at 9/18/2003 6:15:23 PM
I have 2 columns in my database with 1000's of rows. Column one = UniqueIDer. Looks like UniqueIder 1 2 4 3 2 How can see a count of the UniqueIder with the numer of times it is represented in the table?...more >>

Update Permission on Stored Procedures
Posted by Shearill at 9/18/2003 5:42:05 PM
Hello, How can I update over 200 stored procedures permissions for a user called admin to have EXEC rights....more >>

Convert all data in string column to dateTime column
Posted by JohnH at 9/18/2003 5:39:26 PM
Hello, I have this table: CREATE TABLE [Times] ( [Time_ID] [int] IDENTITY (1, 1) NOT NULL , [RecTime] [varchar] (50) ) Due to bad design the RecTime field is a varchar instead of a datetime. What i need to do is to create an update SQL script that will convert that column to a dat...more >>

Updating rows
Posted by Sean Keith at 9/18/2003 5:28:26 PM
Hello, In t1 I have 2 columns AppliactionID and Status. The status has values of A, B and C. In t2 I have the exact same columns but the status for each Appliaction ID is different. I would like to take the the records that have a status of A in t1 and copy them on those records that ...more >>

Remote server query
Posted by Himanshu at 9/18/2003 5:25:46 PM
Is it possible in MS SQL server to write a query that spawns multiple servers? Something like -- select a.col1 from table1 a, server_x.master.dbo.tableb b where a.col1 = b.col1 Is there any other way of writing something like this? Thanks. ...more >>

query problem
Posted by Sean at 9/18/2003 5:19:27 PM
For a table with data as: Fld1 Fld2 Fld3 ----------------- 24 621 Joe 24 621 John 25 623 John As the 2nd's fld1 and fld2 fields are the same as 1st, in a select statement, how can i only return records without the 2nd? ...more >>

arithmetical db script needed
Posted by manat K. at 9/18/2003 5:05:17 PM
Hello all, I have an online contest to do. With this contest, there are 700 potential prize winners. Every entrant has his own contestandtID, and how the contestantID works is that a int is stored in a table, and when a user enters his info, it takes this int and assigns that number a...more >>

delete user procedures
Posted by Fabricio E. Gil at 9/18/2003 4:46:25 PM
Hello everybody i just trying find out a way to delete just the user procedures and left the system procedures, because we are in a development environment and we need drop all store procedures and recreate-it all store procedures from scratch. Regards Fabricio ...more >>

Stored Procedure is running slow from powerbuilder application
Posted by Kevin Brooks at 9/18/2003 4:35:22 PM
We have a stored procedure that will run from Query Analyzer in 15mins, it will also run from Powerbuilder Painter(design time) in 15 mins. When we run it from the compiled app(run time) it takes hours to execute. This procedure is going through ODBC and I do not believe that is the problem si...more >>

Using Triggers
Posted by Roy Goldhammer at 9/18/2003 4:33:48 PM
Hello there I know about 3 types of triggers: Before Action Instead of action After action. 1. If i set rollback on Trigger that works after the action will it be cancle the action? 2. If i set more then one trigger to table which of the trigger works first? ...more >>

RAISERROR Useage (Was: MSGBOX Equivalent - thanks Greg Linwood)
Posted by BillC at 9/18/2003 3:46:21 PM
greetings < Thanks up front to Greg Linwood for an excellent 'First Response' > when running a stored procedure i'd like to monitor a 'total-available' field and notify the user if the value goes below zero. this is not fatal, but i'd like the user to be made aware of ...more >>

Need help making SQL Query
Posted by John Kenney III at 9/18/2003 3:44:05 PM
I am trying to get some record counts from my table, but due the date formatting I am having trouble. The table I am pulling from is a helpdesk log and I would like to get a count (on a per day basis) of how many requests there are. I thought I could use a GROUP BY command, but since the datet...more >>

Extended stored procedure error..Help please!
Posted by FatihMK at 9/18/2003 3:02:04 PM
Hi all, I 'm trying to call and debug an extended stored proc (XP) from SQL Server Query Analyzer. In the MSDN Library(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsd ebug/html/vxlrfdebuggingextendedstoredprocedures.asp?frame=true) , there is an example of XP (xp_hello....more >>

How to find duplicates in the table ?
Posted by meh at 9/18/2003 2:45:56 PM
Looking for a statement to find duplicates in the table. Thanks. ...more >>

Recursive Membership Information
Posted by Peter Lasne at 9/18/2003 2:31:25 PM
I have created the stored procedure that you will see below this message and while it works fine and returns exactly the information I want, it can take a very long time to run (20-30 seconds in some cases). The stored procedure is designed to return a result set of all the relative membe...more >>

Get only operators from a column
Posted by Ricky at 9/18/2003 2:29:43 PM
I have a column in a table of type varchar(50). ReportTemplateColumnCalcFactor * 2 - 3 / 4 * 11 In my select statement while querying records out of the table I want to select only the mathematical operator sign from the column. I cannot use substring function coz the position ...more >>

EXCEPTION_ACCESS_VIOLATION error when trying to run a custom task in DTS
Posted by Ron Lounsbury at 9/18/2003 2:26:15 PM
I have a DTS package I am trying to build that contains 2 tasks and a workflow. The first task is a Dynamic Properties Task that takes the values of global variables and places them in the properties of the custom task. The workflow simply runs the custom task if the Dynamic Properties Task suc...more >>

How to read data from 3 different servers ?
Posted by meh at 9/18/2003 2:15:41 PM
I have 3 companies, 10 miles apart. Each company has their own static ip address. All three connected thru VPN. I am on company number 1 and mapped company 2 and 3 as drive letter N and O respectively. So now I have company number 2 and three available. I am in a process of writing a stor...more >>

Proc dependencies
Posted by Rupert at 9/18/2003 1:33:33 PM
I have one stored procedure that sits in one database only, but queries tables in 5 other database on the same server. How would I go about getting all the dependencies for that stored proc? When I right click and select dependencies I only get them for the database the proc is located in. Is t...more >>

stored procedure
Posted by SQL Apprentice at 9/18/2003 1:31:10 PM
Hello, How can I share a single stored procedure for all the databases in the same SQL Server? I have a stored procedure that I use for performance log, but I can only use it where I create the stored procedure in the database. I would like to be able to call this stored procedure from any...more >>

count(column) for codition
Posted by Mark at 9/18/2003 1:08:19 PM
Hi, I write a stored procedures, but it doesn't work. it always return 12. Alter Procedure "sp_test1" ( @email char(40) ) As Declare @count int If exists (Select email From table1 Where email = @email) Begin Set @count = (Select Count(email) From table1 Where email = @email Group by ...more >>

No compatible date column in MSSQL - as in ASA and DB2
Posted by DMH at 9/18/2003 12:57:44 PM
We are currently looking at adding MS SQL Server 2000 to the currently supported ASA and DB2 database platforms for our PB 6.5.1 Application. We have researched the issues that will be involved but still have one outstanding that maybe someone else has dealt with or may be able to point o...more >>

emprego / estagio
Posted by Frederico Barbosa at 9/18/2003 12:26:55 PM
Desenvolvimento e "up-grade" de aplicação já existente para gestão empresarial, totalmente desenvolvida em .NET (WebForms,WebServices e SmartClients) com SQL2000. Dispomos de vagas. -Programador Senior: Deve ter experiencia em VB.net,Framework e SQL pois os desenvolvimentos mais complexo...more >>

TRIGGER Creation Date
Posted by Daniela Binatti at 9/18/2003 12:09:46 PM
Is there any way to know one trigger creation date? Thanks in advance. Daniela Binatti....more >>

HELP with Views
Posted by JD at 9/18/2003 11:58:51 AM
Hi I need to created a view. I have a table with 1. All customers, - Customers ID; PK Name etc... 2. Sheet the fill out every time the come in - SurveyForm ...more >>

protecting sql procedures and schemas
Posted by buzlite NO[at]SPAM rogers.com at 9/18/2003 11:43:04 AM
Hello All, I do not know if I am posting in the correct group. I'll give it a try here first. I am currently developing a webapp that uses a database to store data. The data side of the application involves creating schema's for tables and stored procedures in the sqlserver or MSDE databa...more >>

XA problem
Posted by Xiyi Zhao at 9/18/2003 11:27:47 AM
I am programing useing XA to instert the table. When some transaction is pending in server. The query analyser can not display the information about the table.Then I restart the server.When I query the table after the server started,In the database I find that the table is disappear. Is ther...more >>

Simple question for Adding a Column
Posted by Keith Brown at 9/18/2003 10:47:24 AM
I have a table that has 3 columns how can I add a 4th column without recreating the entire table. The table is called Application and I have columns Version, Build and Application_ID. I want to add Application_Date....more >>

Date manipulation question
Posted by Chris Strug at 9/18/2003 10:36:38 AM
Hi, I am in the process of rewriting an Access query containing VBA modules into TSQL. The original query is stupidly complicated. My question is, is there a simple way of determining if a date is in a particular month? For example, given the date '07-Aug-2003 00:00' is there a functio...more >>

Executing Stored Procedure...
Posted by Sender at 9/18/2003 10:29:33 AM
We can execute a DTS package using dtsrun utility - that means we can run package without opening Enterprise Manager. I want to do the same thing with stored procedure. Can I execute the stored procedure using START--RUN utility? Please tell me the steps. Thanks! ...more >>

migrate Sybase 9.11 database to SQL Server 2000
Posted by ɵ±Æ at 9/18/2003 9:53:33 AM
Hello, Our team want to migrate the Sybase database to SQL Server. My first step is port the Sybase database DDL to the SQL Server. Certainly, we need modify the SQL script that can run on the SQL Server.By doing these, we can create tables,views, procedure and etc on the SQL Server datab...more >>

Finding unmatched rows (compare tables)
Posted by dm_dal at 9/18/2003 9:24:41 AM
I'm trying to figure out how to compare two tables and return only the rows where one or more columns have different values. Example Table "a" has 6 columns [col1, col2, col3, col4, col5 col6] Table "b" has the same 6 columns Each table has 8 rows with identical data, except row 7 of tabl...more >>

copy database from server to server
Posted by meynet at 9/18/2003 9:06:13 AM
I work with sqlServer Y2K and I want to create a programme to copy a full database from a server to and other. I want to write a programme to do so. So is it possible to make this copy with SQL DMO or SQL Transac ? Is there a function like "copy database (src,destination)" .???? Thanks for He...more >>

how do I do this w/o using dynamic sql?
Posted by FH S at 9/18/2003 9:04:26 AM
I am posting this message again. I am trying to avoid dynmaic sql coding. please see the code below. I've three cases in the stored proc: 1. If @ID = 7 then show all the records with ID 7 2. If @ID = 16 then show all the records with ID 16 3. If @ID = 1 then combine records of ID 7 and 16 ...more >>

Explicit Transaction Problems
Posted by Deborah Melkin at 9/18/2003 8:55:44 AM
The way our database is designed is that we have a stored procedure that "polls" the database, selecting records from a table that indicates changes were made to main tables into a temp table and then selects the new information by using seleting the data from the temp table joined to a vi...more >>

How to unload a DLL used as a custom DTS task
Posted by Ron Lounsbury at 9/18/2003 8:42:39 AM
I am in the process of trying to develop a custom DTS task in VB. I have created a VB project that compiles to a DLL and implements DTS.CustomTask. I am able to register the custom task in SQL DTS Designer and set properties, but when I find something that requires a recompile I run into an err...more >>

Guid as PK Question
Posted by busy NO[at]SPAM sulfurmines.com at 9/18/2003 8:29:43 AM
If you use Guid as PK, can you use a separate UNIQUE Integer field for all your DataRelations? In other words, I dread the use of a 16 byte field as Foreign Keys in related tables also. ...more >>

Sheduled DTS never stops running
Posted by Tom Potts at 9/18/2003 7:23:14 AM
I have a DTS that runs as expected from the DTS designer. When sheduled the job executes but the job does not stop thus preventing reruns.. Any clues as to how to get it to die?...more >>

Procedure´s_modify_date
Posted by Alexandre Oliveira at 9/18/2003 6:40:48 AM
How can i get the modification date of a stored procedure instead of the creation date? Thank you Alexandre...more >>

Manually incrementing an ID
Posted by Jon at 9/18/2003 6:06:10 AM
Hi I have a table with an ID column of which the ID may not be unique. When I want to create a new ID I use the MAX(ID) +1 function in a stored procedure to increment the ID. However, presumably, this does not lock out other users/connections potentially generating the same ID at the sa...more >>

table variable and dynamic SQL
Posted by Sabrina Gobbi at 9/18/2003 5:27:51 AM
I have a stored proc which writes data into a temporary table declared as a table variable. The SELECT uses 2 parameters. Everything works fine. I want to change my stored proc because the 2 parameters are now a list of values and no more a single parameter. I want to replace the "=" ope...more >>

Using ISQL
Posted by Beverley Brindle at 9/18/2003 5:15:20 AM
Hi I'm using ISQL and want to authenticate agianst SQL Server using windows authentication. I've not specified the -U or -P switches, as documented in books online, but it's still prompting me for a password. This is the command I'm using. isql -d {Database} -Q "EXIT(SELECT COUNT(*) ...more >>

Inserting values SQL
Posted by skc at 9/18/2003 12:55:52 AM
I have a large table of around 7m records. Here are the fields: ID : random number between 1 and 7m created using Rand()*7m number : numbers in seq order from 1, 2....7m amount : random under 10k created using Rand()*10k I want to add a date field to my table, and create a date for the ...more >>

Unusual Stroed Proc Behavior
Posted by Trebek at 9/18/2003 12:55:07 AM
Hello grp: I apologize if this post is better suited to another grp, but since the issue cannot be pinned down at present, I thought ppl who write a lot of queries might be able to shed some light on this issue or have experienced this situation before. Environment: SqlServer 2K - runn...more >>


DevelopmentNow Blog