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 > june 2005 > threads for friday june 10

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

returning date without time part
Posted by Kenny M. at 6/10/2005 6:27:01 PM
Hi I have a simple select like this Select MyDate, MyID From Sales The select is returning the date like this: 01/06/2005 12:00:00 a.m. 02/06/2005 12:00:00 a.m. I'm showing it on a Datagrid in my app, my question is can I modify the select to return only the date without the time...more >>


Returning Date without
Posted by Kenny M. at 6/10/2005 6:26:01 PM
Hi I have a simple select like this Select MyDate, MyID From Sales The select is returning the date like this: 01/06/2005 12:00:00 a.m. 02/06/2005 12:00:00 a.m. I'm showing it on a Datagrid in my app, my question is can I modify the select to return only the date without the time...more >>

How to identify unused databases
Posted by Kumar at 6/10/2005 4:47:01 PM
Hi Folks, client company has around 25 sql servers . Each server has got 5 to 10 databases. Some of the databases are old. We don't know whether any applications using old databases or not. Is there any way we can find the unused databases in past 3 months or past 1 year using some Last...more >>

Can't get fn_get_sql to work
Posted by pshroads NO[at]SPAM gmail.com at 6/10/2005 4:02:42 PM
I can't seem to get the fn_get_sql function to work. Here's the script I'm using: declare @spid int DECLARE @Handle binary(20) declare active_spids cursor for select spid, sql_handle from master..sysprocesses where status not in ('background', 'sleeping') --and spid <> @@spid open active_sp...more >>

Help with 1toMany update/case stmt?
Posted by xnews user at 6/10/2005 3:13:33 PM
Hi all, Looking for a way to do this in the minimum # of stmts I can. Basically, this is doing a table1(1) to table2(many) update join. When the t2 row has myindex = 0, then update column t1.c1. The problem is that for each row in t2, it's index only matches 1 column out of the 5 ...more >>

Duplicate order nums in Orders
Posted by Saga at 6/10/2005 2:58:59 PM
Hi all, We have a third party application that allows users to take customer orders. This application has all the bells and whistles of the Titanic. Since we wanted our customers to be able to place orders themselves, we built a smaller light weight application to allow them to do just that. ...more >>

Passing a table to a SP
Posted by Chris Lieb at 6/10/2005 2:11:03 PM
I am making an SP that uses a table as an array. I want the user to pass the table to the SP, where I will then iterate through it and pull out all of the IDs and place them into a string that I can use with the IN keyword. Once I get the table into the function, I will have no trouble. I ...more >>

Sysindexes
Posted by Alterego at 6/10/2005 1:31:39 PM
Hi all, I am trying to determine some index characteristics from the system tables. 1. I assume when a sysindexes.indid = 1 that index is the clustered index, true? 2. How do I dermine which index is the primary key? 3. How can I determine if an index is unique? Thanks in advance. ...more >>



Fast "bulk" inserts...
Posted by lmcphee at 6/10/2005 1:11:04 PM
I have an app that must insert batches of transaction records every 30 min. Typically only a few hundred each time. We found that just appending a hundred or so INSERT commands together in a single query sent to the server was significantly faster than our first approach of preparing a paraemt...more >>

Different port
Posted by Marcin S. at 6/10/2005 1:01:02 PM
Hi, I have a MSSQL server on port 1434, the default is 1433 anyone who know how the should connectionstring looklike to connect to the post 1434? -- ----------------------- Marcin S....more >>

BizRule implementation
Posted by J-T at 6/10/2005 12:49:42 PM
I have a table with follwoing feilds: 1)ClientID 2)EmailAddress 3)AddressDescription 4)Primary 5)BizRuleFlag there could be multiple address for each client ,but each client **MUST** have atleast one address with "Primary" flag set to "Y" (which mean that one is his Primary address) and ...more >>

Join and duplicate values
Posted by Fabri at 6/10/2005 12:22:25 PM
Executing a LEFT JOIN and preserving values from select "on the left" I have this problem: If I have left table with for example column A = 'PIPPO' and in right table PIPPO is not present, of course I have NULL value because of the LEFT JOIN. But what about if in the right table I have 2...more >>

READPAST - please help me
Posted by hngo01 at 6/10/2005 12:09:07 PM
Hi, There are some rows been locked by other users…. In one window (Query Analyzer) I run: BEGIN TRAN SELECT * FROM NorthWind..employees WITH (XLOCK) WHERE employeeid = 1 WAITFOR DELAY '00:01:00' COMMIT TRAN In other window (Query Analyzer) I run: SELECT * FROM NorthWind..employees...more >>

Changing table colon's properties
Posted by huseyin_akturk at 6/10/2005 12:06:53 PM
Hi, I have got approximately 100 tables. Their all attributes are same. But, I want to change their one attribute. Such as my table; NAME nvarchar(50) SNAME nvarchar(50) SALARY float I want to change SALARY's property from float to money. It is possible to th is operation manually. But I ...more >>

MSDE and clustered indexes.
Posted by Bob Castleman at 6/10/2005 11:58:23 AM
We have this weird problem with our customers using MSDE. They keep running up against the 2 gig size limit and their database stops functioning because it can't allocate any more space. But if you examine the database, 75% of the allocated space is unused. It can't be recovered by shrinking t...more >>

Reset Identity
Posted by Alessandro at 6/10/2005 11:55:02 AM
Hi, there is a way to reset identity field of many tables via storeprocedure ? i try with the scripts below, but they don't work ! BACKUP LOG test_dbWITH TRUNCATE_ONLY DBCC shrinkdatabase (test_db) and also with create table #table( idTabella int, nome varchar(4000) ) insert...more >>

Finacial function
Posted by Eric at 6/10/2005 11:38:51 AM
I'm looking for financial function in T/SQL. I need to implement the Rate-Function like in VBA. Thanks Eric ...more >>

I don't understand it
Posted by Enric at 6/10/2005 11:21:06 AM
Dear all, I'm executing a DTS which own a sql server task that launch a stored procedure. This stored procedure run a WHILE sentence and then launch a bcp command dinamically. Well, everything works debugging that stored procedure or simply launch it throught Query Analyzer with its pa...more >>

VAT decimal places
Posted by Ian Oldbury at 6/10/2005 11:19:24 AM
Hi All, What is the correct storage type for VAT 2 or 4 decimal places?? ...more >>

RDO resultset performance problem
Posted by Marko Erzen at 6/10/2005 10:19:29 AM
Hi to all, I have a big performance problem with looping threw rdoresultset. I made some very complex sql queries. They link like 5 tables and uses a couple subqueries. The number of returned rows is something like 1000. Query execution takes about 1 second, which is completly acceptable. Bu...more >>

updating a column based on values in another column in the same ta
Posted by sharman at 6/10/2005 10:08:51 AM
I am new to SQL. I want to update a field based on values in another field for the same row in the same table. For example, if I have a table like this: FieldA FieldB FieldC FieldD 1 AA Cat 2 BB Dog 3 CC Mouse I wan...more >>

Rand function
Posted by Hardy Wang at 6/10/2005 9:58:31 AM
Hi, I run query in Sql server 2000 below: select rand(datepart(ms, getdate())), datepart(ms, getdate()) Everytime I run it, I only get 0.7xxxxxxxx as random result. Is it thw way how it is desgined? If yes I will think the number is NOT so random. -- WWW: http://hardywang.1accesshost.com...more >>

Retrieve Stored Procedure Code
Posted by Chris F at 6/10/2005 9:43:09 AM
Hi, I am trying to retrieve the code for some stored procedures. I was able to select the routine definition from the information_schema.routines for the procedures that had less than 4000 characters, but I can't get the larger procedures. Does anyone know how to pull the entire stored pr...more >>

table information query
Posted by Random at 6/10/2005 9:21:04 AM
What's a way I can determine the last time any record in a table was updated? Is there a table property I can get this from or do I need to establish a field in the table that I can query from? I have some shared tables that I want to give users the option of storing queried results in the...more >>

Duplicating rows in tables...
Posted by Brad Pears at 6/10/2005 9:18:50 AM
I am working on an application where I want the user to be able to "Duplicate" a Contract item. To do this I have to duplicate the row in the master table and duplicate all related rows in the related "children" tables (of which there are twelve..) I was wondering if there was an SQL clause ...more >>

Enterprise Manager and its particularities
Posted by Enric at 6/10/2005 8:55:03 AM
Dear all, I'm fed up with this problem. I hate that behaviour. When I create objects from a query analyser session in my own workstation, then these objects doesn't visible from my MMC. A lot of times I am obligated to close and open again. I've got a MMC with 13 Sql Server and some of th...more >>

Warning: The query processor could not produce a query plan from the optimizer because the total length of all the columns in the GROUP BY or ORDER BY
Posted by Tom at 6/10/2005 8:52:12 AM
Here is my problem: I am trying to generate stored procedures that will handle filtering and ordering on all columns. I almost had it working but I ran into problems with the case statements; I would get conversion errors. The errors can be reproduced if all columns are combined into one cas...more >>

List Available Sql Servers
Posted by chinn at 6/10/2005 8:46:40 AM
Hello, I am trying to find the list of all available sqlservers...with something like this and making it a .vbs and running it from the command promt on my windows 2000 and write to text file. can anybody help me with that. Dim oListSvr Set oServer = CreateObject("SQLDmo.SqlServer") ...more >>

osql with proxy account errors
Posted by jmeyers at 6/10/2005 8:31:05 AM
I've got a proxy account set up that is working fine for DTS packages, etc. I've also got an environmental variable set up for osql setting the user to the proxy account. The problem I'm having is within a scheduled job, when I execute this statement: EXEC master..xp_cmdshell 'osql.exe -S...more >>

Killing xp_cmdshell
Posted by NeilDJones at 6/10/2005 8:28:05 AM
Hi. I have run xp_cmdshell from within a stored procedure, and it has hung. Is there any way to kill the process, other than rebooting SQL Server? Cheers Neil...more >>

Test the impact of an index
Posted by JohnnyMagz at 6/10/2005 8:06:01 AM
I would like to add an index to a table that my application writes to/reads from and change an existing stored proc. Before I do, I would like to take some measurements on the existing table structure and proc. Specifically, I'd like to know how many pages the proc needs to access to retrieve ...more >>

Dynamically creating variable names
Posted by Andy at 6/10/2005 7:51:06 AM
Ok, here it goes. I'll try and explain my situation as best as I can. I would like to dynamically create variable names. We store our data in monthly partitioned tables.........table_200501, table_200502.... I am creating a view that is a union of all of the partitioned tables. So in or...more >>

2ND POST: Is there a way to insert a record using another as a template?
Posted by SA Development at 6/10/2005 6:53:58 AM
Hi, I am currently inserting a record using: insert into TABLE(FIELD1,FIELD2) values ('%s',%d) But, the problem I have is that the table I am connecting to can either have 46 fields or 47 fields depending on its version. Is there a command that would allow me to use an existing record as...more >>

SQL Server Mail box - xp_readmail
Posted by Sevugan at 6/10/2005 4:20:01 AM
Hi, I executed xp_readmail stored procedure. It brought some records as result. I do not know from where it brought those records. Those were not available in my inbox. It is supposed to retrieve the first unread message in my inbox. Isn't it? Where do I find the SQL Server Mail box? ...more >>

Changing table properties
Posted by huseyin_akturk at 6/10/2005 4:19:43 AM
Hi, I have got approximately 100 tables. Their all attributes are same. But, I want to change their one attribute. Such as my table; NAME nvarchar(50) SNAME nvarchar(50) SALARY float I want to change SALARY's property from float to money. It is possible to this operation manually. But I ...more >>

sp_OAMethod methods
Posted by NeilDJones at 6/10/2005 4:06:03 AM
Hi. I am looking for a list of all methods available to sp_OAMethod. Is there such a thing? Cheers, Neil...more >>

Importing text file
Posted by Reggie at 6/10/2005 3:06:29 AM
HI and TIA. I posted this to a vs.net NG but after looking thought it might fit in here better. Using VS.Net 2003 I built an ASP.Net Web application using VB.Net. I connect to an SQL db(SQL Server 2000) and am setup to write/read/edit data no problem. I'm having a problems with the followi...more >>

Problem with varchar(max) in SQL Server 2005
Posted by Dinesh Priyankara at 6/10/2005 2:44:05 AM
Hi All, I am having a small problem with varchar(max) type variable. Please look at the code below. DECLARE @varcharmax varchar(max), @varchar varchar(8000) SET @varcharmax = REPLICATE(‘D’, 10000) – this will end up with 10000 lengthy string SET @varchar = REPLICATE(‘D’, 10...more >>

Moving data and log files
Posted by len at 6/10/2005 2:18:03 AM
Hi there. Is there an easy/correct way to move a database's data and log files(.mdf, ..ldf) to a new location? I know there must be a simple way (system stored procs or something) - I've just been stumbling around manually copying, creating new databases, restoring, renaming etc.... Not...more >>

T-SQL and primary key
Posted by Marius at 6/10/2005 2:07:02 AM
Hi, I need to create a primary key on my already existing tables. But there are some (just a few) rows in my desired primary key columnt that contain duplicate values. Do someone know how to find duplicate values and what values, so that I can delete just those rows with duplicate values? P...more >>

Error 8152
Posted by Samuel Bernard at 6/10/2005 1:58:02 AM
Hi, I have the following problem. I create a small request to truncate a column (see below). When I run it, I get an error 8152. I don't understand why. I have no null value into the table. I would appreciate any help tia Samuel ALTER TABLE [dbo].[ArticleNumber] ALTER COLUMN [Number] ...more >>

Inner Joins
Posted by Richard Garner at 6/10/2005 1:55:03 AM
I have a table that gives a hierarchical representation of a master table. It has two integer keys ID1 and ID2 providing the hierarchy, where ID2 is the child of ID1. What I am trying to do is to create a query that will get all the nested joins. Eg. ID1=1 and ID2=2, ID1=2 and ID2=3, ID1=3 and...more >>

Adjusting Employee Hours
Posted by ngorbunov NO[at]SPAM onetouchdirect-dot-com.no-spam.invalid at 6/10/2005 1:00:21 AM
I wrote a post earlier, but my manager has asked that I do i differently. I have a table with employee hours for particula projects. (I work for a telemarketing company Table1 Project Task Emp Hours A1 TPV 1 5 A1 TPV 2 A3 AUDIT 3 TOTAL: 1 A2 ITM 4 10 A2 ITM 5 1 TOTAL: 25 I nee...more >>

How to Transfer data from Excel to SQL SERVER 2000
Posted by Ahmad Jalil Qarshi at 6/10/2005 12:00:00 AM
hi! i want to transfer data from MS Excel Sheets to SQL Server. is there any way. Thanks Ahmad Jalil Qarshi ...more >>

Q: NB on the Insertion command.
Posted by Visual Systems AB (Martin Arvidsson) at 6/10/2005 12:00:00 AM
Hi! I'm not a good friend with the insert command. What I am trying is the folowing... The insert statement: INSERT INTO MyTable(field1, field2, field3) VALUES(?, ?, ?, ?) Data to be inserted. '1', 'Customer data', 'Hi, this is a sample text to be inserted' When executing, for s...more >>

Uniqueidentifier or int32
Posted by Arjen at 6/10/2005 12:00:00 AM
Hello, I always use int32 as keytype. Now I see (asp.net 2.0) that there also is an uniqueidentifier type. Can somebody tell me a little bit more about this? For example: I have a website with news. When you select the title you can read the complete newsitem, this is done by the news-ite...more >>

string filteration
Posted by Kriste L at 6/10/2005 12:00:00 AM
Hi Everybody, I need to filter out string value that containing "_." or "._" Based on the following test sample, it should return only row 1 and row 2 but somehow the like clause is not working. select * from ( select 1 as row, 'sfsdf_.sdfsdf' as t union select 2 as row, 'sfsdf._sd...more >>

simple query
Posted by lara at 6/10/2005 12:00:00 AM
hi, this is a simple Qn My Employee_Salary table contains EmpID, DeptID, and Sal I want to find the top 2 Employees from each dept, who are taking the highest sals in each dept regards Lara ...more >>

sql
Posted by ichor at 6/10/2005 12:00:00 AM
what is a workload file and how do i create one? ...more >>

Changing table properties
Posted by huseyin_akturk at 6/10/2005 12:00:00 AM
Hi, I have got approximately 100 tables. Their all attributes are same. But, I want to change their one attribute. Such as my table; NAME nvarchar(50) SNAME nvarchar(50) SALARY float I want to change SALARY's property from float to money. It is possible to this operation manually. But I ...more >>

Query Help
Posted by Ellis Yu at 6/10/2005 12:00:00 AM
Dear All, I have a single table name "Remark". It contains the item code, date, status and remark. If I want to build a query that select items out which the latest status is still in "pending" for example. How do I make it? Thanks Best Rdgs Ellis ...more >>


DevelopmentNow Blog