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 > june 2004 > threads for friday june 11

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

matching sets, one to many relationship
Posted by lloyd at 6/11/2004 6:32:30 PM
trying to do something like a combination log. one table has numbers, in order, that people have entered. the second table has correct combinations. doesnt matter how many numbers are entered before or after the correct combination as long as its sequential. I've put some sample tables on a p...more >>


DROPing foreign keys
Posted by Edgard Riba at 6/11/2004 5:30:52 PM
Hi, Is there an easy way to drop all foreign keys from a database? Thanks, Edgard L. Riba ...more >>

dhivehi language support
Posted by rk at 6/11/2004 5:29:32 PM
Hi, I have a client server application (VB, MSSQL 2000) which needs to be ported to use Dhivehi language for use in the Maldives. I have a few questions: 1. Does MS SQL Server 2000 support Dhivehi language? 2. If so, which is the collation name to be used? 3. On which version of Windows Server...more >>

Fetch Cursor Data to Variable
Posted by Prabhat at 6/11/2004 5:01:46 PM
Hi All, Does in SQL Server has any Datatype for %Type and %RowType Like ORACLE. Because If I declare a Cursor for a table which has 35 columns and If I need all columns in my cursor then I have declare 35 Variables. Is there any easiest way or %rowtype in SQL Server? Thanks Prabhat ...more >>

Document Automation
Posted by JDP NO[at]SPAM Work at 6/11/2004 4:47:36 PM
Is this is the preferred NG for Reporting Svc's? I have a system that conditionally prints about 600 differnt Word documents based on 600 templates. This addresses most the the business rules for initial response to most every scenario that could occur with a client. Many of these doc's a...more >>

Return value not returning correctly when I add an Insert Statement
Posted by Ralph Krausse at 6/11/2004 4:18:24 PM
Hello all, I am a newbie to sql. I created this Stored Procedure.... VERY SIMPLE Create Proc sp_TEST as return 100 go Then I used COM and ADO in C++ to call it and get the return value, which was 100. Then I added a Insert statement like this Alter Proc sp_TEST as I...more >>

Long Transaction
Posted by Roy Alingcastre at 6/11/2004 4:15:01 PM
Hi, I got a bad feeling about this..... Our application involves around 10 tables in sql server and records in them are all interrelated. The application goes through 2 phases, first phase is to validate the records in the database, and depending which record you start from you could end up g...more >>

SQL Server History
Posted by Jason Mauss at 6/11/2004 4:08:19 PM
I am writing a paper on the history and evolution of SQL Server and I'm having a hard time finding good resources that talk about the product from it's beginning at Sybase and over the years at Microsoft. Below are a list of links I have so far but I was hoping maybe some MVP's or Microsoft empl...more >>



Trigger Help Please
Posted by Keith at 6/11/2004 3:28:16 PM
I am trying to create some triggers for updates and deletes on a DB I am working on, but being new to SQL I am not confident in the language. I am developing a front-end app in ASP and want to audit when a users updates or deletes a record. I have created duplicate tables etc. and all I need...more >>

How To: Trigger with onhand qty
Posted by Micha³ Mowiñski at 6/11/2004 3:23:44 PM
hi I'v simple warehouse, 2 table: T1: TRANSACTION: ID_TRANSACTION PART_NO QTY T2: ON_HAND PART_NO ON_HAND_QTY how to write trigger which update or sometime if needed do insert into ON_HAND table after insert,delete or update on TRANSACITON any Idea? Thx ...more >>

Best way for normal users to run SQL jobs
Posted by Mark Andrews at 6/11/2004 3:22:15 PM
In building interfaces between applications there are certain steps which need to be kicked off from a normal user, looking for the best way to do this. For example we might have a DTS job that extracts data from SQL Server tables and puts the data in Oracle tables and then requires the user t...more >>

no: active conections
Posted by Senthil at 6/11/2004 3:19:02 PM
hi all i used this query : SELECT spid,status FROM master.dbo.sysprocesses WHERE dbid=DB_ID('dbname') to get the active conections . 1. 2 records: wheni use this qry i do get 2 spids in the query analyser,,,but i open only one connection with my client right ? 2. not closing...more >>

Inserting a time
Posted by Michael Hesse at 6/11/2004 3:08:35 PM
Hi, I am trying to insert a time in a table. I use a query like this: INSERT INTO MyTable (TheTime) VALUES('9:00 AM') TheTime is a datetime field. When the value gets inserted, it is inserted as 1/1/900 9:00. Is there any way to insert it without the date part? Later I want to do a...more >>

sql server and iis
Posted by Konrad at 6/11/2004 2:58:27 PM
Hi If I get data from msde remotely (from another computer) should I have iis installed on computer with sql server.? Does connection should have static IP? Thanks Konrad ...more >>

How do I determine todays date (rounded down)?
Posted by CJM at 6/11/2004 2:42:49 PM
I have a SP that reports on the current stock position. One part of the SP needs to use something like GetDate to return today's date, but I only want the date component from GetDate, not the time component. That is, I want GetDate to return 20040611 00:00:00 rather than 20040611 14:40:00... ...more >>

update trigger working to well
Posted by ChrisR at 6/11/2004 2:35:38 PM
sql2k sp3 I want my trigger to fire off only when CancelledDate or CardActivationDate is updated. But it fires when notes column is updated as well. CREATE TABLE [dbo].[tmpTriggerTest] ( [tttId] [int] IDENTITY (1, 1) NOT NULL , [CancelledDate] [datetime] NULL , [CardActivationDate] [...more >>

Conditional Select
Posted by abell728 NO[at]SPAM yahoo.com at 6/11/2004 2:10:40 PM
I've seen several threads on this subject, but none which cover my particular question (however, feel free to redirect me if I am incorrect). I would like to write a query in SQL, where the field names included in the select statement are conditional. I will try to illustrate what I am trying...more >>

How can I run an Oracle stored procedure from SQl Server
Posted by Mark Andrews at 6/11/2004 1:44:19 PM
What's the best way to run an oracle stored procedure from a sql server stored procedure or DTS job? An example would be great! Thanks in advance, Mark ...more >>

Script to load data in tables
Posted by Vijay Kumar at 6/11/2004 12:58:36 PM
Hi, What is a good approach to load data in tables for the following scenario. Copy stored proc, tables and table data from the development servers to production servers(Not Linked) 1.Proc -- Generate SQL Scripts 2.tables -- Generate SQL Scripts 3.table data ?? Want to avoid writing s...more >>

bcpproject - lost license key
Posted by llesperance NO[at]SPAM cooperpower.com at 6/11/2004 12:23:12 PM
We have used a shareware program called bcpproject from Building Block Software Systems and have paid the $35.00 license fee. This was purchased in 1997. No one internally can find out what has happened to the folder with the key and we need to reinstall it. It seems that this company is now def...more >>

Insert query fed by select query
Posted by Novice at 6/11/2004 12:14:01 PM
Hi all, I've already posted this question - but I did it through the msdn interface and the post seems to have been lost. I'll try giving the brief and VERY simplified version of what I previously wrote. I have two tables in my database. One table - let's call it animals has the attributes: ...more >>

The FOR XML clause is not allowed in a CURSOR statement
Posted by ASP.Confused at 6/11/2004 12:09:41 PM
I am attempting to retrieve XML data from a recordset. I am using ADO within an ASP page. I know the query string works, but I keep getting this error: The FOR XML clause is not allowed in a CURSOR statement. How would I not use cursors to navigate the data (ASP.NET is not an option.) ...more >>

Need help with Duplciate Query
Posted by ajmister at 6/11/2004 11:48:02 AM
I have a table create table temp_company ( cname char (31), id int (4), sym01 char (8), sym03 char (8), sym04 char (8), c_val char (10), s_val char (6) ) The table is given to extract data has the some duplicates values cname id sym01 sy...more >>

multiple assoc tables vs one table
Posted by Mij at 6/11/2004 11:28:38 AM
I have a question about association tables that I hope I can generalize. My application is for fire investigations and I have a Case table with information about fire date/time, etc. I have different entities that need to be associated with the case, like fire occupants and fire deaths and righ...more >>

Files into Tables
Posted by Bradley M. Small at 6/11/2004 11:14:48 AM
On an application that will require programmatically importing files into specific tables, I initially created BCP Format files, and write a stored procedure that would basically call bulk insert using the file name passed in and the format file. Due to some other issues clustering and separating...more >>

How about cursors using table valued functions...
Posted by Aneesh Aravind at 6/11/2004 10:26:17 AM
Hi, I have a table valued function that returns a table. The function is called cf_BlindUsage and it takes three parameters (begindate, enddate and BuilderID). I want to use cursors to read through each record of the table, so I use something like: ----Begin DECLARE @Builder VARCHAR(50) D...more >>

Amort Schedule
Posted by SKG at 6/11/2004 10:26:14 AM
Iam looking for generating Amort Schedule in SQL. Does any one has any idea where i can find tsql for it. Thanks!!! ...more >>

Getting Rows Affected from a SP
Posted by Ian at 6/11/2004 10:22:14 AM
Is it possible to make a stored procedure running several action queries return a value in the rowsaffected property. I have some generalized VB code which can be asked to execute an SP or an action query. I would like it to be able to return to rowsaffected in both cases. Simplified, the cod...more >>

Data Formatting in TSQL
Posted by Bradley M. Small at 6/11/2004 10:15:11 AM
I am writing a stored procedure that will need to layout records that will be later placed in files. However, certain numeric values will need to be converted to the textual equivalent of BCD in the process. The actual algorithm for the conversion in VB looks like this: ' takes a string and co...more >>

How to get SUM? - beginner question
Posted by Vlad at 6/11/2004 9:54:18 AM
I need to create a stored procedure which will return a set of rows from the set of tables. I have no problem with it. But I have a problem with returning as output parameters the SUM of one value. It' calculated value. I have fields PartialNumber, PartialSellingPrice, Salesman, Percent in diffe...more >>

Historical changes using dates
Posted by Random at 6/11/2004 9:41:58 AM
I used to know how to do this but it's been several years and I've forgotten the nuances involved. I have a database with policies/standards data that I will need to keep historical reference on. Rather than keep archive tables because of the way the data will be referenced by outside sources...more >>

manipulating data from a text file
Posted by Paul Robinson at 6/11/2004 9:38:12 AM
I am new to SQL Server 2000, coming from Access, VBA and ASP. My challenge is that I have a text file which is an ldap dump from a Unix machine. I have to take that text file into SQL Server and create a table of the data. The ldap file is a personnel listing. Each person entity starts and ends ...more >>

Is possible to dissable the default per-query-transaction on TSql?
Posted by faustino Dina at 6/11/2004 9:26:42 AM
Hi, In TSql a query like Insert Into TableDestine Select * From TableSource will run inside a transaction. If TableSource is too big, it will block the system for long times and the transaction log will demand big resources from the hard disk in order to store all the info for rollin...more >>

Can I drop a PRIMARY KEY constraint?...
Posted by len at 6/11/2004 9:15:02 AM
Is it possible to drop a PRIMARY KEY constraint from a table, even if it (the constraint) has no name? eg: something like ALTER TABLE #MyTempTable DROP PRIMARY KEY Also... following from this, is it possible to check if a PK constraint exists on a table? See, I would like to put together a s...more >>

Can I drop a Primary Key constraint?...
Posted by leonardbl at 6/11/2004 9:14:01 AM
Is it possible to drop a PRIMARY KEY constraint from a table, even if it (the constraint) has no name? eg: something like ALTER TABLE #MyTempTable DROP PRIMARY KEY Also... following from this, is it possible to check if a PK constraint exists on a table? See, I would like to put together a s...more >>

Can I drop a Primary Key constraint?...
Posted by Len at 6/11/2004 9:13:01 AM
Is it possible to drop a PRIMARY KEY constraint from a table, even if it (the constraint) has no name? eg: something like ALTER TABLE #MyTempTable DROP PRIMARY KEY Also... following from this, is it possible to check if a PK constraint exists on a table? See, I would like to put together a s...more >>

SQL Output manipulation.
Posted by Bill at 6/11/2004 9:12:29 AM
Is there a way to modify the SQL Output, from the SQL statement, in SQL Server? The reason for this question is because an application using SQL Server backend had a display problem and it was brought up that TSQL may have similar Output commands like PL/SQL does in Oracle. Oracle uses a serie...more >>

Stored Procedure Problems
Posted by Ty at 6/11/2004 9:08:17 AM
Hello. I am looking for help editing this stored procedure so it works correctly. Let me give you an idea of what i am trying to do. I have created a form with three drop down lists; One contains AccountID Numbers, and the other two contain the names of territories. The goal is to select a...more >>

Covering Index
Posted by Dean at 6/11/2004 8:41:02 AM
I want to create a covering index for a query. The query would be something like 'select FirstName from CustomerMaster where LastName = 'XXXXX'. Now, the covering index would include the FirstName and LastName columns but does the order matter. Basically, should I put the predicate (LastName) as the...more >>

How to write a SQL query that inserts a record for every record in
Posted by Novice at 6/11/2004 8:41:01 AM
Hi all, I was wondering how to write a SQL query that inserts a record for every record in a different table. That is, if I have one table called animals (type, feet, domain) - type is a primary key: cat | claws | land dog | nails |land bird | talons | air and another table calle...more >>

VB or VB.Net
Posted by Scott Calkins at 6/11/2004 8:39:23 AM
I would like to put a small SQL server 2000 database on a server running server 2003 and access it from only about 3 computers in my office. I know VB 6.0 rather well but have heard I should use VB .Net . Is this trully necessary? Will I need to learn a whole lot to make the switch to VB ..N...more >>

newb question:comparing columns
Posted by mc at 6/11/2004 8:06:02 AM
I'm trying to create a relationship between two columns but am getting an error message. I'm pretty sure the problem is that there are different values from one column to the other. How can I compare the two columns but only show the items that don't exist in both thanks...more >>

Need help with syntax, please.
Posted by Aaron at 6/11/2004 7:15:38 AM
I have a column in which the data contains a UNC path to documents. I have moved the documents and shares to another server, but the share names are the same. for example, the data that is currently like: \\Server1\Client\document.doc I need to replace the data so it references another ser...more >>

Performance Issues
Posted by GumbyCha at 6/11/2004 7:14:01 AM
I have an interesting question as to why I am getting extreme performance loss when using a stored procedure versus simple inline SQL code. Here's the example I used for timing: In the Query Analyzer, I use the following code: declare @i int set @i = 0 while @i < 100 begin declare @u...more >>

More cursors - how to abandon them
Posted by Mario Splivalo at 6/11/2004 7:13:35 AM
I read a lot about cursors/non cursors, and why not to use them. Since I'm a C/VisualBasic/Perl/... programmer, for/while loops were 'in my blood'. Moved to SQL server programming i soon realised the benefits of SQL, and working on SETs. (Nowdays I seem to want everything to be programmed in SQL)...more >>

Programmatically retrieving SQL server version and sp?
Posted by Steve at 6/11/2004 6:08:44 AM
Does anyone know how to programmatically (from VB) retrieve the version of sql server that is running on a machine? The program will be installed directly on each client so it will only have to check locally. Is there and API that does this? ...more >>

Verify User Exists
Posted by brian NO[at]SPAM bkcentral.com at 6/11/2004 5:28:20 AM
I would prefer not to query the master database directly but I can't seem to find a sproc just to see if user login exists in the sysxlogins table. Does anyone know of such a sproc?...more >>

Size of an image
Posted by Chris at 6/11/2004 4:44:01 AM
Is there a way to find out a size of an image sorted in SQL (2000) table? Thanks...more >>

A peculiar problem
Posted by Sheetal at 6/11/2004 2:39:01 AM
Hello newsgroup, I have a problem quite specific to my project.The catch is, I can't use any of the database API's like ADO, VBscript etc.I need to alter data types in all my stored procedures and triggers using TSQL(~1000 in number) and then to execute them. But it's not only the parameter data ...more >>

How to find out any windows service uptime
Posted by Kota at 6/11/2004 2:07:20 AM
Hi, I want to find out any windows service uptime(i.e - the amount of time the service has been running) Thanks Kota....more >>

CREATE DOMAIN in SQL Server 2005 ?
Posted by A Mackie at 6/11/2004 1:57:10 AM
What's the news on proper support for domains in SQL Server 2005 ? Is there any ? In SS2k, rules and user-defined types are deprecated in favour of CHECK constraints, but you can't can't define a check constraint once and use across multiple tables. Thanks, Andy Mackie....more >>

Calling Function within a function
Posted by Ramnadh at 6/11/2004 12:25:01 AM
Hi, Can anyone know can't we call the function with in a function. Doesn't sql server allows calling the function with in a function. Means i am calling GetDate() function with in a user defined function, it is giving some error saying it is not valid to call getdate function within this...more >>

Extended Stored Procedure
Posted by babz at 6/11/2004 12:16:01 AM
Hi Is there any extended sp that will put the msg in the private msmq ...more >>


DevelopmentNow Blog