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

Filter by week: 1 2 3 4 5

SQL 6.5 to SQL 2000 performance question
Posted by Robert at 1/31/2004 11:54:05 PM
We are running SQL Server in 6.5 compatability mode. We have some queries that are supported in 2000, that is the reason for the 6.5 version. What, if any, would be gained in performance by switching to 2000. ...more >>


Valid T-SQL syntax?
Posted by DFS at 1/31/2004 11:23:40 PM
Version 1: -------------------------------- If Condition = A UPDATE query 1 UPDATE query 2 ELSE IF Condition = B UPDATE query Version 2: -------------------------------- If Condition = A BEGIN UPDATE query 1 UPDATE query 2 END ELSE IF Condition = B BEGIN UPDATE ...more >>

using mssqlserver with win xp
Posted by shlomys NO[at]SPAM inter.net.il at 1/31/2004 2:27:57 PM
Is it possible that I can't use microsoft SQL server under my windows xp pro ? I checked the web site and it looks like it is not supported........more >>

weird error when precompiling genwin.mak with nsqlprep
Posted by akumar1 NO[at]SPAM mn.rr.com at 1/31/2004 2:18:45 PM
I am trying to compile the sample program genwin.sqc, using nsqlprep which is used to precompile embedded sql in C. I am getting weird errors and that is because windows.h is included in the genwin.sqc file. I am using Setting the lib and include path: set INCLUDE=C:\Program Files\Microso...more >>

Locking Users Out of Table
Posted by Tim Morrison at 1/30/2004 4:32:27 PM
SQL Server 2000, MSDE 2000 I have a procedure in my application that I would like only one user at a time to be able to run. Is there a TSQL command I can run that will esentially lock a set of tables so others cannot access the table until the user is done with the procedure or until the user...more >>

Cursed Error Messages
Posted by dedejavu NO[at]SPAM hotmail.com at 1/30/2004 10:40:05 AM
Hi everyone, How do I get the error message? I have a very long sproc that needs to be done in one transaction. I have an error happening somewhere in the middle, but with a low enough severity it doesn't terminate the procedure. To make sure I don't miss any errors, I am storing @@error afte...more >>

Outer Join syntax
Posted by cook_ml NO[at]SPAM hotmail.com at 1/30/2004 8:07:26 AM
I am now working on SQL Server 2000 having had previous experience on a different database. Both of the OUTER JOIN syntaxes is different from what I am used to and I am finding it slightly confusing. For example, given two tables : wipm_tbl_mi wipm_tbl_wi (which may not have data in it for...more >>

SQL Question
Posted by shane.peterson NO[at]SPAM figis.com at 1/30/2004 6:51:23 AM
I have a one to many relationship between two tables. A products table and a prices table. The prices table has a description field that describes the type of price (Original Retail, Final Retail) and a price field. I want to be able to specifically query the "Original Retail" and "Final Reta...more >>



Creating a string from Date Fields
Posted by laurenquantrell NO[at]SPAM hotmail.com at 1/29/2004 2:43:15 PM
I have a table with a startdatetime and an enddatetime column such as: StartDateTime EndDateTime what I want to see returned is: 01/29/2004 10:30AM 01/29/2004 1:30PM "1/29/2004 10:30AM - 1:30PM" 01/29/2004 10:30AM 01/30/2004 1:30PM "1/29/2004 10:30AM - 1/30/2004 1:30PM" 0...more >>

How do I Copy back in a DTS script?
Posted by David Greenberg at 1/29/2004 1:29:01 PM
Hi ! I know how to save a DTS as a structured storage file and how to recreate a DTS using that file. What I can't find is a command, either in t-sql or from a DOS level, with which I can save the DTS as a structured storage file, for example in a scheduled job for backup purposes. Hopeful...more >>

Storing a stored-proc's result into a temp table
Posted by takayasu.harada NO[at]SPAM csfb.com at 1/29/2004 11:40:54 AM
I'm trying to write a SQL that stores a result from a stored-procedure into a temporary table. Is there any way of doing this?...more >>

Adding entry to DB and getting unique ID at the same time
Posted by alex NO[at]SPAM totallynerd.com at 1/29/2004 11:36:34 AM
Hi all, I'm writing a website with Cold Fusion and when a user submits a request and it's stored in the MS SQL database, I want the unique ID (Identity field in table) to be given to the user on screen plus emailed to user. Now can I store data to the database (where the ID is created) and ...more >>

How to return a range of rows in sql server
Posted by alexravv NO[at]SPAM hotmail.com at 1/29/2004 10:50:42 AM
Hello, John Bell posted a reply on 2003-11-02 04:11:02 PST, that gave me an idea how to achieve paging in sql server without row number functionality. Thank you John. The following works for me, not very eficient though: SELECT * FROM ( SELECT top 5 * FROM ( SELECT top 10 * FROM ...more >>

SQL Server 2000 standard on Windows 2000 Advanced Server
Posted by barbd NO[at]SPAM infocision.com at 1/29/2004 8:32:03 AM
What is the limitation of memory that SQL Server 2000 Standard can use when running on a Windows 2000 Advanced Server platform?...more >>

searching for latest date and time only
Posted by jasuk NO[at]SPAM postmaster.co.uk at 1/29/2004 8:23:26 AM
> This is what I want to do with the data table below. > > I only want it to show one id for each issue. ( ie, 4001 only once, > 4002 only once, etc. But only the one with the latest date and time) > > Ie. 4001 should only be in the table once, with the latest date - > which should be : ...more >>

Why select ... where 'Anna ' = 'Anna' returns TRUE?
Posted by aeror NO[at]SPAM op.pl at 1/29/2004 2:55:53 AM
Sorry for asking stupid questions... I can't remember which settings in MS SQL define the behaviour of this comparison: select * from table where 'Anna ' = 'Anna' to be TRUE. Both strings are different because the first contains trailing blanks. How to change it to return FALSE what i...more >>

How to Stop Logging
Posted by s_laha NO[at]SPAM rediffmail.com at 1/29/2004 2:12:34 AM
Hi, I am doing some resource hungry tasks (some extraction and loading through DTS), for which each time the SQL Server Log files gets filled up! Is there any way to stop the logging (like as during restore)? Thanks in advance. -surajit...more >>

xp_smtp_sendmail html+plain text
Posted by karl NO[at]SPAM dinressurs.no at 1/29/2004 1:22:06 AM
Hi all. Iv'e tryed out xp_smtp_sendmail, and I like what I can see so far. The thing I wonder about is if the xp supports sending both html AND plain text in the same mail. I'm on a sql2000 sp3 and I have no problem with the xp when i either send plain text or html, but as stated above I need to...more >>

backups
Posted by jeff wilmoth at 1/29/2004 12:19:00 AM
I am in search of a simple .bat file or .vbs script that I can use to stop my SQL database server. I am looking to schedule a script of sorts to initiate at a certain time every day. This script needs to be able to stop my server and/or initiate a backup. The script should be able to be ran remo...more >>

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 >>


DevelopmentNow Blog