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 > august 2007 > threads for monday august 27

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

Date in csv file are NULL!!!
Posted by Marc Robitaille at 8/27/2007 11:55:37 PM
Hello group I need Assistance on this one. I have a VB6 application which imports csv data in a database. There are 24 csv files. Some files contain dates like this example ENL80071666;REG00024;1999-01-01;1999-06-03;1999-12-31 ENL80071666;REG00024;2000-01-01;2000-01-01;2000-12-31 ENL8007...more >>


Caching for remote query
Posted by Shiju Samuel at 8/27/2007 11:21:35 PM
I am wondering where the plan is cached for a remote query? If I have query in proc. SELECT * from TABLE1 a JOIN SERVER2.db.dbo.RemoteTable b ON a.col1 = b.col1 WHERE a.col5 = 56 and b.col3 = 19 will it be cached in the first server or second server or both? Thanks Shiju Samuel...more >>

Aggregate to return all values concatenated?
Posted by csimam NO[at]SPAM gmail.com at 8/27/2007 10:51:11 PM
Hello, Is there an aggregate function that acts like SUM but for strings... so that the result is a long string of the concatenated values, with say commas? For example: ID , StringValue 100, "ABC" 100, "DEF" 100, "GHI" 200, "ABC" 300, "ABC" What I'd like to get is: 100, "ABC,DEF,...more >>

table partition
Posted by Ed at 8/27/2007 8:02:03 PM
hi, I currently have a table that has 10 years of data. Users are most likely to query the last two years of data. I am planning to create a table partition with 3 FGs. 1. 2006 and beyond 2. 2004 to 2005 3. before 2004 However, in the year of 2008, i would like to have 1. 2007 and ...more >>

Trigger on change event is case is changed
Posted by Darin Spence at 8/27/2007 6:40:21 PM
Is there a way to trigger the on change event if the case is changed on an ID record? I have one table that needs to be able to do this. Currently, if the user changes the case of the text, the on change event is not triggered. Thanks, -Darin ...more >>

patient's data-really confused
Posted by Infinity at 8/27/2007 5:24:00 PM
Hi Guys, I have got a table of patients where each patient has got a unique patient number.There are different services which a patient can undertake such as resthome, dementia etc. Here is the sample data Service patientNo startDate EndDate resthome 12 01/04/2003 03/05/2003 resthome...more >>

My available memory is down to very little, yet my PF Usage is 8 gigabytes (about how much memory is on the box), sql server keeps having memory issue
Posted by Daniel at 8/27/2007 4:38:22 PM
My available memory is down to very little, yet my PF Usage is 8 gigabytes (about how much memory is on the box), sql server keeps having memory issues yet the sqlservr.exe is using hardly any memory.. how to fix this? is there some way to limit how much memory can be used by this PF Usage? wh...more >>

in sql server is it possible to get the amount of memory used by a stored procedure? e.g. memory usage statistics per stored procedure?
Posted by Daniel at 8/27/2007 4:26:23 PM
in sql server is it possible to get the amount of memory used by a stored procedure? e.g. memory usage statistics per stored procedure? ...more >>



Order By question about ignoring "The", "A", "A"
Posted by Brian Simmons at 8/27/2007 3:07:32 PM
Hi All, Is there any clever techniques to get data to sort appropriately by ignoring words like "The", "A", and "An" in titles. I.e. the data might be: Serpico A Night To Remember A Long Kiss Goodnight The Old Man In The Sea Batman Normally it would sort as: A Long Kiss Goodnight ...more >>

Join Question: Joining on a single record per ID
Posted by Mike Biang at 8/27/2007 2:53:36 PM
Hi, I am wondering if the following is possible, and, if so, how to accomplish in SQL Server 2000: I have 2 tables: Properties and PropertyImages Properties has the following format: PropertyID (PK) PropertyName etc... PropertyImages has the following format ImageID (PK) PropertyID (F...more >>

Replace text using a Join
Posted by at 8/27/2007 2:29:24 PM
I'm running the query below to replace one letter. I run SELECT replace(ePPA_No, 'n', 'Y') FROM medman_purge INNER JOIN in4_purge ON medman_purge.Col001 = in4_purge.eppa_no with no problem, and it replaces the 'N' with 'Y' perfectly. When I try to set it using this query: update in...more >>

The order has been changed when I inserted data into a new table.
Posted by Alex at 8/27/2007 2:28:00 PM
I am using OpenQuery in a stored procedure to pull out data from AS400 DB2 and select into a new table. The data has been sorted in the OpenQuery passed in DB2. However, I find that the order of the data is different from the DB2 when I check the table of MSSQL sometimes. It looks like that MS...more >>

ODBC excel Macro help needed
Posted by Dan at 8/27/2007 2:11:49 PM
Can someone tell me what is wrong with this? With Selection.QueryTable .Connection = Array(Array( _ "ODBC;DSN=Commerce Center;DATABASE=CommerceCenter;Trusted_Connection=Yes")) .CommandText = Array( _ "SELECT *" _ , _ "" & Chr(13) & "" & C...more >>

date format
Posted by rodchar at 8/27/2007 1:58:06 PM
hey all, i'm in sql management studio and i'm using PRINT GETDATE() and it prints it out like the following Aug 27 2007 4:52PM how do i get it to print like: 8/27/07 thanks, rodchar ...more >>

2008 Mirroring
Posted by CLM at 8/27/2007 1:26:04 PM
I just read with geek-like excitement that Sql Server 2008 will do the following: "Database mirroring in SQL Server 2005 enables clients to automatically redirect to a mirrored server in the event of a failure in the principal database. However, it requires special client configuration to s...more >>

Index Tuning under heave load...
Posted by Michael Kansky at 8/27/2007 1:25:31 PM
Running SQL 2005 I am trying to find the best way to tune/defrag the indexes on a database which stays under heavy load 24/7/365 About 1-5 million records added daily...By the end of the day query performance decreses dramatically. DBCC DBREINDEX does the job the best but it is an OFFLINE o...more >>

EncryptByKey Script Problems! HELP
Posted by SteffiDBA at 8/27/2007 12:58:04 PM
I need help with the syntax for encrypting columns for two tables. The scenario that I have is two tables with CCnum field in them which needs to be encrypted. For certain process I insert the credit card number into the 1st table and then move the data into the second table; but in other pro...more >>

Need an expert advice with design
Posted by Chris at 8/27/2007 12:52:03 PM
Hi, I need to print pre order documents based on the items selected. To accomplisg this I've ceated a table called printjobqueue, when the user selects the items and click print, I generate a printqueueid (GUID) and send it down to the table. So, multiple items have the same GIUD to appear on...more >>

INDEXPROPERTY db scope problem
Posted by Jay at 8/27/2007 12:09:04 PM
SQl Server 2000 The following script shows my problem. In a program that loops through all databases and tables, I need to determine if a table needs a defrag. One of the conditions is that the index tree is more than one level deep. I'm using dynamic sql and setting the db scope by includ...more >>

Multiple statements on a single command string?
Posted by Carlo Razzeto at 8/27/2007 11:08:34 AM
Anyone know if executing multiple sql statements (i.e. update table1, update table2, update table2) all in a single command string (semi-colons between statements) will guarontee that all statements execute as a single transaction. i.e. if an error happened after update table2 would all prev...more >>

Storage Alignment
Posted by CLM at 8/27/2007 10:40:03 AM
I was reading this link on performance recommendations: http://www.microsoft.com/technet/prodtechnol/sql/2005/physdbstor.mspx What do they mean by these statements? --Storage-align commonly joined tables for faster joins and better maintenance. --Storage-align indexes with their respecti...more >>

ObjPointerToBeDestroyed int IN error
Posted by Nick at 8/27/2007 8:58:03 AM
Hi. I realized an sp in SQL Server 2000 in which I use the sp_OACreate & Co for manage XML file via MSXML2.DOMDocument object. During runtime the sp fails with the error -2147211480 description: sp_OADestroy: ObjPointerToBeDestroyed int IN. source: ODSOLE Extended Procedure Is there anyon...more >>

running a stored proc for all records
Posted by rodchar at 8/27/2007 8:54:03 AM
hey all, i have a stored procedure that takes an EmployeeID and returns a single table. How can i automate running this stored procedue for each employee in my table? thanks, rodchar ...more >>

SQL Server Management Studio and DTS
Posted by PSULionRP at 8/27/2007 7:46:05 AM
I am a "newbie" to SQL Server Management Studio. Coming from an Enterprise Manager and SQL Query Analyzer background. Why can't I seem to find DTS packages within SQL Server Management Studio??? Am I missing something??? So do I have to go back to Enterprise Manager to manage DTS packages??...more >>

Moving file groups - Drop_EXISTING versus MOVE TO
Posted by Ewen at 8/27/2007 7:34:05 AM
Is there any difference between the following techniques for moving a table across filegroups ?? -- Method 1 : Create existing index on a new group with 'drop_existing' option -- ------------------------------------------------------------------------- Create unique CLUSTERED index [PK_...more >>

Moving heap tables to a new filegroup
Posted by Ewen at 8/27/2007 7:16:02 AM
Is the only way of moving a heap table to another filegroup by creating a 'dummy' clustered index on the new group and then dropping it ?? ...more >>

WAITFOR DELAY + @@version + script Problem
Posted by sumanatnet NO[at]SPAM gmail.com at 8/27/2007 7:06:46 AM
Hello, I am facing a problem with SQL Server Data in the table, it automatically inserts some values like @@version waitfor delay 0 0 20 script @@version123 /script script alert123 /1 waitfor delay 0 0 20 x ` alert123 /script x `.... x waitfor delay 0 0 20 .... this is an example, li...more >>

is this an expensive query
Posted by rodchar at 8/27/2007 6:44:00 AM
hey all, please see image link below. what do i look at in the query plan to know that this might be an expensive query? http://home.comcast.net/~charity154/sqlques200708270923.htm thanks, rodchar...more >>

getDate and Between
Posted by Bob at 8/27/2007 2:37:44 AM
I'm writing a report that returns a count and sum of invoices/invoice amounts. I need to group by invoice date....getting Inv Date <=31,,,,Between 31-60 Days...Between 61-90 Days....and > 90 Days. I'm using getDate with DateAdd like this.... Where InvoiceDate >=DateAdd(d,-30,getDate()) ...more >>

Check if Stored Procedure Exists
Posted by Smithers at 8/27/2007 12:59:18 AM
Using SQL Server 2005 - I need to programmatically check to see if a stored procedure exists (from a C# client application) in a particular database, and... 1. when the SP does not exist, then I would like for an exception to NOT be thrown (from whatever method I use to attempt to locate it...more >>

join instead of nested queries
Posted by Jure Bogataj at 8/27/2007 12:00:00 AM
Hello! I have had this problem on several cases now and I'm wondering if it is even possible to achieve the result with SQL (using .NET 2005, SQL Server 2005): I have a table from which I would like to retrieve records, and previous records for those records based on some criteria. For exa...more >>

Simple question on "GROUP BY"?
Posted by csimam NO[at]SPAM gmail.com at 8/27/2007 12:00:00 AM
Hello, This must be the simplest question on 'group by', but after searching the web for the past hour, I can't find any help on it. I'm very bad at searching and databases then... Here is a simple table: Name, Hours John, 10 Jill, 15 Harry, 20 All I want to know is how to write a q...more >>

Microsoft choose in their implementation of SQL Server 2005 to ignore...
Posted by JP Ueberbach at 8/27/2007 12:00:00 AM
IS THE FOLLOWING TRUE FOR SQL SERVER 2005?: All, this is just an FYI in the event you are working with MS SQL Server = 2005. It has recently come to our attention that MS SQL Server 2005 does not allow ProvideX to emulate EXTRACT's when SQL Server is running in 2005 mode. In order to ...more >>

Problems attaching AdvetureWorks database
Posted by Antonin at 8/27/2007 12:00:00 AM
I have SQL Server 2005 running on Windows 2003 Server. I attached the AdventureWorks database without any problems. When I try to do it on Windows XP I got an error saying: Could not find row in sysindexes for database ..... Thanks for any suggestions. Antonin ...more >>

T-SQL articles
Posted by Alan T at 8/27/2007 12:00:00 AM
Any suggestions on T-SQL programming articles websites besides www.sqlmag.com? ...more >>

Create Trigger
Posted by Faye at 8/27/2007 12:00:00 AM
The trigger executes fine but why I get this error 'Cannot insert the value NULL into 'updt_id', table... ' when I add a record. Here is my trigger, set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go ALTER TRIGGER [sat_bank_info_trgi] ON [sat_bank_info] FOR INSERT, UPDATE AS INSERT...more >>

ALTER INDEX
Posted by Supriya at 8/27/2007 12:00:00 AM
Hi All, Using ALTER INDEX how to change the order of columns. Eg: CREATE INDEX IX_Employees_ToChangeOrder ON Employees (FirstName,LastName); I want to alter order of columns Employees (LastName,FirstName) or Employees (FirstName,City) . Can anybody help me please. Thnaks Supr...more >>

Retrieve Comma seperated list without a cursor
Posted by Martin at 8/27/2007 12:00:00 AM
Hi, I am selected a column from a table. There are multiple rows in the table therefore the select statement will bring back multiple rows. Is it possible to read all of the names into a comma seperated string without the use of a cursor. for example if I have a table with three records in...more >>

creating a stored procedure in the master database
Posted by Yan at 8/27/2007 12:00:00 AM
Hi, sql server 2000 sp4. I would like to create this sp in the master for the ability to call it from any database because I have several publications on the server. When I am in the cotxect of a user database and I exec the sp I receive the error msg 'Invalid object name' for the three...more >>

Can't connect through OLE DB to remote host - Database 'XXX' does not exist.
Posted by panko at 8/27/2007 12:00:00 AM
My application is to get some data from SQL/OLAP server. When I try to open OleDbConnection using connection string: "Provider=MSOLAP;Data Source=servername;Initial Catalog=dbname;" I get message: Database 'XXX' does not exist. I can easily connect in the same way to localhost. My user is olap...more >>


DevelopmentNow Blog