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
August 2008
all groups > sql server programming > may 2007 > threads for tuesday may 15

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

File Access Denied
Posted by dinu at 5/15/2007 11:20:23 PM
I open DBF File Through OPENROWSET it works fine but my problem is when I delete that file (c:\mydata.dbf) mannually i.e. Through Keyboard Del button it displays File Access Denied Error. How i solve this problem. Can anybody tell how to solve this problem ...more >>


How do you inner join two tables were one is based on the others top 1 id?
Posted by Rissoman NO[at]SPAM gmail.com at 5/15/2007 9:05:24 PM
Hello, Let say I have two tables. Tbl1 (ID1 int PK, tbl1Name nvarchar(50), etc , etc, etc a lot more fields here.) Tbl2 (ID2 int PK, GenericID, GenericTypeID int, tbl2Name nvarchar(50), CreateDate datetime(8)) I want to inner join Tbl1.ID1 with Tbl2.GenericID I want to get all d...more >>

some questions abount sql server
Posted by Roy Goldhammer at 5/15/2007 7:16:08 PM
Here are some questions i would like to know about sql server: 1. When i simple do select * from table, no index exept clustered index is being used 2. If i add where condition like: where UserID = 'UserID' i sould add index to UserId field if it is not primary key clustered. 3. If i use wher...more >>

Big problem with case sensitivity
Posted by mme000 (add NO[at]SPAM yahoo.it to my nickname) at 5/15/2007 6:35:18 PM
I've "inherited" from an ex-colleague a project based on MS SQL Server which contains a huge number of stored procedures. Unfortunately, when he wrote the stored, he didn't pay much attention to respect the case sensitivity. Now, I've to install the project on a server using a case sesitive co...more >>

How to create a job to poll my table
Posted by Elmo Watson at 5/15/2007 5:29:42 PM
I need to create a job that will poll a certain date in my table, based on the current date - if it's over 2 days (48 hours) since it was entered, it needs to send an email to each of the supervisors - - I have the query done, that will provide a result set with the dynamic data, including the...more >>

SQL Server 2k Query How to display seconds in time format
Posted by nwarnock NO[at]SPAM capgemini.com at 5/15/2007 4:34:01 PM
Hi, I'm working on a query in SQL Server 2k. I have values that are the seconds, i.e. 421, that would make more sense formatted as time "7:01". I guess it's late in the day and I'm getting foggy. That can't be terribly tricky, can it? I usually am working with dates that I need in differen...more >>

Table valued paging function
Posted by MattC at 5/15/2007 4:15:31 PM
Hi, Is it possible to write a function that accepts a resultset from a query as well as a page size and page number variables and return the page in question. Essentially I want to provide paging on all my large table selects but don't want to have to write my SQL to do this over and ove...more >>

one-many select clause
Posted by Brad Pears at 5/15/2007 3:46:37 PM
I am using SQL Server 2000. I have two tables. A master table (Vendor) and an Address table (Address) that can contain multiple address records for a particular vendor. (1-M) I want to "join" the two tables so that the resulting query shows the multiple records... For instance, I want to...more >>



Handling Errors of SQL Server in C++
Posted by Yvonne at 5/15/2007 1:00:23 PM
Hy all, I'm accessing the SQL Server from C++ through ADO and OLE DB. Now we wan't to handle some specific errors returned when we execute an SQL statement. The description text returned with the error (with seems to be from sysmessages) is not very useful for our customers. So we want to ...more >>

Best Identifier for a LOT of data
Posted by drharris NO[at]SPAM shonka.com at 5/15/2007 12:57:42 PM
Hello all, I have a bit of a design issue I'd appreciate any pointers with. Basically, we have a situation where we deploy anywhere from 1 to 10 machines to a project collecting data, and a single machine can collect anywhere upwards of a hundred million records per project. Our original idea...more >>

Which Database is sql script run in?
Posted by cj at 5/15/2007 11:13:13 AM
SQL Server 2005 Express installed on a stand-alone Windows XP pc. Under Databases it has System Databases and I've created 2 more (A and B). I now want to run a sql script that creates a dozen or so tables. When I run the script it's creating the tables in System Databases/tables instead o...more >>

Update Query
Posted by RickSean at 5/15/2007 10:53:04 AM
CREATE TABLE [dbo].[Category]( [CatID] [nvarchar](16) NOT NULL, [CatDesc1] [nvarchar](16) NULL, [CatDesc2] [nvarchar](16) NULL CONSTRAINT [Category$PrimaryKey] PRIMARY KEY CLUSTERED ( [CatID] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMAR...more >>

VSS for SQL2000 / 2005
Posted by Ed at 5/15/2007 10:10:01 AM
Hi, Is there anyway to put all the stored procedures in Visual Source Safe for SQL 2000? As far as I know, the only way is to save it in a txt file for 2000. How about 2005? anyway to put them all in VSS? Thanks Ed...more >>

Rolllup option on OleDbDataAdapter
Posted by tshad at 5/15/2007 10:03:05 AM
I don't know if Sql Server would give me the same error, but I am running a statement that I assume should work but doesn't in my vb.net program and am trying to figure out if the syntax is incorrect. The following statement works fine if I don't have the "with Rollup" option. da2 = New Ol...more >>

Replace value in a field based on a set criteria?
Posted by tw55447 at 5/15/2007 9:53:02 AM
I'm trying to replace a value for a record IF it meets a criteria that I set...sort of like a find/replace. Find an entry based on a criteria and then replace the value in another column with a text string. Example: OwnerName Confidential Smith, John 0 Smith...more >>

Replace value in a field based on a set criteria?
Posted by tw55447 at 5/15/2007 9:51:03 AM
I'm trying to replace a value for a record IF it meets a criteria that I set...sort of like a find/replace. Find an entry based on a criteria and then replace the value in another column with a text string. Example: OwnerName Confidential Smith, John 0 Smith...more >>

Log shipping error
Posted by Farhan Iqbal at 5/15/2007 9:10:01 AM
I have implemented log shipping which is perfectly running, I got some structural changes and perform them into primary server, after adding the column in one table. My Log shipping stopped and gives the error at the time of restoring. Please tell me what I should to do, to resolve this iss...more >>

Query Syntax (SQL2000)
Posted by Andrew at 5/15/2007 8:25:32 AM
Requesting help from the T-SQL Gurus in here as I am struggling to build the queries for a couple reports..... I have a two different versions of the same scenario, and for the life of me I can never remember how to do this (without using a Cursor). The scenario is that I have a bunch of r...more >>

FTP Connection Manager
Posted by Tim at 5/15/2007 8:19:00 AM
I have gone through and defined an FTP Connection Manager. When I click on 'Test Connection' it comes back successful. However, when I create an FTP Task using this connection manager I keep receiving the message that the Connection Manager "" cannot be found. I am building a package that...more >>

Select sum
Posted by ITDUDE27 at 5/15/2007 8:03:01 AM
what i'm I doing wrong. Any reason this statement returns 0 instead of 6? select SUM(50/100)*(0.06*200)...more >>

Add Column - table has 29+million rows...
Posted by ThomBeaux at 5/15/2007 7:38:06 AM
This has caused the Transaction Log to grow to over 30 GBs, and we run out of disk space. Even with Database in Simple Mode same thing happens. ALTER TABLE dbo.Table1 ADD Field45 varchar(15) NOT NULL DEFAULT '' WITH VALUES Need some advise on what to do? -- Thanks and God Bless,...more >>

Tranlog space usage
Posted by Jr. DBA at 5/15/2007 7:03:01 AM
I'm trying to calculate the amount of space used in the tranlog as well as get the actual size of the tranlog. I know I can used DBCC SQLPERF(LOGSPACE) to get the log size in MB and the % of log space used. The only problem with only using this command is the Log Size in MB is not the actua...more >>

System.Data.SqlClient.SqlException: This statement has attempted to access data whose access is restricted by the assembly.
Posted by Ela at 5/15/2007 6:46:08 AM
Hello, maybe somebody can help about this error message. We are trying to use a CLR function named "GetBODescriptor" in order to select records from distinct views, for a parameter. Problem is that, for less than half of existing views, this error occurs: Msg 6522, Level 16, State 1, Line 1 ...more >>

Time datatype on SQL2005
Posted by Geir at 5/15/2007 5:20:01 AM
Hi all. Is there at time datatype I can use to define a field in a table. I am just interested in saving the Time value of the datetime. Eg. I want to save the shippment time of a freigh metod.... -- Thanks all Regards Geir...more >>

QUERY HELP!
Posted by Jami at 5/15/2007 4:18:50 AM
Dear All! i m using following query to get the result but its giving me error "Incorrect syntax near 'cast', expected 'AS'" SELECT territory, DATEDIFF(day, max(cast(substring( b.batch, 9, 10 )) as Datetime),getdate()-1) AS T_days FROM tbl_reports group by territory How can i us...more >>

len() returning weird result
Posted by Michael Carr at 5/15/2007 3:40:27 AM
If you run this in Sql Server 2005: print len(0x00) print len(0x10) print len(0x20) print len(0x21) print len(0x30) You get this output: 1 1 0 1 1 Can anybody explain that to me? Thanks, Michael Carr ...more >>

Column Headings
Posted by Ibrahim.zuberi NO[at]SPAM gmail.com at 5/15/2007 1:33:02 AM
I need to write an SQL statement from which I can get column headings from a table in Ms SQL SERVER 2005. For Example 1: Select * from Table Results: Serial, Customer_Name, Address1, Address2, Address3, Address4 Example 2: Now if we need column headings? Select [Column Headings] As Head...more >>

Primary Key being incremented by 1
Posted by Mary Braidigan at 5/15/2007 12:00:00 AM
Hi, I want to write a stored procedure that will read all values in a table(TermCodes) and insert them into another table(DischargeReasons). The second table has a primary key that I need to manually increment by 1 so I need to find the max and add one in the stored procedure. The code belo...more >>

select query
Posted by magix at 5/15/2007 12:00:00 AM
let say if I have following table itemA itemB target date 2 3 4 5/20/2007 2 3 5 5/22/2007 3 2 2 4/20/2007 3 4 5 4/10/2007 1 2 ...more >>

using SS2K as a files repository
Posted by PJ6 at 5/15/2007 12:00:00 AM
I'm going to have to store and index maybe 10,000 files or more at 300KB-2MB each, probably with an everage around 400KB. Mild read and write requirements. Rather than use the file system I'm tempted to use a dedicated database and keep everything in BLOBs. I've worked with BLOB data before, ...more >>

Getting results for 2nd row of the group.
Posted by Sugandh Jain at 5/15/2007 12:00:00 AM
Col1 Col2 Col3=20 17 84 1000=20 15 84 1853=20 13 84 5000=20 11 84 50=20 9 84 67876=20 7 84 556=20 5 84 2000000=20 18 85 2000=20 16 85 26=20 14 85 200000=20 12 85 200000=20 10 85 567=20 8 85 6666=20 ...more >>

Help on trigger
Posted by TumurS at 5/15/2007 12:00:00 AM
Below are three triggers I wrote to keep balance of the "onsale" field of the "product" table. They work well if only single record is inserted/updated/deleted. But if multiple records deleted (I've not tested for insertion and updating) and the "deleted" table have 2 (or more) records with s...more >>


DevelopmentNow Blog