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 2005 > threads for thursday september 29

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

SQL 2000 UserID & Password Question
Posted by Hugh O at 9/29/2005 10:29:30 PM
Hi, I have the following error that I have gotten when I try to use Crystal Reports within Visual Studio.Net 2003 and within a VB ASP.Net app that accesses a SQL Server 2000 Database CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Searching through Google it seems t...more >>

Non-deterministic UDF's?
Posted by Arthur Dent at 9/29/2005 9:40:44 PM
Hello all, i want to make a non-deterministic UDF... is this possible? Heres what i have... its an online catalog. The site has an option DAYS_LIST_AS_NEW, where the owner can specify a number of days for which a product is listed as new, so if the user puts a value of 30, products are listed ...more >>

INSERT INTO query exception
Posted by bruce lawson at 9/29/2005 7:51:38 PM
Hi, I'm fairly new at SQL query language and am running an example program from a text in VisualBasic where I want to just insert a new row in an existing table, but I keep getting a syntax error in the INSERT INTO statement. Here's the program flow and below that, the error message caught i...more >>

Select statement on multiple values
Posted by Antonio Budano at 9/29/2005 7:13:50 PM
Hi there, I have a table as defined below that contains some configuraton values. ConfigurationID CharacteristicID CharacteristicValue --------------- ---------------- ------------------- 1234567890 Lenght 2300 1234567890 Height 1900 12345678...more >>

design help
Posted by ari at 9/29/2005 7:02:02 PM
hey all, can someone please help me design the following: 9/29/05 Cut Lawn $20 Date of Service Service Type Price Payment Due Trans Type Payment Amount Payment Date 9/29/05 Cut Lawn $20 10/29/05 Bill 9/29/05 Cut Lawn $20 10/29/05 Payment $10 10/1/2005 9/29/05 Cut Lawn $20 10/29...more >>

IN Clause!
Posted by Adam Knight at 9/29/2005 4:49:53 PM
Thanx to those who have helped previously. You have been quite exceptional in your help!! I am learning so much!!! I have accidently posted this under an older thread so forgive the double post. I have the following query: //query above asigns @attempt_id SELECT Count(DISTINCT asm...more >>

Linking SQL Server to a DBF file
Posted by Zachary Hartnett at 9/29/2005 4:23:34 PM
I believe I should be able to link to a .dbf file as a Linked Server through SQL Server. For instance, in C# code, we can connect with a DBF file using either ODBC... --------------------------------------------------------- System.Data.Odbc.OdbcConnection odbcConnection = new System...more >>

executing sp_changeownerdb
Posted by Jason at 9/29/2005 4:21:18 PM
Hi, I've a problem executing sp_changedbowner in my stored procedure which is saved in the master's stored procedures. The code fails after executing @proc1. The errors says that i could not find proc2. Here's the code: CREATE PROC usp_RestoreDB( @db_name varchar(10), @backup_locat...more >>



order by
Posted by gv at 9/29/2005 3:55:43 PM
Hi all, I Apologize if I'm not clear, I'm going to try and explain what I need. This query works fine: On the table "k" there is a display_order column that I would like the k.sentence_name ordered by. If I add vk.display_order in the order by, I have to add it as well in the select but,...more >>

book recommendations: ETL
Posted by sqlster at 9/29/2005 3:46:03 PM
Could any one please recommend some good books on sql server 2000 ETL best practices ?? I am trying to learn some best practices regarding this subject so any white papers, articles, web sites, books would be greatly appreciated. TIA......more >>

SP returning multiple resultsets
Posted by Henrik Skak Pedersen at 9/29/2005 3:45:57 PM
Hello, I have a stored procedure which is traversing a tree. The table looks like this: Organization (OrganizationId, ParentOrganizationId, ect....). The stored procedure is looking like this: ALTER PROCEDURE dbo.ShowHierarchy ( @Root varchar(10) = NULL ) AS BEGIN SET NOCOUNT ON ...more >>

Linked Server Question
Posted by Mike Labosh at 9/29/2005 3:41:50 PM
We have a dev server, HORSQL01 and a production server, HORSQL02 Each one is listed under the EM Linked Servers node of the other. But I am confused. When I open up the Linked Servers\HorSql01 node, I don't see a list of databases on HorSql01, I just see a tables node and a view node. Ca...more >>

How Do I Fix This Proc?
Posted by Hal Heinrich at 9/29/2005 3:29:02 PM
In a multi-user environment, this proc is expected to return distinct values for concurrent users - but it doesn't, some duplicates are returned. I thought that the 'BEGIN TRAN/COMMIT' would provide the required locking - I'm guessing that's where I went wrong. How do I fix this proc? The DDL ...more >>

SQL Statement
Posted by helpplease at 9/29/2005 3:20:01 PM
Hi, I'm having a tough time writing a sql stmt. Any kind of help is very much appreciated. The info is as follows: SalesOrder sono so-suffix solineno qtyord netamt 1495738 1 33 3 4779.45 1495738 0 33 3 0.00 1490...more >>

Simple query?
Posted by Tom Gaughan at 9/29/2005 2:02:08 PM
This seems like it should be simple... I have a simpel select query that is selecting customer records. SELECT CustomerNumber as [Cust #], ItemNumber as [Item #] WHERE CustomerNumber IN ('1', '2', '3') Sample result: Cust # Item# 1 100 1 ...more >>

Unknown Columns!
Posted by Arpan at 9/29/2005 1:32:31 PM
My application retrieves records from a SQL Server 7.0 DB table for which I am using a stored procedure but while coding, I am not aware of the no. of columns existing in that DB table. Neither am I aware of the column names while coding. Also more columns can get added to the table in the futur...more >>

Extracting image column to the file
Posted by Gene at 9/29/2005 1:25:06 PM
Hello all, how can I extract image strored in DB in to file? Will something like this work? DECLARE @cmd VARCHAR(2048) SET @cmd = 'bcp select history_image from recipient where recipient_id = 1 queryout c:\test\625954.jpg ' EXEC master..xp_cmdshell @cmd, NO_OUTPUT...more >>

"Net Send" from SQL2000 on Windows 2003.
Posted by Geir Holme at 9/29/2005 1:03:15 PM
Hi all. The following command don't work on ours SQL server anymore. Not sure why, but could it be that the command "Net Send" is removed for NT 2000? Any ideas. Thanks Geir DECLARE @Message varchar(255) Set @Message = 'net send USER Message to OLNY from SAM : . TEST, TEST, Price to ...more >>

Stored procedures, permissions, table names
Posted by Jure Bogataj at 9/29/2005 12:48:47 PM
Hello all! I'm having problems regarding executing stored procedures under differents users or different database. I have, let's say 100 tables with the same name, but different owners. Picture this scenario: User: dbo (login: sa) Table: MYTEST (FullName: [MyServer].[MyDatabase].[dbo].[MYTE...more >>

return results of lastest date
Posted by gv at 9/29/2005 12:34:03 PM
Hi all, The following query returns the following results. SELECT docCategories.docCat, docNames.docName, docVersions.docVersionDate FROM docCategories, docNames, docVersions WHERE docNames.deletedFlag = 0 AND docNames.docCatID=docCategories.docCatID AND docNames.doc...more >>

Permission confusion
Posted by DazedAndConfused at 9/29/2005 12:09:48 PM
It seems by default the public role is granted very generous permissions. When I tried DENY ALL TO public is didn't seem to have any affect. I know it will work by listing the objects or going into enterprise manager and denying. I am tempted to pull all permissions from public and then onl...more >>

Autoincrement
Posted by Denis at 9/29/2005 12:01:38 PM
Hello I've a table of Users with an identity key Some records are inserted by a replication system which sends records with key like 2-4-6-8 ... and put them into the table with a INSERT sql Other records are inserted via web I need that the records inserted via web takes a key lik...more >>

Can someone explain why this is not an error?
Posted by DWalker at 9/29/2005 11:48:05 AM
I accidentally did something similar to this, and I can't figure out why it doesn't give an error. Use Pubs Select * From Authors Where Au_LName In (Select Au_LName From Publishers) Of course, "Select Au_LName From Publishers" by itself gives an error message since Publishers doesn't h...more >>

XML insert
Posted by simon at 9/29/2005 11:33:11 AM
I have XML file with the same structure as table in SQL 2000. What is the fastest way to insert all data from xml file into table? Using data set, BLOB insert, XML insert,... regards, Simon ...more >>

VPN and EM timeout problem
Posted by PJ6 at 9/29/2005 11:19:36 AM
For some reason I cannot connect to a SQL server with EM over a VPN connection, I keep getting a timeout error. What bugs me is that this "timeout" happens within a second or two - normally network timeouts are like 30 seconds. I've never had this problem connecting to other SQL servers over...more >>

Need advice with a query
Posted by News at 9/29/2005 11:09:18 AM
Hi, I need an advice. I have a new project where I have to store employee salary values in order to keep historical representation of all changes done to the employee record. Below is the approximate model how I am going to proceed. My question is, how would I pull ee salary at certain da...more >>

Bulk Loading: TempFilePath security question
Posted by isbat1 NO[at]SPAM yahoo.com at 9/29/2005 11:06:22 AM
I've got a program written that runs on one computer and performs bulk updates to a SQL Server 2000 table on a different computer. I also need transactional behavior, so I have to specify a value for TempFilePath on my SQLXMLBulkLoad3Class object. I do not have permissions to create folders, ...more >>

adding 140,000 records requires index rebuild. make sense?
Posted by John Mott at 9/29/2005 10:47:55 AM
hello all, i have a table thats getting about 140,000 new records a day from a program reading data from a socket (about 300 every 3 minutes). in addition to the primary key it has an 8 byte date/time field thats indexed. there are also two full-text indexed columns with change tracking and up...more >>

server registeration problem...
Posted by === Steve L === at 9/29/2005 10:15:42 AM
Background: sql2k on windows 2k3 servers. I'm managing an remote offsite sql server for a company. I recently installed a second instance of sql server (server\dev) on the same box, but haven't been able to register the 2nd instance remotely from my laptop. I used mstsc to access server direct...more >>

Cursor variable not declared issue
Posted by SJM at 9/29/2005 10:09:44 AM
Ok, I missed the boat somewhere. I prepared the query below to go though all the columns and tables in the database and return the count of distinct values for each column and label them with the table and column names When I run the query, I receive the following error from the part la...more >>

Scale not correct in query
Posted by larzeb at 9/29/2005 10:00:44 AM
The 2 queries below return different values for b.cost. I don't understand why. The 2nd query returns 575.112, the correct value, where the first returns 580.00. declare @BeginDate Datetime declare @EndDate Datetime set @BeginDate = '20050928' set @EndDate = '20050928' DECLARE @FinalDate...more >>

Return Variable In Resultset!
Posted by Adam Knight at 9/29/2005 9:54:09 AM
Hi all, I am still learning my way around TSQL!! SELECT TOP 1 @attempt_id = asmt_v2_attempt_id FROM asmt_v2_attempts WHERE asmt_v2_employee_id = @eid AND asmt_v2_area_id = @aid ORDER BY asmt_v2_attempt_id DESC Using this print statement i can return the output t...more >>

Column to Search in DB
Posted by KD at 9/29/2005 9:34:04 AM
Hi, Can anyone help me by telling the sql statement through which I should be able to locate the table which contains that ColumnName.... Thanks in Advance KD...more >>

Database size entry?
Posted by Dave H at 9/29/2005 9:14:21 AM
Which system table is the currently defined size (hopefully the total size) of the data and log devices found? I'm assuming in master somewhere? sysobjects? I just can't find it... thanks ...more >>

Help with subquery
Posted by CD at 9/29/2005 8:57:03 AM
O.k. the following query works, unless there is more that one value a column. It tells me, "Subquery returned mor than 1 value. This is not permitted when the subquery follows =, or when the subquery is used as an expression". How can I get this query to format each item in a column? d...more >>

Query From ACCCESS to MSDE
Posted by PiantoTardivo at 9/29/2005 8:49:10 AM
First of all....sorry for writing in english. I'm trying to pass from access to msde. I have a query that returns some values to populate a listview. With access this query works in the right way, but in msde i have some problems . That's the query rs.Open "select * from anagp inner join ing...more >>

How to select all values for stock, which match certain condition
Posted by at 9/29/2005 8:46:44 AM
Hi, I need to make a query on a single table containing historical stock data, something like: ID, StockID, Date, Open, Close, Volume, ... The problem is that I need to get All records for the stock, for which at least one record matches some condition. An obvious solution is: select ...more >>

xp_cmdshell to open/close file
Posted by sqlster at 9/29/2005 8:46:16 AM
Hi all, Does any one know tsql syntax to open and close a file on network drive? Of course this command should execute in proper security context. TIA.....more >>

Get Value of IDENTITY
Posted by ReTF at 9/29/2005 8:37:57 AM
Hi, I need get value of IDENTITY column after a insert (of the inserted item), hava way to do this automatic, or same function that do this? Thanks ...more >>

Update Trigger
Posted by Ron Wallegie at 9/29/2005 8:29:19 AM
Hi all, I have a question about triggers. I created a Update tigger on a table. When i do a update statement on the table on multiple rows, the trigger only fires ones. Can someone please help me with this problem..... Regards Ron ...more >>

EXEC or EXECUTE, SET or SELECT
Posted by SureshBeniwal at 9/29/2005 7:21:20 AM
Hi pls find time to throw some light on whether and where to use EXE/EXECUTE and SET/SELECT? What are the differences? Another thing..if we start a trigger and within the transaction statements we first truncate any table and then call rollback, will that table be rolled back or not? What...more >>

convert adDBtimeStamp to datetime
Posted by Lucian Baltes at 9/29/2005 6:59:06 AM
Hello, I use a SQL Server with ODBC driver and >NET C#. I want to convert a date field with adDBtimeStamp format to a DATETIME format, but no solution could be found till now. My query is as follows: SELECT received_at as EXPR1 FROM TTable WHERE datepart(week(datetime(r...more >>

Inner join in an update
Posted by Arne at 9/29/2005 6:40:01 AM
How do I translate this statement from Access SQL to MS SQL: UPDATE Market INNER JOIN MarketSys ON Market.MarketID = MarketSys.CurrentmarketID SET Market.EndPeopleRegDt = '1/1/2006'...more >>

query
Posted by tom taol at 9/29/2005 6:13:31 AM
dat temp ani 2 fruit 3 ani 1 clothes 4 ani 3 i want to make below that from 1 table(name:tbl) upper aniCnt clothesCnt fruitCnt 3 1 1 how make query statement? *** Sent via Developersdex http://www.developersdex.com *...more >>

Index Tuning Wizard
Posted by Wes at 9/29/2005 6:02:01 AM
I am running the index tuning wizard to evaluate a query for optimization. I am applying additional non clustered indexes were I feel it should benefit the query. After running the Index Tuning Wizard - the recommendation is to remove the indexes that I have applied. Looking at the Statisti...more >>

Trapping fatal error
Posted by Karthik at 9/29/2005 5:30:03 AM
Hi, I work as part of a testing team that does a lot of stress testing of database. At times we run SP's that goes into a loop millions of times and inserts test data. Once in a while these SP's terminate abruptly because of lack of space and I get a fatal error with severity 17. How do I g...more >>

WHILE Loop with parameters from a varchar parameter
Posted by Xavier at 9/29/2005 3:51:03 AM
hello, i need to read the value of a parameters for the loop from a local varchar variable example for the variable: '1,4,8,9,22' or '3,5' or '44,5,8,9' How can i get the information - how many comaseparated values are in that variable - result -> 5 - what are this values val(1) ...more >>

bcp
Posted by Vanitha at 9/29/2005 2:31:11 AM
hi friends, whats the command used to bulk copy all the tables from the database? pls help me to solve this. thanks vanitha...more >>

How to check Backup of SQL Server Database
Posted by ikosianski NO[at]SPAM gmx.net at 9/29/2005 2:17:38 AM
Hallo, MSDB.dbo.BackupSet logs all backups is it possible find Status of Backup (Success / Failed)? Table "BackupSet" hasn't any information about it. I need log and notify all backups with status (It must be a windows service (c#) Thanks ...more >>

solve this query
Posted by raghu veer at 9/29/2005 2:11:01 AM
my databases are designed 5 years ago and users have creating tables on their own. so the design is bad it is facing performance problems and query timeout issues. it is taking time to retrieve the records deadlock issues are cropping up inserts are not working in replication what should i do...more >>

INSTEAD OF trigger on a VIEW ignore (sometimes) IDENTITY columns
Posted by Frederik Mangelsdorf at 9/29/2005 2:01:03 AM
Dear all, I'm very puzzled by SQL Server 2000 sometimes ignoring IDENTITY columns in INSTEAD OF triggers on a VIEW. If I create a VIEW on a TABLE with an IDENTITY column but *witout* computed columns in the view, then I can insert into the view and omit the IDENTITY column. In this scen...more >>

Querying all users on different database on each server
Posted by Tony at 9/29/2005 1:39:08 AM
Hi. i have users having access to different database stored on different servers I'd like to access all user details.I s there a way? please assist -- Eager to Learn...more >>

please tell me how to know when a deadlock occurs in sp
Posted by raghu veer at 9/29/2005 1:15:37 AM
can i write a trigger which tells me when a deadlock occurs...more >>

Using a Filename as a variable in Bulk Insert
Posted by fumanchu at 9/29/2005 1:01:44 AM
Help! I must allow my users to specify the file name (but not the path) for an Excel generated CSV file so that I can put the data in their billing table. I have no control over the filename, but the path is 'e:\path\' I tried loading an intermediate table as: CREATE PROCEDURE [LoadTest]...more >>

DB design question: optional relationships: any patterns?
Posted by Francois Malgreve at 9/29/2005 12:36:13 AM
Hi everyone, I am designing a Database but I don't have much database architecture experience. I have a kind of issue in the schema of the Database we deisgn that is repeated in a few places. As it seems to me something pretty basic, I think that this must be some kind of pattern that someo...more >>

How to retrieve schema bound to a Query?
Posted by Gopinath M at 9/29/2005 12:35:03 AM
Hi , Can you please tell me how to retrieve schema associated with a query? Here is the sample query for which i want to know DATATYPE, LENGTH of every column which i'm selecting in the query. SELECT Tbl2.Name, Tbl3.Age, Tbl1.ID, Ttb2.DOB FROM Table1 Tbl1, Table2 Tbl2 WHERE Tbl1.Key = Tb...more >>


DevelopmentNow Blog