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 > march 2004 > threads for monday march 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 31

Server busy dialog
Posted by Jeff at 3/1/2004 11:50:02 PM
Has anyone come across a "Server Busy" dialog with the following message? This action cannot be completed because the other program is busy. Choose 'Switch To' to activate the busy program and correct the problem. This dialog appears when I am executing DTS package 1 from DTS package 2. Pac...more >>


Visual Foxpro to SQL-Server
Posted by Rey at 3/1/2004 11:11:05 PM
How can I link My VFP application to SQL Server, e.g. retrieving Data from SQL server......more >>

How to detect the SQL Hotfixes installed
Posted by Neo at 3/1/2004 8:34:24 PM
Hi, How can we check whether an HotFix was installed on the current machine or not? Is there any direct/in-direct way to get it. The @@VERSIOn only provides the information of the SQL. I want to know the Service Packs and Patches. TIA ...more >>

Dropping Tables
Posted by Erin Peterson at 3/1/2004 8:01:41 PM
Hi all. Quick question about dropping tables. If I drop a table do all of the associated indices and keys get dropped with it as well or must they be separately and explicitly deleted? SQL Server 2K TIA, Erin ...more >>

date
Posted by Hrcko at 3/1/2004 7:34:19 PM
Is there a function, or can anyone tell me, how can I compare to dates? For Example: date is : 12.15.2001 and 08.01.2004. I would like a computer to calculate the number of days, month and years between those two dates? Hrcko ...more >>

setting up SQL Server data source
Posted by Tim Wallace at 3/1/2004 6:15:57 PM
Can someone please point me to the appropriate place(s) to obtain information about programmatically defining Data Sources (as opposed to doing it manually through Control Panel...Administrative Tools...Data Sources)? Thank you. Tim ...more >>

Stored procedure;1
Posted by warway at 3/1/2004 6:14:26 PM
Can anyone tell me what ;1 means after a stored procedure name. It is only visible from some PCs in our network And they cannot run the stored procedures TIA Warway ...more >>

datediff
Posted by HartA at 3/1/2004 5:58:15 PM
I'm using datediff to find weeknbr as: select (datediff(wk,'12/27/03','01/25/04')) as WeekNbr How can I make sure I get a 2-digit number (I.E) weeknbr 01 02 03 .. Thanks. ...more >>



New developer newsletter
Posted by todd12345_1 NO[at]SPAM hotmail.com at 3/1/2004 5:57:18 PM
Unicus Data Systems is inviting Access, Visual Basic, SQL Server, and Web developers to sign up for the Unicus Programmer's Assistant, a new periodic email newsletter. It contains -programming tips and how-to's -code samples -technical articles -links to other programming resources -and ...more >>

Several columns bad, why is last one given in message?
Posted by Michael G. Schneider at 3/1/2004 5:11:26 PM
Suppose you have a table with several NOT NULL columns. Now if you insert a row, and some NOT NULL columns are actually NULL, an error message is giving, telling that the last bad column may not be NULL. Why is the last bad column given in the message? It would be better, if the first bad column ...more >>

Set first day of week
Posted by MickeB at 3/1/2004 4:11:26 PM
Hi, How can i change the setting of first day of week, i want it to start with monday, and not sunday as default. I access the SQL2000 server from an IIS5 so this setting must either be permanent on the server or done from an .ASP page Thanks /Micke ...more >>

sp_renamedb
Posted by Fox at 3/1/2004 4:07:53 PM
Hi, I am trying to rename a database. I am getting an error telling me that "the database cannot be exclusively locked ..." Can someone tell me what I can do so that I can get sp_renamedb to rename this database? Thanks, Fox ...more >>

Using DBLIB to call sp_executesql
Posted by Steve Stoenner at 3/1/2004 3:49:18 PM
Does anybody know if you can call procedures such as sp_executesql that require nvarchar parameters using DBLIB?... I don't see any reference to the nvarchar datatype in DBLIB. Thanks ...more >>

Identity Columns
Posted by Erin Peterson at 3/1/2004 3:44:12 PM
Hi all. Is it possible to alter a numeric column to make it an IDENTITY column? SQL Server 2K TIA, Erin ...more >>

Record locking
Posted by Andrei at 3/1/2004 3:31:05 PM
Hi everyone In a multiuser environment, users are processing documents. After one is processed, the next available one should be loaded. While a document is loaded for one user it should be unavailable for the rest of the users. Currently the table has a field named "Locked" and a stored procedu...more >>

Character Conversion
Posted by Khurram Chaudhary at 3/1/2004 3:17:27 PM
Hi, I'm looking for simple way to convert a character to an integer through a SP. For example, I want to convert A-Z to -26 to -1 where A would be -26, B would be -25, and so on. Is there an easy way to do this without a table? Also, how can I call this SP from another SP? Thanks. Khu...more >>

Help with recursive queries... BIG problem.
Posted by Star at 3/1/2004 3:13:40 PM
Hi This is a problem that I'm having and I was wondering that maybe you guys could come up with some ideas. Ok, let's see if I can explain the problem. I have about 15 tables. Each table has several fields, however each table has a common field called 'Code' ex. Table Vehicles ------...more >>

Literals vs Variables - turns SQL statement to slow death
Posted by seanbp1 NO[at]SPAM coolbean.com at 3/1/2004 2:57:57 PM
I have a simple query that works in under 1 second: select trans_no from transact where sale_no in (select sale_no from sale_hdr where reserv_no=5175000) However, when I try to turn the literal into a variable - the query takes 1 min 38 secs. Here is that attempt: declare @resno numer...more >>

Time Period Question
Posted by imani_technology_spam NO[at]SPAM yahoo.com at 3/1/2004 2:34:39 PM
There are several tables that require a starting time period and an ending time period. Right now, that time period consists of a quarter and a year, although that can change in the future. From a normalization perspective, I think I should have a separate TimePeriod table and link that table...more >>

small selectproblem
Posted by Lasse Edsvik at 3/1/2004 2:33:20 PM
Hello I have this: CREATE TABLE #Results ( Player char(1) NOT NULL, Score int NOT NULL ) INSERT INTO #Results(Player,Score)VALUES('C',-4) INSERT INTO #Results(Player,Score)VALUES('A',-2) INSERT INTO #Results(Player,Score)VALUES('D',-1) INSERT INTO #Results(Player,Score)VALUES(...more >>

Yet another question about date and time
Posted by Mikalai Beliashou at 3/1/2004 2:18:04 PM
I try make queryes for the phone billing database from my application. Database works on MS SQL 7. I'm very suprised when duration of call placed in DateTime field. It mean I see duration of call like 1990-01-01 0:00:18 . In my query I want GROUP BY some records and Sum(Duration), but it wants me...more >>

Browse Remote Database for Directory for New Database Files?
Posted by Enzo Maini at 3/1/2004 2:01:11 PM
If you have Enterprise Manager installed you can right click the "Databases" tree node for a server and select "New Database.." If that Server happens to be a remote server, you will get a folder dialog of the remote directory structure where you can have you database files created If there a wa...more >>

DB Size
Posted by anonymous at 3/1/2004 1:51:50 PM
when I do a complete backup, the size of DB is abt 1.5 GB. when I restore the db from same backup, the MDF and LDF are over 3.5 GB ... why are they so large ? Also, when the log file (LDF) gets big, how can I shrink it without loosing any data ? Thanks for your time....more >>

Testing Performance of Queries
Posted by klnorris NO[at]SPAM comcast.net at 3/1/2004 1:39:56 PM
How should I test to see which kind of queries give me the best performance? I want to know exactly whether joins, subqueries, derived tables, EXISTS, etc. results in the best performance of my application. Does SQL Profiler do this? Should I use the difference between time values to gauge the ...more >>

Diff between Set & Select ?
Posted by MrBug at 3/1/2004 1:33:03 PM
Hi, I am having a simple question. Select @test = 'test' Set @test = 'test' Can anyone give me the difference between the above two statements.. Mr.Bug ...more >>

inserted joined to linked server
Posted by Rob at 3/1/2004 1:18:01 PM
Hello All, Curious to know if it's possible to create a join between the inserted table in a trigger and a table in a linked server database? I haven't been able to get this to work. IE. IF Exists (SELECT distinct B.CustNumb FROM LinkedServerB.Database.dbo.Customers B inner join inser...more >>

ASP/SQL Server Problem, INSERT Works, UPDATE Doesn't
Posted by bayers NO[at]SPAM yahoo.com at 3/1/2004 1:10:02 PM
I'm stumped. This doesn't work: UPDATE PEOPLE SET LNAME='Doe', FNAME='John', MI='P', STUDENT_ID='123123123', EMPLOYEE_ID='123456789' WHERE HID=100008 Error Type: Microsoft OLE DB Provider for SQL Server (0x80040E31) Timeout expired This does work: SET NOCOUNT ON; INSERT INTO PEOP...more >>

Passing a data structure to a stored procedure
Posted by Simon Harvey at 3/1/2004 12:48:21 PM
Hi all, Is it possible to pass some sort of array to a stored procedure using ADO.net. In particular, I have a list of usernames that I need to pass to the procedure and then have the procedure loop through that array and perform an update action on the database. The only alternative I can...more >>

Stored Procedure executes very slow, code pasted into query-analyzer executes fast?
Posted by Andreas.Bretl at 3/1/2004 12:19:43 PM
Hi all, I am currently facing a strange problem. I execute a stored procedure (in the query-analyzer) EXEC MyProcedureThatIsSlow That takes ages. If I copy and paste the code of the procedure into the query-analyzer it runs thousand times faster. I already looked at the "Estimated E...more >>

Hit counters
Posted by Mike at 3/1/2004 11:51:08 AM
Hi - I am trying to setup a hit counter on a page in the application - using Visual studio.net. Is it better to store the counter on a database or a text file - or does it make a difference? Would apprecaite the code for this if you have done something like this before. Thanks in advan...more >>

BULK INSERT how to_
Posted by AJA at 3/1/2004 11:50:30 AM
Hello I try to insert data from text file to database on mssql BULK INSERT TESTDB.dbo.TESTCHAR FROM 'C:\TEMP\200300a.txt' WITH ( DATAFILETYPE='char', FIELDTERMINATOR = '"', ROWTERMINATOR = '\r\n' ) It's not working :( "Bulk insert data conversion error(truncation) for row 1, column 5...more >>

Using a variable to specify database to SELECT from
Posted by Mark Paulson at 3/1/2004 11:06:05 AM
Hello I am writing a stored procedure that will be gathering data from two very, similar databases. Where possible I would like to write one set of code and pass it parameters in order to specify the database name to use. I've discovered that the USE <database_name> statement will not work in stor...more >>

Percent of total
Posted by Gary at 3/1/2004 10:51:44 AM
MyTable is as follows: Name Revenue Joe 300 Mary 400 Ed 200 I want to list the table along with each persons percent of the total Revenue. How can I do this? Thanks, G ...more >>

Performance with Wildcards Dynamic SQL vs.Variables
Posted by dbgooroo NO[at]SPAM yahoo.com at 3/1/2004 10:41:30 AM
When faced with reasonable fixed SQL query alternatives to dynamic SQL, I'll generally take them to avoid performance slowdowns due to recompiles, etc. I'm currently observing a basic situation in which the Dynamic SQL alternative performs far better than fixed SQL query alternative. This involv...more >>

Problem with INSERT INTO with string literal
Posted by Danny at 3/1/2004 10:32:42 AM
Hi. I am running SQL Server 2000 and I have a table with a PK column named Url. I get a timeout when I try and insert the following url into the table: http://www.msdn.microsoft.com/architecture/application/default.aspx?pull=/library/en-us/security/security/cryptography__cryptoapi__and_capico...more >>

statement not allowed within multi-statement transaction (Long)
Posted by Bill Lucas at 3/1/2004 10:31:02 AM
Server: Msg 226, Level 16, State 1, Procedure sp_detach_db, Line 32 [Microsoft][ODBC SQL Server Driver][SQL Server]SP_DETACH_DB statement not allowed within multi-statement transaction. I have a sample script that is available on request. I am not posting it here because I do not want to atta...more >>

concatenate int with varchar arg in Values clause?
Posted by Rich at 3/1/2004 10:15:45 AM
Hello, I need to generate some test data and want to run the following loop: CREATE TABLE [dbo].[tblTest1] ( [fld1] [int] NULL , [fld2] [nvarchar] (50), [fld3] [nvarchar] (50) ) GO Declare @int1 int Set @int1 = 1 While (@int1 < 6) Begin insert into tbltest1(fld1, fld2, fld3) Va...more >>

Change user
Posted by Utada P.W. SIU at 3/1/2004 9:32:58 AM
I would like to know how to using other user to connect the sql server in the stored procedure? thx~ ...more >>

Just the Most Recent, Top or ?
Posted by warway at 3/1/2004 9:26:06 AM
The following procedure returns the data I want but I need to show just the latest instance of each s.CurrencyCode in order to populate a combobox, any help greatly appreciated! Alter PROCEDURE dbo.sp_ROECurrent3 @LessDate datetime AS SELECT s.ROEID,s.CurrencyCode, s.ExchangeRATE, s.RO...more >>

ROBUST PLAN
Posted by JMNUSS at 3/1/2004 9:19:58 AM
In SS 7.0, I am getting this error and I cannot find any syntactical reference to show me how to add to my query. Does anyone know what I can do to implement this to see why my query is failing? Server: Msg 510, Level 16, State 2, Line 60 Cannot create a worktable row larger than allowable...more >>

Storing a distant date for "now" when modeling temporal data
Posted by Mike Lerch at 3/1/2004 8:52:05 AM
I'm reading Richard Snodgrass' "Developing Time-Oriented Database Applications." In situations where you're tracking a start date and and end-date, he talks about storing a distant date (like the largest date that a dbms can handle) to represent both "now" and "forever" in the end date field. ...more >>

Model for a company, its parents, and its affiliates
Posted by imani_technology_spam NO[at]SPAM yahoo.com at 3/1/2004 8:37:41 AM
What is the best way to model a company, its parent companies, and its affiliated companies? I have a company table with 2 self joins (one for Parents and one for Affiliates). However, a Company might have several Affiliates. Does that mean I should have a separate Affiliate table?...more >>

delete
Posted by Mikey at 3/1/2004 8:16:16 AM
delete from call where exists (select * from call a inner join iuk_cust c on a.custno=c.custno where cust_type = 'x' and account in ('Disabled')) Hi I wanted to delete all customers from a table who had a cust_type of x and account in disabled but I realise this command will delete every...more >>

Pls Help -- Upsizing from Access
Posted by jimmy at 3/1/2004 6:56:08 AM
Hello Everyone, I am a relatively experienced programmer in Access. However, I have only upsized 2 backends from jet to SQL server, and with both of those, I didn't use triggers or stored procedures. Currently, I have a mission critical and complex application that needs to be upsized...more >>

URGENT: Unable to begin a distributed transaction
Posted by Michas Konstantinos at 3/1/2004 6:26:38 AM
Hello MVPs, 1) I'v created a linked server that locates in the same city (Athens), using as Datasource the alias name which I created in Client Network Utility (I use TCP/IP Protocol) with right port. RPC options are selected. 2) The query timeout options are set to 0 in both SQL Ser...more >>

Check Syntax Issue
Posted by Michas Konstantinos at 3/1/2004 5:15:13 AM
Hello MVPs, Is there any way to get a "report" of which of my objects (views, stored procedures, function...) does not work (ex. maybe caused by renaming some objects)? Do you know if there is a .dll or .exe file tha checks the syntax and what parameters are needed? Thanks in Advance....more >>

Common values
Posted by Ajay at 3/1/2004 5:11:06 AM
Consider the following table t1(test_name varchar(10), label varchar(10), conversion_factor int Assume that following data is there in the table aaa a1 NUL aaa a2 aaa a3 aaa a4 bbb a1 NUL bbb a2 Now, I have to write an SQL query to return the comon values of label, conversion_factor ...more >>

Date of today
Posted by Josema at 3/1/2004 3:01:05 AM
Hi, I would like to know if its possible in a stored procedure take the time and date of the day of today.. Thanks in advance. Josema....more >>

how can i do paging while using stored procedure?
Posted by Sabri AKIN at 3/1/2004 2:58:38 AM
i know this newsgroup is not about below message topic but maybe someone know this problem answer. i want to make paging via recordset but it doesnt work when i call stored procedure,but it works when execute sql sentence. i try to set recordset cursortype "static" but recordset take de...more >>

sp_who
Posted by SUNNY at 3/1/2004 1:22:09 AM
Hi I have a delete statement which is running for 2 hrs If do a select it retrieves the rows in a giffy SELECT * FROM TABLE WHERE COL_NAME='000000000' A delete statement is taking a long time DELETE FROM TABLE WHERE COL_NAME='000000000' col_name is char(9) and has a nonclustered index on...more >>

Issue in Convert?
Posted by Paras at 3/1/2004 12:07:47 AM
Came accross something interesting while playing around with convert. The aim was to strip off the timepart completely from the date. If I run the following code in a SQL Server 2000 personal edition SP1 DECLARE @date1 DATETIME SET @Date1 = '20040229' DECLARE @Date dateTime SET @Date...more >>


DevelopmentNow Blog