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 > may 2007 > threads for monday may 21

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

Problem with linked server
Posted by Lasse at 5/21/2007 11:28:29 PM
Hi, I have setup a linked server connection to a 2000 server ("MyRemoteServer") from a 2005 server. The link is working, I can for example make select statements. However when I execute a stored procedure on the 2005 server which in turn calls a stored procedure on the "MyRemoteServer" server...more >>


String Manupulation with SQL Help Needed!
Posted by vrao5090 NO[at]SPAM sbcglobal.net at 5/21/2007 8:22:55 PM
Hello: Here is the situation: There is a table (FILELOCATION) with two columns, one has an ID (integer) and another one is called FILES (string). BTW, these are not my creation! The FILES column contain location of various files. Examples are as follows: ID Files --- ----------...more >>

date format in m/d/yyyy
Posted by Kay at 5/21/2007 6:41:59 PM
Hi, How can I display date in format m/d/yyyy. I searched BOL but could not findy any aurgument for CONVERT or CAST function to deal with. TIA Kay ...more >>

says variable is not declared but it is
Posted by jonefer at 5/21/2007 6:22:03 PM
I keep getting the following error : Server: Msg 137, Level 15, State 1, Line 6 Must declare the variable '@MaxCourses'. For the following: DECLARE @MaxCourses int DECLARE @sql nvarchar (4000) DECLARE @ParamList nvarchar(4000) DECLARE @SL nvarchar(50) DECLARE @Dir nvarchar(50)...more >>

Purge Process needed
Posted by Daniel at 5/21/2007 6:19:33 PM
Need to purge a certain table every 24hrs But there are some requirements I need to purge the table of data that is 24hrs old starting at 10pm we are capturing timestamp on record insert, so if a record still exists in this table when we run the purge, if it is 10pm or 24hrs before then i...more >>

ISNULL and WHERE
Posted by Kevin L at 5/21/2007 4:31:22 PM
I have a Stored Procedure that has a column that sometimes has a value of NULL. When NULL, I would like to give the resulting column a value of "Other". For this I am using the ISNULL function which gives the desired result (meaning my NULL column has a real value). Possible values for thi...more >>

One more SQL script help!
Posted by vrao5090 NO[at]SPAM sbcglobal.net at 5/21/2007 4:04:46 PM
Hello: Here is the situation: There is a table (FILELOCATION) with two columns, one has an ID (integer) and another one is called FILES (string). BTW, these are not my creation! The FILES column contain location of various files. Examples are as follows: C:\WINDOWS\Help\AGT0406.HLP C...more >>

text datatype in new SQL Server
Posted by mgm at 5/21/2007 3:18:58 PM
I read in help that the text datatype is going away. Does anyone know what will replace it? Or do you know where there is an article that may describe an alertnative? Thanks. ...more >>



SQL Table with Integer Columns - Convert NULL values to 0 (zeroes )
Posted by John Smith at 5/21/2007 3:04:41 PM
Hello, I have a SQL 2000 table with several hundred thousands records. These records have several varchar columns (which are good and don't need to update) and some integer columns that have some records with null values in there. I would like to convert all those null values from the inte...more >>

recursive table function
Posted by WebBuilder451 at 5/21/2007 2:50:00 PM
i'm trying to define this: (see Below) which does work ok, except it will not accept the OPTION (MAXRECURSION 0). The Function will compile(run) with out the option, bu it will only goto a max of 100 levels before erroring out. How can i get the recursion level up to unlimited? with dates ...more >>

moving millions of records from one table to another
Posted by gv at 5/21/2007 2:37:40 PM
Hi all, Using SQL 2000 sp4 I'm basically archiving old data, so I'm copying over data I want to keep into another table with some new indexes. Looking for the fastest way to do this? Coping within the same database(Full mode) 100 million row table, from one table to another. Step...more >>

RETURN within a transaction
Posted by Offeral at 5/21/2007 2:25:00 PM
If you use a RETURN command in the middle of a transaction, does SQL rollback that tran or does it leave it open? Thanks in advance, Offeral...more >>

Calling SP from select
Posted by tshad at 5/21/2007 2:15:23 PM
Can you call a stored procedure from a select statement? I already have a stored procedure "GetCurrentCharges" that is a stored procedure that passes back various pieces of data (Rate,PricePerUser,TotalCharge and CurrentCharges for example) and would like to be able to do something like: ...more >>

comparing strings?
Posted by VMI at 5/21/2007 1:56:51 PM
What comparison can I make so that I know that string "AD" is greater than string "AC" and less than string "AZ", but it's less than both string "CA" and "ZA"? Thnks. ...more >>

Audit Trail - Trigger vs. SP
Posted by bluefish at 5/21/2007 1:15:00 PM
Hi, We are in need of setting up Audit Trail for one of our apps- About 60 tables, each table 620 columns. Our group seems to be spilt about using triggers vs. SP for this. My question is, is there a performance advantage to the master table (Table being audited) if we do this in a SP r...more >>

Changing sa Password in 2005
Posted by scott at 5/21/2007 12:56:22 PM
How can I change the password of the "sa" account in SQL 2005 Standard edition? ...more >>

Query Analyzer connect to Postgresql in SQL 2000?
Posted by bringmewater NO[at]SPAM gmail.com at 5/21/2007 11:22:53 AM
I'm able to connect using DTS and a PG ODBC driver but is there a way I can connect to Postgres using some ODBC or OLE DB commands directly in Query Analyzer so I can run a Select statement? I can't seem to find any examples. Thanks ! ...more >>

While loop VS Cursor
Posted by loufuki NO[at]SPAM gmail.com at 5/21/2007 10:06:12 AM
Which one is better in SQL Server? Thanks ...more >>

Log File
Posted by CLM at 5/21/2007 9:22:01 AM
I’ve got a 2000 database with FULL logging and log backups occurring about every 15 minutes. If you look at the log file using View/Taskpad, I see that this database has about 160M used and 9G free in its log file. Of course, I realize you should leave your logs with ample space so you ...more >>

Understanding connections
Posted by Ron J at 5/21/2007 9:01:14 AM
Hi, I'm using ADO 2.8 to connect to SQLserver2000. I'm trying to understand that when I open a connection to it, I can use EnterpriseManager and it shows up to 3 connections. I know I created one. Is this normal? pooling? So how can I tell when I release the connection that it is actually rem...more >>

Identify Redundant Indexes (Indexes with poor value selectivity)
Posted by DBX1 at 5/21/2007 8:23:01 AM
Hi All, Any body know of a foolproof way to identify indexes that have been created on a very narrow range of values, that probably would not be required for example: A column representing 'HasRecievedRegistrationEmail' 0 / 1 - two values are only possible. In some systems I have seen ...more >>

Bulk insert, skip rows with duplicate key error?
Posted by sandal at 5/21/2007 8:14:27 AM
Does sql server have a way to handle errors in a sproc which would allow one to insert rows, ignoring rows which would create a duplicate key violation? I know if one loops one can handle the error on a row by row basis. But is there a way to skip the loop and do it as a bulk insert? It's ea...more >>

How to read/write chunked to varbinary(max) in C#?
Posted by rene.ruppert NO[at]SPAM online.de at 5/21/2007 8:12:09 AM
Hi, I have read lots of articles of how to write chunked to a TEXT field in SQL server but I cannot find any useful info on how to do it with SQL Server 2005 and the new varbinary(max). Can someone help me? Maybe even with some sample code? What I want to do is... a) write a stream to a va...more >>

Using EXEC within a SELECT statement
Posted by Mike at 5/21/2007 7:46:00 AM
Hi. I have a SELECT storedproc named spGetUnit which returns a single scalar value. I'm trying to create a separate SELECT stored which executes spGetUnit within it's SELECT command. Here is how I have it- Select E.EmpName,E.Salary,Unit=exec [spGetUnit] @EmployeeID=E.EmpName FROM Employ...more >>

error at the time of attaching the DB
Posted by Farhan Iqbal at 5/21/2007 6:14:03 AM
My DB Server has been Creased and I don't have any backup plz don't ask why?, I recover the mdf and ldf files from the OS but when I am doing to attached the files so getting the error ... The header for file 'E:\data\mssql\data\ems_Data.mdf' is not a valid database file header. The PageAud...more >>

Rebuild Master
Posted by Sammy at 5/21/2007 4:02:01 AM
When rebuilding the master database,if the server had a particular service pack. I assume I would have to reapply this service pack as the master database will have lost all this information. As part of this rebuild I will not be restoring any of the system databases as none of these wer...more >>

Script Help Required
Posted by Terry Holland at 5/21/2007 3:10:16 AM
I am trying to script the following - enable SQL authentification - assign “sa” password - add login (including password) - add user - assign user role (db_owner) - assign user password could somebody assist please tia Terry Holland...more >>

smalldatetime
Posted by farshad at 5/21/2007 2:49:01 AM
declare @ValueDate smalldatetime set @ValueDate = '21/05/2007' select @ValueDate error: The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value. Please note, if '05/21/2007' is used then there is no error. How is it possible to get 'dd/...more >>

Management Studio forgets password ("change connection")
Posted by DC at 5/21/2007 1:35:11 AM
Hi, I often have to start the same adhoc query against a few servers. The "change connection" feature which connects my current query to a different server could become handy, since I can select the new server with a click, some mousewheeling and one more click. But: although I have instructe...more >>


DevelopmentNow Blog