Archived Months
January 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
all groups > sql server (alternate) > january 2004 > threads for january 22 - 28, 2004

Filter by week: 1 2 3 4 5

insert into indexed table
Posted by webforum2000 NO[at]SPAM yahoo.com at 1/28/2004 6:45:33 PM
Hi I have a huge table with over 100million records and on regular basis ineed to delete nearly a million records and insert a million records. Currently I delete indexes before going through the process and recreate the indexes which takes a very very long time. IS there a way to disable index...more >>


Service Pack Question
Posted by blue at 1/28/2004 4:44:43 PM
I have a MS SQL Server 2000 database that a customer of ours has sent to us for testing purposes. Is there any way to tell what service pack this database is at? A stored procedure of some kind that I can run on it? Thank you, Frank ...more >>

Column-conscious bulk insert
Posted by jim_geissman NO[at]SPAM countrywide.com at 1/28/2004 4:22:50 PM
I am trying to bulk insert a text file. The file has fixed-length fields with no field terminators. BOL says that field terminators are only needed when the data does *not* contain fixed-length fields, which implies they are optional -- so I made a format file without any (two consecutive ta...more >>

SQL Server Sercurity Outside the Firewall ...
Posted by Rajesh Kapur at 1/28/2004 4:21:35 PM
Hello, We use Informix and MySQL on linux/unix to drive our web application. SQL*Server is used only for backend enterprise applications within the firewall. I am trying to get the management to use SQL*Server outside the firewall. They tell me there are security issues with Microsoft products...more >>

new to cursors
Posted by Dave Anderson at 1/28/2004 1:25:56 PM
Can anyone point me to a good resource for learning cursors in MSSQL? Thanks Dave ...more >>

Login to MSDE on Win 98
Posted by Marek Powichrowski at 1/28/2004 11:15:42 AM
Hi all, I have the the problem with logging to MSDE using SQL-DMO interface. On the W2K with LoginSecure=TRUE everything is OK (connect is made without any parameters) But when LoginSecure=FALSE (on Win 98) connect( 'instance_name', 'sa', 'sa_password' ) then it returns error message :...more >>

Extract Rows with highest values in the columns, MAX doesn't work
Posted by sukh NO[at]SPAM jatt.com at 1/28/2004 8:38:58 AM
From the table i want everything highlighted with a * I wanted an SQl expression to look at values in Column 1 (ID), look at the corresponding values in the second column (F1) and select the row with the highest value, and then if there was more than one row for that ID with the same value in ...more >>

Replacing a portion of text string in column
Posted by pradip.m.sagdeo NO[at]SPAM pfizer.com at 1/28/2004 7:26:03 AM
I need to replace a portion of a url in a column as a result of changing servers. Is there a SELECT/REPLACE/UPDATE combination query that can do this. The table has close to a thousand entries and would be nice if a query can be set to do this. Tried the REPLACE example in the BOOKS ONLINE bu...more >>



error to executing job on Sql Server Enterprise Manager
Posted by maurizio.amoroso NO[at]SPAM mlink.it at 1/28/2004 6:23:32 AM
.... DTSRun: Executing... DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1 DTSRun OnStart: DTSStep_DTSExecuteSQLTask_2 DTSRun OnStart: DTSStep_DTSExecuteSQLTask_4 DTSRun OnStart: DTSStep_DTSDataPumpTask_2 DTSRun OnError: DTSStep_DTSDataPumpTask_2, Error = -2147467259 (80004005) ...more >>

security hole in stored procedure
Posted by cliff NO[at]SPAM walkacrossfire.com at 1/28/2004 5:41:11 AM
here's my stored procedure: CREATE PROCEDURE proc @id varchar(50),@pswd varchar(20),@no_go int OUTPUT AS SET NOCOUNT ON SELECT user_id FROM profile WHERE user_id=\@id AND pswd=\@pswd IF \@\@ROWCOUNT = 0 BEGIN SET \@no_go = 1 END ELSE BEGIN SELECT date,date...more >>

triggers audit
Posted by ragaza NO[at]SPAM ozu.es at 1/28/2004 2:15:41 AM
I need audit triggers that change columns value in the same record that fire trigger. I need how to do.. Thanks.....more >>

Polish characters displayed incorrect after post
Posted by Philip Kofoed at 1/28/2004 12:53:54 AM
Greetings, I have a SQL server 2000 running on an english win2000 workstation. In a database I have a table where one varchar column is set to polish collation. Regional settings for the system is polish. Data entered in a client application looks fine until they are posted. When reading the...more >>

delete record
Posted by bhetong22 NO[at]SPAM yahoo.com at 1/27/2004 11:20:39 PM
please help i was trying to delete a specific record on a table but it still shows the same record that should be deleted. i dont know how....more >>

Nesting a SP within another SP?
Posted by laurenquantrell NO[at]SPAM hotmail.com at 1/27/2004 10:45:09 PM
I have a stored procedure that calls some UDF User Defined Functions, the purpose of which is to create row strings out of numerous column strings for matching uniqueIDs. The problem is I need to join that SP with some other tables. The SP I have reads something like: mySPName @myUserID ...more >>

Primary Key problems
Posted by tcumming NO[at]SPAM smorgonsteel.com.au at 1/27/2004 10:20:49 PM
Hi there, I just tried to apply a set of primary keys to a table and after a very long time (like an hour or more) i got this error message .... Unable to create index 'PK_master_data'. ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE INDEX terminated because a dup...more >>

URGENT HELP PLS: select substring('NY',status/1024&1+1,1) from master..sysdatabases where name=DB_NAME()
Posted by edwinah NO[at]SPAM customercare.com.au at 1/27/2004 9:27:59 PM
Hi Everyone, All the very best for 2004!! i need urgent help with this problem, the users are about to skin me alive!! we have an access front end with linked to sql server 2k tables. when a user tries to insert a record into one of the tables it "randomly" returns a generic ODBC error...more >>

Using xp_cmdshell in INSERT trigger: bad idea?
Posted by joelpt NO[at]SPAM eml.cc at 1/27/2004 9:01:27 PM
Whenever something is inserted to a given table, I want to run some shell commands using xp_cmdshell. Would it be a bad idea to put this xp_cmdshell in the INSERT trigger of this table? I understand that when using xp_cmdshell, the sql thread in question waits until xp_cmdshell finishes what ...more >>

IF statement in Stored Procedure
Posted by cliff NO[at]SPAM walkacrossfire.com at 1/27/2004 8:55:55 PM
Here's my stored procedure: CREATE PROCEDURE proc @id varchar(50),@pswd varchar(20),@no_go int OUTPUT AS SET NOCOUNT ON SELECT user_id FROM table WHERE user_id=@id AND pswd=@pswd IF @@ROWCOUNT = 0 BEGIN SET @no_go = 1 END ELSE BEGIN SELECT date,date_mod FR...more >>

Drop the time portion of a smalldatetime field
Posted by laurenquantrell NO[at]SPAM hotmail.com at 1/27/2004 7:27:55 PM
In VBA I'd use Format(myDateField,"Short Date") to display 1/31/2004 instead of 1/31/2004 10:30:25 AM How can I do this in a stored procedure? lq...more >>

Large Data needs to be Deleted??? HOW???
Posted by s000j NO[at]SPAM go.com at 1/27/2004 7:24:12 PM
I have a database that is 70GB big. One of the tables has over 350 million rows of data. I need to delete about 1/3 of the data in that one table. I was going to use a simple delete command to delete the unnessacay data. Something like Delete from tablename where columname > '100' Howev...more >>

Listing all Indexes
Posted by zcsessions NO[at]SPAM visionair.com at 1/27/2004 1:26:45 PM
Still using SQL7. I am wondering how come there is not an Information_Schema view that lists indexes? Information_Schema is supposed to be the safest way to obtain information on metadata, but it appears that the only way to get a list of indexes is with a system stored proc....more >>

output param & multiple recordests from stored procedures
Posted by cliff NO[at]SPAM walkacrossfire.com at 1/27/2004 10:51:45 AM
here's my code: my $sth = $dbhSQL->prepare('{call proc(?,?,?)}'); $sth->bind_param(1,"asd"); $sth->bind_param(2,"klm"); $sth->bind_param_inout(3,\$no_go, 1000); $sth->execute; print "no go = $no_go\n"; while( my @row=$sth->fetchrow_array){ print "@row\n"; } $sth->finish; Here's m...more >>

UPDATE query in SQL Server
Posted by laurenquantrell NO[at]SPAM hotmail.com at 1/27/2004 10:14:17 AM
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON tblMyTable.UniqueID = tblMyTableTEMP.UniqueID SET tblMyTable.myField = tblMyTableTEMP.myField, tblMyTable....more >>

Preferred SQL tools for sql*server?
Posted by mscgloss NO[at]SPAM yahoo.com at 1/27/2004 9:16:36 AM
Hi All, I am new this week to sql*server / query analyzer, coming from years of an oracle / TOAD background. Does anyone have any tools they prefer for writing and executing sql code other than query analyzer? Thanks! Mike...more >>

DTS Import of a text file
Posted by naughtonservice NO[at]SPAM yahoo.com at 1/27/2004 7:21:53 AM
I have created a DTS that imports a text file to by data table. I get errors when ever I run this since there are fields in the table that are numeric. I understand that I need to create an activeX script to import those fields. DOes anyone have any guidance?...more >>

SELECT * not returning any rows, but SELECT COL_NAME does!
Posted by rowlandhills NO[at]SPAM hotmail.com at 1/27/2004 3:01:15 AM
I have a table which is returning inconsistent results when I query it! In query analyzer: If I do "SELECT * FROM TABLE_NAME" I get no rows returned. If I do "SELECT COL1, COL2 FROM TABLE_NAME" I get 4 rows returned. In Enterprise manager: If I do "return all rows" I get 4 rows retur...more >>

how to change dts import/export window's size
Posted by Ilya Bari at 1/26/2004 8:51:27 PM
Howdy! Does any of you good folk know how to change window size of the DTS Import/Export Wizard window? Darn thing is very small and inconvinient to work with, no apparent way to change it's size, may be there is a registry tweak or something. Thanks in advance, I.B. ...more >>

Is this MSDE or full SQL Server?
Posted by Lee Mellinger at 1/26/2004 6:19:09 PM
Does anyone know if there is a way to determine if the SQL Server installation being run is MSDE or SQL Server Standard/Professional/Enterprise? Thanks! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

please help with query
Posted by soni29 NO[at]SPAM hotmail.com at 1/26/2004 5:57:07 PM
hi, i need some help with a query, also to find out if this is even possible with sql. currently i have a table with the following data: CustomerNumber CustomerBranch 123 NULL 123 1 123 2 221 NULL 221 5 555 1 555 9 125 NULL now...more >>

New to SQL Server
Posted by Patrick at 1/26/2004 4:53:48 PM
Hello I would like to convert my Access Backe End to SQL Server, but the first thing I notice when connecting to an ONC Table is that the name is preceded by dbo_ therefore it will not be recognised by the Access Front End. Does this mean that all the references to table in queries and in co...more >>

function and linked server
Posted by Marek Wierzbicki at 1/26/2004 3:57:14 PM
I have my own function, which I can use: declare @dt as datetime select @dt='20040121 12:22:33' select * from index_gold_iif(@dt) When I try do it from linked serwer: declare @dt as datetime select @dt='20040121 12:22:33'select * from lewiatan.e_.dbo.index_gold_iif(@dt) I have massag...more >>

Trigger with exec statement blocking execution of triggering cmd?
Posted by usagikawai NO[at]SPAM yahoo.com at 1/26/2004 10:50:58 AM
I have a trigger on a table. I am trying to dynamically log the changed fields on the table to another table, so I am iterating through the bits in COLUMNS_UPDATED() to find what's changed, and getting the column name programatically. This is all working fine. If I do a regular insert comman...more >>

Problem restoring database ...
Posted by Yass at 1/25/2004 9:23:23 PM
Dear Newsgroup, I am using sql server 2000 over win 2000 server with service pack 4. I have been given a back up of a database (I have tried both from T-SQL and Enterprise Manager) T-SQL RESTORE FILELISTONLY FROM DISK = 'c:\A.bck' RESTORE DATABASE B FROM DISK = 'c:\A.bck' ...more >>

import .sql script into sql server
Posted by jessey_tase NO[at]SPAM yahoo.com at 1/25/2004 5:36:40 PM
Hi, Maybe this is an easy task, but I'm having a really hard time figuring out how to do this. I'm a complete newbie to SQL Server. I have a database dump file from MySQL that's in .sql format. I'm trying to figure out how to import that into SQL Server 2000 so that I'll be able to manipu...more >>

Import Text File on remote server
Posted by kevinforbes NO[at]SPAM yahoo.com at 1/25/2004 1:22:07 PM
Hi there, When importing a text file using SQL Server, how do I specify the path to a file on the same remote server that SQL Server is running on? I tried //c:/filename but that doesn't seem to work. Also, once the import is working, how do I write a DTS package to first delete all rows in...more >>

Problem with Check Constraints
Posted by rdavenport NO[at]SPAM nyc.rr.com at 1/25/2004 10:17:18 AM
I am working with an evaluation copy of SQL Server 2000 for the first time; my DB experience lies with MS Access. I have a simple table in SQL Server (tblCompany) that has a field called "Ticker." When new company stock tickers (i.e., MSFT for Microsoft) are entered into the field, I'd like th...more >>

Using SQL to find primary keys
Posted by alan at 1/24/2004 5:19:17 PM
What query do I use to list the primary key for each user table, i.e. TABLE | PRIMARY_KEY | Regards, Alan *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

How do I create an in-line comma seperated list
Posted by bradjoss NO[at]SPAM hotmail.com at 1/24/2004 1:59:55 PM
Scenario: Table 1 (a id, b name) Table 2 (a FKid, d value) A standard join on a gives me something like: a1 b1 d1 a1 b1 d2 What I want is: a1 b1 d1,d2 I can easily do this with a function or cursor, but is is somewhat slow, and I need to do this a lot and I don't reall...more >>

HOW TO CREATE TRIGGER ?
Posted by BASUDAN NO[at]SPAM YAHOO.COM at 1/24/2004 9:02:20 AM
Hi i have 2 Table first one : Customer with 4 Fields : cst_no,cst_name,total_Debit,tot_credit second one : Transaction with 5 Fields : Trns_no,Trns_Date,cst_no,debit,credit MY QUESTION: HOW TO CREATE TRIGGER FOR UPDATE TOT_DEBIT AND TOT_CREDIT FILEDS IN CUSTOMER TABLE FROM Transactio...more >>

complex query / advice needed
Posted by Christoph Bisping at 1/23/2004 4:33:32 PM
Hello! I'm seeking advice on a rather complex type of query I need to build in an Access ADP (SQL-Server 7). There are four tables: tblPeople ID(PK) PRENAME --------------- 1 Thomas 2 Frank 3 Chris tblInventoryClasses ID(PK) INVENTORYCLASS ---------------------- 1 Car 2 Phone t...more >>

SQL 2000 and dynamic image manipulation.
Posted by dante NO[at]SPAM proactivenc.com at 1/23/2004 3:51:57 PM
My company stores thousands of images in a SQL 200 database (image datatype). We have a need to manipulate these images as they are presented according to different situations. For example - different logos need to be inserted at the bottom of the image according to the requesting party. Any ...more >>

Select specific number of records
Posted by Martin Feuersteiner at 1/23/2004 3:47:56 PM
Dear Group I wonder whether you can give me a syntax example for a SQL Statement. Lets assume I've a table containing three columns ContactID (Primary Key), Firstname and Lastname. I would like to write a stored procedure which returns me the first ten records and increments an outside va...more >>

Performance Question
Posted by Tim Morrison at 1/23/2004 2:47:58 PM
SQL Server 2000, MSDE I have a table containing simple financial transactions. The 3 primary = fields are: TranSysID INT(PK) TranDate DATETIME TranAmount DECIMAL TranAmount contains both positive (Credit) and negative (Debit) values. I need to perform a query that ret...more >>

Query Help
Posted by wrhighfield NO[at]SPAM hotmail.com at 1/23/2004 1:29:51 PM
What I want to generate is a list of all users and if they belong to a site or not. Below is what I have for tables, sample data and the results. I am a newb with writing my own SQL and could use a few pointers and help. For example if I have the following data: Table: [Users] UserID Use...more >>

Exporting Query Analyzer data with column headers...?
Posted by mscgloss NO[at]SPAM yahoo.com at 1/23/2004 12:44:45 PM
Hi, Does anyone out there know how to do this? I've been banging head for awhile now trying to answer this seemingly simple question. tia, Mike...more >>

PROBLEMA GRAVE: DESHACER DELETE
Posted by ricardolopeztrejo NO[at]SPAM mexico.com at 1/23/2004 11:37:16 AM
TENGO UN SUPER PROBLEMA, HICE UN DELETE A UNA TABLA EN SQL SERVER 2000 QUE NO DEBI HABER HECHO, COMO PUEDO DESHACER ESE DELETE....more >>

Fix dependencies during or after renaming
Posted by Steve Jorgensen at 1/23/2004 11:01:27 AM
The previous post regarding dependencies reminded me of another bugger I come up with from time to time. SQL Server allows us to rename objects via a system stored procedure (I usually use an ADP front-end that presumably calls the same procedure), but after the rename, I find singnificant stran...more >>

Rebuild dependancy Information
Posted by Trev NO[at]SPAM Work at 1/23/2004 9:59:05 AM
Is it possible to rebuild dependancy information for objects in a database? I can hardly ever DTS a database across to another server because something will fail with the message "invalid object name <name_of_a_view>". This happend to me just now on a database with just 12 tables and 4 view...more >>

Problem using Convert on dates
Posted by laurenquantrell NO[at]SPAM hotmail.com at 1/23/2004 8:45:47 AM
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below. Specifically, I have a problem with this portion in the WHERE clause: DATEADD(Day,tblMyEventTableName.Reminde...more >>

to dbo or not to dbo
Posted by laurenquantrell NO[at]SPAM hotmail.com at 1/23/2004 7:39:48 AM
I notice when I construct views using Enterprise Manager that "dbo." is automatically inserted before every table name so my table names appear as dbo.tblMyName. However, I have created a hundred or so views using MSDE/Access2K where I just refer to the tables as tblMyName. Am I going to run in...more >>

Data Schema Comparison and Migration Tools
Posted by snow NO[at]SPAM steton.com at 1/23/2004 7:27:09 AM
I've been testing a variety of database schema migration tools. Our company purchased Embarcadero Change Manager a while ago but we've been less than satisfied with the results. We are looking for a tool that can compare a source/developer database with a target/client database and then make ...more >>

Query Help
Posted by Muhd at 1/23/2004 12:09:47 AM
To start off i have a database table that consists of "profiles", another that consists of "users" and finally one that consists of "exclusions", these are defined in the DDL below. I am trying to select all the profiles minus any exclusions that are set up for that user but i keep getting dupl...more >>

Ownership issue problems..... (I think)
Posted by cmay NO[at]SPAM walshgroup.com at 1/22/2004 11:24:53 PM
I created a database on my laptop, and because I was hoping to keep the data, I tried detaching it and copying the files to my server and attaching the database to the server. I quickly noticed that some of my SPs didn't have rights that I was expecting them to have. One SP executes a line of...more >>

DBNULL Error - SQL Server2000/ASP.NET
Posted by Martin Feuersteiner at 1/22/2004 6:45:03 PM
Dear Group I'm having a very weird problem. Any hints are greatly appreciated. I'm returning two values from a MS SQL Server 2000 stored procedure to my ASP.NET Webapplication and store them in sessions. Like This: prm4 = cmd1.CreateParameter With prm4 ..ParameterName = "@Sec_ProgUser_G...more >>

using osql to apply SPs in mutiple threads
Posted by lijun NO[at]SPAM shaw.ca at 1/22/2004 5:22:02 PM
using osql to apply SPs in mutiple threads Hello, I got a weird problem when I was using osql to apply scripts for msde database in multiple threads mode. Sometime 2 sps were missing during the whole apply process, sometime not, and seems like only those two SPs met the problem. No error was...more >>

Memory Leak problem... in SQL Server 2K
Posted by ryan3677 NO[at]SPAM excite.com at 1/22/2004 4:56:09 PM
Hello, I am having trouble with a production db server that likes to gobble up memory. It seems to be a slow burn (maxing out over about an 18 hour time frame, before pegging both procs on the server and bringing everything to a standstill). After viewing the trace logs, it appears that all...more >>

Small business application: best RAD tool
Posted by Atlas at 1/22/2004 1:56:42 PM
I've developed years ago a small business application (about ten tables, basic relationships, 10 forms, 3 reports a few queries) with Borland Paradox 7, most of it developed with wizards and little ObjectPAL coding. Old'n'crappy. Seriuosly thinking rewriting it from scratch using MS SQL server...more >>

Meta-Information about Stored-Procedures
Posted by KG at 1/22/2004 1:16:15 PM
Hi , I am looking for meta-information about the return recordset of a stored-procedure. The procedure returns a resultset that contains columns of more tables joined together. In all tables, I use, there is a Record-Creation-Timestamp-Attribute. When joining two or more tables these attribut...more >>

Query Help is Needed
Posted by grichardomi NO[at]SPAM yahoo.com at 1/22/2004 11:49:26 AM
This seems simple, but it keeps tricking me. Could not get the proper result. Thanks in advance! TABLE1 App_ID Business_Unit_ID PROFILE_ID 1 001 AA1 3 001 AA1 TABLE2 - SUPERSET App_ID Business_unit_ID 1 001 1 002 1 003 1 007 2 002 2 003 3 0...more >>

min with a bit
Posted by Not Me at 1/22/2004 11:06:31 AM
Hi, I'm trying to grab records with a priority over those marked as yes (-1) in a certain field. Trying "select id, min(bit) from tab group by id" does not work, as the min operator doesn't work on bits. Is there an alternative to my query? Many thanks, Chris ...more >>

INSTR Function in MSSQL
Posted by alonso.rovati NO[at]SPAM thales-is.com at 1/22/2004 6:34:26 AM
Hi everybody, I was looking for an equivalent ORACLE INSTR Function in MSSQL but I don´t found it and I don´t know if it exist so I must to write it and this is the code. Maybe it will be helful to you: /*************************************************************************** Descript...more >>

Autonumbering causing deadlocks.
Posted by Wangkhar NO[at]SPAM yahoo.com at 1/22/2004 3:21:58 AM
Gents, I have come into a system that uses a secondary table to generate (for want of a better word) Identities. eg create table myidents ( name sysname not null, ident int not null) create procedure getnextident @table sysname, @ident int output as begin if not exists (select top ...more >>


DevelopmentNow Blog