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 thursday may 3

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

Performance issue running a batch
Posted by Sakthi at 5/3/2007 10:47:01 PM
I have a table "Alert" which has millions of records, i need loop thru all the records using cursor and update the records. While running the batch, the table is locked. -- Sakthivel SQL Server Developer INDIA...more >>

Can I write a batch job for MS SQL in MS SQL 2005 express?
Posted by Fendi Baba at 5/3/2007 10:38:25 PM
I am new to MS SQL. Can I write a batch job which will execute the sql statement nightly? How do I do this? ...more >>

Query Help
Posted by robertkgaudet NO[at]SPAM gmail.com at 5/3/2007 9:36:23 PM
I need help building a query. I am building a gridview control that should display a row for each day of a selected month. On each row on the gridview, content entered by a user would appear for that day. I have two tables, Dates and CandidateSchedule. Dates has all dates for the next two y...more >>

forcefully close all open connection
Posted by Usman Jamil at 5/3/2007 9:14:39 PM
Hi Is there any Sql command, system procedure or function which could forcefully close all the connection open on a database. I need to restore/delete a database using sqldmo. Many of the times the method fails due to the connections that are open on that database. Regards Usman ...more >>

Two periods inner join
Posted by Mark Goldin at 5/3/2007 5:44:46 PM
What is a right way of dealing with periods of datetime to find out if they have inner join? Thanks ...more >>

Compare a date
Posted by Rick at 5/3/2007 3:39:02 PM
What I am trying to do is select the max date from a column and compare the day of that date to the day of getdate. Any suggestions? So if it is May 03 I want to make sure that the 03 is the same in my max date. I hope that makes sense....more >>

Getting 10 Records the Fastest Way Possible // ROWLOCK, UPDLOCK, READPAST
Posted by sloan at 5/3/2007 3:06:42 PM
I got interested in a post I saw a few days ago. http://groups.google.com/group/microsoft.public.sqlserver.programming/browse_frm/thread/f58090fb59ef879f/a242e4eeb2ae00fd?lnk=gst&q=UPDLOCK&rnum=2#a242e4eeb2ae00fd Before I go any further, let me mentions that this is 2005. I'm trying to ...more >>

Process Data Without a cursor
Posted by Andy in S. Jersey at 5/3/2007 3:05:00 PM
The table I want to process has the data below (I have added 2 blank rows for illustration): AG00780 2000-01-04 G 194 194 177 177 178 178 220 224 171 175 AG00780 2000-09-07 H 194 194 177 177 178 178 220 224 171 175 AG00780 2004-10-23 H 194 194 177 177 178 178 220 224 171 175 AG01518...more >>



Need help with a query
Posted by ajmiester at 5/3/2007 2:53:58 PM
Hi I need help with an query result. There are two tables in my database create table project_dates ( company_name char(40), proj_code char(5), proj_lead char (6), h_count char(1), cost ...more >>

Auto Growth
Posted by CLM at 5/3/2007 2:15:01 PM
What is the perf mon counter that displays/logs auto growth of the mdf file? The counter for the ldf is obvious under Sql Server Databases:Log File Growth or something similar. But the one for the mdf seems much less obvious or maybe my eagle just keeps missing it......more >>

continue with Mr Karazi
Posted by Awi Ktir at 5/3/2007 1:10:49 PM
Hi Tibor. looks like this one didn't reach the group yesterday. Done all that .. it does seem to be a lock on tempdb..sysindexes.. plus some of the indexes (PK) on @tables. do we have control over this ? thanks "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.com> wrote in...more >>

Updating all rows in a large database table
Posted by AndyW at 5/3/2007 1:01:00 PM
I need to get many, if not all rows in a database table, update selected fields and save the resuits back to the database. The following works OK for small databases, but does not scale up to large databases void UpdateDatabase() { string sCmd = "SELECT Field1, Field2 FROM Table"; SqlConn...more >>

Stored Procedures---Stacking IFs
Posted by wnfisba at 5/3/2007 12:40:01 PM
What is the proper syntax for stacking these IFs in a Stored Procedure??? Thanks in advance... wnfisba IF @Loan_Nbr IS NOT NULL IF @MTM_Losses_Accrued IS NOT NULL IF EXISTS ( SELECT 1 FROM [DMD_Data]..[UDF_WARRANTY] WARRANTY...more >>

URGENT
Posted by Antony at 5/3/2007 10:36:01 AM
Hi I had a SQL Server 2000 database by name Jap.Recently my c drive crashed and i have only jap_data and jap_log files stored in D drive.Can i restore back these files so that i will be able to use them?I had few critical office data and would appreciate a quick help in this regard My Best A...more >>

Timeouts
Posted by CLM at 5/3/2007 10:29:05 AM
This is driving me crazy. I've got a 2000 SP4 server with intermittant timeouts. For example, this morning at 8:24 am, about five processes timed out. I checked Perf Mon and everything looks great: disk i/o was low, processor was reasonable, buffer cache was 100, paging was minimal, page l...more >>

transactions across multiple stored procedures
Posted by R C at 5/3/2007 10:26:01 AM
Hi, I have a stored proc that calls multiple stored procedures. i need the entire process to be under a transaction so let's say that stored procedure #4 fails, the entire transaction in SP1, SP2, SP3 needs to be rolled back. Any ideas? RC ...more >>

OPENROWSET MsAccess database
Posted by Darryl at 5/3/2007 9:49:01 AM
I have searched high and low and cannot find a working example of using OPENROWSET to connect to an access datasoure WHILE using a system database. I have seen lots of examples where the system database property is ommited, but I need to connect to a database specifying the system database so...more >>

ProperCase
Posted by Andre at 5/3/2007 9:35:55 AM
I have a ProperCase function that works well. However, I'm constantly adding "exceptions" into the funciton. For example, I want IPA uppercase, but not when it's in constIPAtion. This got me to thinking that it might be easier to add all my cases into a table, rather than constantly editing...more >>

when not to use a transaction
Posted by Johnny at 5/3/2007 9:14:33 AM
Are there any rules for when not to use a transaction? I have one process writing to a database and another process reading from that database. The writes aren't like the classic case of a bank transfer .... I wouldn't be looking to rollback a group of transactions. In this circumstance is...more >>

inserting data into two tables with the same GUID
Posted by Fendi Baba at 5/3/2007 8:26:56 AM
I wrote the following query to update two tables ++++++++++++++++++++++++++++++++++++++++++++++++ DECLARE @myid nchar(128) Declare @userid uniqueidentifier Set @userID=newid() Set @myid='83e79498-fbd0-43ae-9d07-f6a7383b09a7' INSERT INTO dbo.aspnet_users (ApplicationID, UserID, Username, L...more >>

What is wrong on XML Raw Mode XQuery examples from BOL?
Posted by Washington Moreira at 5/3/2007 6:40:00 AM
Hi Friends, I need to know what is wrong on this example below from BOL SQL 2005, ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/02c1bc0b-760c-4589-9ab1-6927c6d9c734.htm. Topic "G. Querying xml type columns": USE AdventureWorks; GO SELECT ProductModelID, Name, Instructions.query(' d...more >>

UDF syntax error on DATEADD
Posted by bringmewater NO[at]SPAM gmail.com at 5/3/2007 6:29:50 AM
Can you kind folks tell me what I"m doing wrong to get this error when trying to use DATEADD ? CREATE function dbo.TimeBuffer ( @obs varchar(255), @myName varchar(255), @obsDateTime datetime, @dateTimeInterval int ) returns table as return ( select o.* from Ti...more >>

Returning only columns with nonnull values
Posted by mjmckendry NO[at]SPAM dol.ie at 5/3/2007 6:13:36 AM
Hi all, I am writing a stored procedure into which I will supply a parameter. This sp will then perform a query on a table and will always return exactly one record. One or more of the columns in this record have a value and the rest will be nulls e.g. Col1 Col2 Col3 Col4 Col5 1 ...more >>

BCP Export if Image File
Posted by Kurt C. Hack at 5/3/2007 5:33:52 AM
I am attempting to export a binary file from my SQL Server 2005 database to a .jpg file. Below are the import and export routines I am using. All is well, except that there appears to be four bytes added to the exported file causing the OS to not recognize the file format. Looking at the file...more >>

help with an error when accessing the DB
Posted by Mangler at 5/3/2007 5:32:11 AM
I am getting the following error: Microsoft OLE DB Provider for SQL Server (0x80040E21) The requested properties cannot be supported. >From a new DB that was created. This doenst happen with an existing DB.... does anyone have any advise that will help me out? ...more >>

Sum question
Posted by rich at 5/3/2007 4:08:46 AM
Hi I'm new to SQL and am having trouble figuring this one out. Any help would be very much appreciated. I have 2 tables 'A_Totals' & 'B_Totals' each table is identical in construction, each column is labeled Date,Total1,Total2,Total3 up to Total 18. I have written some sctipts that popul...more >>

Temporary Index
Posted by Bpk. Adi Wira Kusuma at 5/3/2007 4:01:47 AM
What is the meaning of Temporary Index? When must I make it? How to make it? Will it be created automatically when i use "Order By" clause? I use sql server 2000 ...more >>

Creating a backup script
Posted by Rico at 5/3/2007 3:42:39 AM
Hello, I'm having trouble creating a backup script to save all the databases in the database server. I have the following script but can't figure out how to get this to execute. As you can tell, I'm not a skilled T-SQL guy, nor a DBA. I'd like to create a single file for each db with n...more >>

Urgent - exporting SQL server 2005 tables to dbf/text/csv/etc file
Posted by Pogas at 5/3/2007 2:11:00 AM
Hi, I constantly export client SQL server tables to files of different formats as above. Is there a way of dynamically doing this? given a file path, table name and format type as parameters? perhaps via a stored procedure or SSIS ? Could XML be useful? Any pointers will be most appreci...more >>

Performance Issue
Posted by sathis_nathappan at 5/3/2007 1:19:02 AM
Hi, I need to update a Table which will be having around two million data, like if Name is null then store "Name" & if Address is null then store "Address" like 15 columns. Which way would be better among these? 1 ) Open a cursor with all the data in the table, then select one row at a ...more >>

Storing secret key at SQL server 2000
Posted by Shocky at 5/3/2007 12:46:10 AM
Hi, This is with respect to symmetric cryptography. We want to encrypt a column data using symmetric cryptographic algorithms at SQL server 2000 side and this encrypted data would be accessed by other application (AS 400) which should get the data in decrypted form. So the need is that both...more >>

Shortcut on enterprise manager to execute Query Analyzer?
Posted by omeirred NO[at]SPAM gmail.com at 5/3/2007 12:30:03 AM
Anyone know if there is any shortcut (shortkey) to do so instead of going to Tools-->QueryAnalyzer? ...more >>

casting to varbinary clarification
Posted by M A Srinivas at 5/3/2007 12:29:15 AM
I am sorting varchar data on binary (ascii sort) . declare @a table (filenames varchar(50)) insert into @a values ('000abcd.asp') insert into @a values ('000ABCD.ASP') insert into @a values ('0001Pqrs.asp') insert into @a values ('000xyz.ASP') select * from @a order by cast(upper(f...more >>

udf i need very little help
Posted by .nLL at 5/3/2007 12:10:05 AM
hi veryone. i want to create function in sql server to do exactly same thing as following vb function does SplitIp = Split(input,".") SmallIp=SplitIp(0)&"."&SplitIp(1)&"."&SplitIp(2) basicly i want to get just first 3 parts of ip address and i am noob can some one help me? thanks ...more >>

Modify view troubles
Posted by Lasse Edsvik at 5/3/2007 12:00:00 AM
Hello I'm having problems with modifying a view, I have SUM(OD.Quantity * OD.UnitPrice) OVER (PARTITION BY OD.OrderId) as one resultcolumn, and I get his error when I try to modify the view. "The OVER SQL construct or statement is not supported.", so I try to modify it anyways and I get same ...more >>

Error at creating SP
Posted by Tony WONG at 5/3/2007 12:00:00 AM
there is an error ( [ line 11, near '(' ] - full join line ) when check syntax. i do not know what is the error, even i can run it at QA after replacing some variables, such as @Date1, @Date2 Thanks a lot. ************************* CREATE PROCEDURE dbo.MonthlyBreakdown @Date0 varch...more >>


DevelopmentNow Blog