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 > april 2005 > threads for monday april 4

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

Getting parameter's user-defined datatype?
Posted by Martin H. at 4/4/2005 11:53:03 PM
Hey, Is there any way to get routine's parameter's user-defined datatype from system tables/views? I see there is a corresponding field in INFORMATION_SCHEMA.PARAMETERS view, but it is said to be for future use... Thank You in advance, Martin...more >>


Security inside stored procedure
Posted by Henri at 4/4/2005 11:15:55 PM
Hi, My DB is called "mydb". I've declared a login/user called "mydb_user" who can only run mydb's stored procedures. I've written a stored procedure called "mysp". Inside mysp, I execute master's stored procedures: sp_OACreate, sp_OAMethod and sp_OADestroy. As mydb_user doesn't have right...more >>

Audit Table
Posted by AM at 4/4/2005 10:48:10 PM
Hi all gurus I want to create a store procedure which will generate an audit table and track all the changes done in any of my tables in any database of my server. Please guide me where to start Any guidance will be highly appreciated Thanks ...more >>

Temp table and SPROC Debugging
Posted by Dave Slinn at 4/4/2005 9:13:39 PM
I'd like to get a few suggestions from everyone who does step-into debugging: How, or what, is the best way to view the contents of any temp tables during debugging? Currently, the best method I've found is to change all temp tables to global temp tables (using the ## syntax), which I can then...more >>

Dynamic SQL stops responding with no error message
Posted by Jorge Luis Ribeiro at 4/4/2005 8:49:02 PM
On SQL Server 2000, I have a SP (sp_CloseBusinessAcount) that calls another SP (sp_BuildPayments) which has among several lines of code one specific line that cancel the process with no error message. The line is a dynamic SQL that follows below: execute ('update [PRM].[dbo].[' + @TableName...more >>

Weblogic 8.0 and IIS 5.0 plug in issue
Posted by bob at 4/4/2005 8:36:19 PM
hi, I have a computer with Windows 2000 server and IIS 5.0 installed. I am trying to open a connection with a Weblogic Server 8 SP3 on another machine. My iisproxy.dll and iisproxy.ini are on the folder: C:\WINNT\system32\inetsrv iisproxy.ini : WlForwardPath=/IhmActivation Debug=ALL ...more >>

what kind of join for intra-table update?
Posted by Hazz at 4/4/2005 7:29:39 PM
I would like to update rows in a table with other rows from the same table. One columnID and 2 other columns are needed (in a where clause) to guarantee that the row being updated and the row whose values will replace the target row column values are a match. Is this just an inner join? Tha...more >>

Two databases on one linked server?
Posted by Dave at 4/4/2005 7:09:02 PM
Hi, I have two databases (A & B) on a single SQL Server (PROD1) that I want connect to using a linked server from my application's database's separate server (C). From Sql Server (C) I created a link server to the other server where PROD1 is the server name: EXEC sp_addlinkedserver ...more >>



Msg 7391 / JoinTransaction returned 0x8004d00a
Posted by Mike at 4/4/2005 7:07:02 PM
I'm having trouble doing distributed transactions in a stored procedure. It boils down to this example. This works in Query Analyzer: --begin distributed transaction insert into [39.80.0.26\x3].[sm].dbo.events select * from events where time = @time and seq = @seq --commit But i...more >>

dotted string in sp calls
Posted by Vince
Hi there! why do I get an error when I call a sp wich contains a dotted argument ? ex: exec netreport.ps_load_data 'arg1','arg2.arg2' Error ------------------------------------------^ I got this error : Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near '.'. ...more >>

VB code to restore database
Posted by SQLWonder at 4/4/2005 5:17:04 PM
Trying to write vb to list all database file on the listbox and store the selecteditems on array. Anyone has example of how to store selecteditems in array? ...more >>

sp_tables question
Posted by Günter Brandstätter at 4/4/2005 4:26:11 PM
Hi all, I am relatively new to SQL-Server programming and wanted to know how to execute the sp_tables procedure to find the tables in another database. I tried to use the @table_qualifier argument, but when I execute the procedure, I get a message that this has to be the current database. A...more >>

table in argument in sp
Posted by Vince
Hi there! I need to create tables in a stored procedure where the name of this table is supplied in argument from outside of the stored procedure.. I mean : create table @mytable etc....in my sp So I wanted to declare my argument like this create proc myproc ( @mytable table(id int pr...more >>

DTS Truncating field from 8000 to 255
Posted by Rafael Chemtob at 4/4/2005 3:47:28 PM
hi, I am using DTS to export to a text file and i have a field that is a VARCHAR(8000) field. It is being truncated to 255. When I look at the destination tab in DTS, it says that the size is 8000. Any ideas? please advise. rafael ...more >>

What's the maximum value of an Identity column?
Posted by Joe at 4/4/2005 3:38:18 PM
I don't want to have to start over again at 3 billion or so when I hit it. ...more >>

SQL port Change
Posted by Patrick at 4/4/2005 3:35:05 PM
Hi Friends, SQL 2000 If I change the port on SQL server , does it need a restart? Thanks, Pat ...more >>

Can I do this in one SQL statement
Posted by Joshua Campbell at 4/4/2005 3:22:54 PM
Let's say that I have a database that has customer name, invoice date, and amount in it. If an entry exists in this database, then the company owes us money. I am trying to put together a report that, for each company, details how much is owed that is 30 days out from a given date, how much is ...more >>

QUERY QUESTION-2
Posted by RayAll at 4/4/2005 2:53:57 PM
I have a table like this FileID Line# Status1 status2 === ==== ===== ====== 1 0 10 1 1 1 10 1 1 2 10 ...more >>

how to show all the permission for a role
Posted by SQL Apprentice at 4/4/2005 2:44:05 PM
Hello, I have an application database that has a role with specific permission to each objects like table, proc, views. There are about 200+ objects with different permission. some are select, insert, ddr. How can I write a SQL statement to show a report of this role with all the differe...more >>

Where to find ISO 639 Language list but with language name in native language?
Posted by Michael MacGregor at 4/4/2005 2:40:11 PM
I am trying to find the ISO 639-1 (two character code) Language list, prefereably with both the English and native names for each language. So far I have had no luck whatsoever. Does anybody know where I might obtain this list? TIA Michael MacGregor Database Architect ...more >>

Changing data type
Posted by Walter at 4/4/2005 2:32:44 PM
What's the best way to change numeric column to Identity column? Table: Orders Field: OrderID (numeric) must be change to Identity Records: 120,000 Thanks, Walter ...more >>

Column to store last time record was changed
Posted by Michael C at 4/4/2005 2:32:20 PM
In a table I have a column called ModifyDateTime which stores the last time that record was modified. When a record is inserted this column is updated through a default and when a record is updated a trigger is used. This is all working fairly well except I would like the ModifyDateTime column...more >>

Divide by zero
Posted by William at 4/4/2005 2:04:37 PM
In the following query I sometimes have DIVIDE BY ZERO issues. How can I put the CASE (SOME VARIABLE) WHEN 0 THEN 0 ELSE statement into the query so that I don't get the error. SUM(MedExp) is sometimes = 0 SUM(TotalMonths) is sometimes = 0 SUM(TotalMem) is sometimes = 0 I'm not sure how t...more >>

Case/Where Exists
Posted by Solel Software at 4/4/2005 1:39:02 PM
Hi, I have a scenario: CREATE TABLE [dbo].[Test1] ( [PersonID] [int] IDENTITY (1, 1) NOT NULL , [Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] CREATE TABLE [dbo].[Test2] ( [SpeechID] [int] IDENTITY (1, 1) NOT NULL , [PersonID] [int] NOT NULL ,...more >>

convert datetime to age
Posted by chad at 4/4/2005 1:37:04 PM
I have used the following query to get an age from datetime: select age from (select case when dateadd(year, datediff(year, birthdate, getdate()), birthdate) > getdate() then datediff(year, birthdate, getdate()) -1 else datediff(year, birthdate, getdate()) end as age from userprofile) as a...more >>

Case/Where Exists
Posted by Solel Software at 4/4/2005 1:35:09 PM
Hi, I have a scenario: CREATE TABLE [dbo].[Test1] ( [PersonID] [int] IDENTITY (1, 1) NOT NULL , [Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] CREATE TABLE [dbo].[Test2] ( [SpeechID] [int] IDENTITY (1, 1) NOT NULL , [PersonID] [int] NOT NULL ,...more >>

partitioned view goofiness
Posted by Buzzer at 4/4/2005 1:18:27 PM
ok, i have a partitoned view of 5 years worth or partitioned monthly data. each undertable has a check constraint on a date column when i run this I get a proper execution plan (note i am reviewing the actual execution plan, not the estimated) select * from viewname where datecol = cas...more >>

Time Format
Posted by Chris at 4/4/2005 1:16:30 PM
Hi I have a date time field in my database and i want to do a query that will return just the time by its self. Whats the best of doing it? Thanks in advance ...more >>

How can I select records created within the last 5mins?
Posted by Mark - HIS at 4/4/2005 1:09:02 PM
I am trying to write a query where it will select records where they were created within the last 5mins. Each record will have a field with a time value (varchar (5) this field cannot be changed) to mark when the record was created. I need the query to select CURRENT_TIMESTAMP and then use th...more >>

SQL data importing
Posted by Adam Freden at 4/4/2005 12:59:06 PM
I have data in one table of one database which has an AssetTag field and a SerialNumber field. The serial number data is populated, however the asset tag data is not populated. I have an external file that has the serial numbers mapped to the appropriate asset tags. (I can import the file to...more >>

assigning sequence numbers to records
Posted by rodchar at 4/4/2005 12:57:06 PM
hey all, i have a table with about 1300 rows the records are grouped by a type and i want to assign each type a numbering sequence. what's the best way to do this? For instance, Rec1 Type1 Seq1 Rec2 Type1 Seq2 Rec3 Type2 Seq1 Rec4 Type2 Seq2 Rec5 Type2 Seq3 The seq columns is what...more >>

Converting Numbers
Posted by James Mueller at 4/4/2005 12:57:06 PM
Hi Everyone, We have a database that has numbers and we want to CONVERT all the numbers to 0. How would we go about writing a script that can do such a thing. Thanks in advance for everyones help. Jay :)...more >>

newbie - DEBUG MODE?
Posted by Fab at 4/4/2005 12:52:00 PM
Hello, I have a query I'm working on in the Query Analyzer. My query has variables....I wanted to know if there is a way to track the variable and see its value (I.e. step through) is there a debug mode in the Query Analyzer? Thanks in advance. ...more >>

clearing values from a column
Posted by rodchar at 4/4/2005 12:45:08 PM
hey all, how would i clear values for a column for all rows but not delete the row? thanks, rodchar...more >>

update query
Posted by Steve Read at 4/4/2005 12:45:04 PM
Hello How can I update column 4 in my table? The field names in the table change regularly. I know the field I'm updating is column 4 from ....... select name from sysobjects where id in (select object_id('TEST')) and coliid=4 So something like update TEST set col4 ='a value' whe...more >>

Combined or separate?
Posted by Casper Hornstrup at 4/4/2005 12:04:03 PM
We are trying to decide wether to place SQL Server 2000 on the IIS box or another separate box. What are the pros and cons of doing this? I'm thinking something like performance (shared memory vs. TCP), memory/cpu consumption of the SQL server. Currently the IIS box has an average CPU usage of ...more >>

Design - Multiple field relationships between 2 tables
Posted by Naveen at 4/4/2005 11:31:08 AM
This is a design question but I couldn't find the appropriate newsgroup for SQL Server Design so I am posting this here. I have 2 tables Customer and Company. Customer has fields like AntiVirusCompanyID, EmailCompanyID, SpamFilteringCompanyID and WebFilteringCompanyID . All these company ID'...more >>

ADO and ADO.NET
Posted by Tad Marshall at 4/4/2005 10:58:53 AM
Ok, maybe I am more lost than I realized. (I am a "new user" of SQL Server 2000 and posted this question in the "newusers" group, then thought that perhaps I should have posted it to "programming" instead. So, this is a delayed cross-post, sorry if you had to see it twice.) I have the d...more >>

database log file size problem!
Posted by Brian Henry at 4/4/2005 10:58:50 AM
Somehow my database log has (ldf file) has grown to over 60GB! and the database it is associated with is only 32MB, how can I compress this file? it seems to be getting larger by the hour and now disk space is running out.. thanks! ...more >>

returning only the latest record from a resultset
Posted by Chris Ennis at 4/4/2005 10:40:13 AM
Hi all, I know there is some way to do this that I am just not getting and I hope someone here can help me. I have written the following query to return a group of records for a mailing list: SELECT DISTINCT Company ,NCCIRiskID ,PolicyNumber ,Address1 ,City ,State ,Zip ...more >>

function to return table variable
Posted by JT at 4/4/2005 10:24:01 AM
my question has to do with the performance of user-defined function that returns a table variable vs. traditional temp tables. i have a function that consists of a select statement that populates and returns a table variable. the select is fairly complex and takes a siginificant amount of time...more >>

Sudden increase in log shipping TRN file size
Posted by Jami Bradley at 4/4/2005 10:03:01 AM
Hi, I am seeing some unusual behavior with log shipping (SQL Server 2000) and I can't find the cause. Typically we are seeing 20-30 MB every 15 minues in our TRN files. Today, the TRN files are now 100-600 MB every 15 minutes! I don't know of any changes in the server that could affect this. ...more >>

Alert a user from SQL Sever Trigger
Posted by Ben at 4/4/2005 10:01:43 AM
Hi We are trying to alert a user from a trigger in SQL Server. We are currently using a Trigger to produce an email to the user, which is not ideal due to the quantity of times the alert will be raised during the day. Any suggestions would be ideal. Thanks B ...more >>

Alter View permission?
Posted by DWalker at 4/4/2005 9:09:44 AM
MSDN says the following at http://msdn.microsoft.com/library/default.asp?url=/library/en- us/tsqlref/ts_aa-az_2gtz.asp: "ALTER VIEW permissions default to members of the db_owner and db_ddladmin fixed database roles, and to the view owner. These permissions are not transferable. To alte...more >>

DateTimestamp
Posted by Warren at 4/4/2005 8:09:05 AM
Hi, I currently have a column in a table that is a default of getdate()). My question : Is there a way to capture just the date without the time appended? For example, 04/04/2005. Question 2: How does SQL Server 2000 use indexes on this datetimestamp field? Would a clustered index on th...more >>

Can this Stored Proc be more efficient?
Posted by roy.anderson NO[at]SPAM gmail.com at 4/4/2005 8:03:00 AM
Hey all, Figured I'd get everyone's input on this. The stored proc below works fine, no errors, however the ASP.NET page which calls it takes forever to load (it averages 25 seconds per search). Anyone have any insight on how I can boost the speed? 25-35 seconds is too dang long. For those wh...more >>

Unusual Performance Problem -- help please!
Posted by iTISTIC NO[at]SPAM gmail.com at 4/4/2005 7:57:58 AM
I am posting this a second time only since it got grouped with another old thread on Google Groups. They really need to fix that auto-grouping by subject routine. The query below is taking 3-4 seconds to run under a light load, which seems to be a bit lengthy for the indexes that are in place ...more >>

SQL times and time zones
Posted by Rob Nicholson at 4/4/2005 7:56:50 AM
Does SQL Server take time zones into account when writing a time like this to the database: Update [Trials] Set [Edited]='10:00' Where [ID]=1 We're currently in BST (British Summer Time) here in the UK, so 10:00 is GMT+1, i.e. 09:00 GMT. Does the SQL Server store 10:00 or 09:00 and convert...more >>

Performance Problem
Posted by iTISTIC NO[at]SPAM gmail.com at 4/4/2005 7:51:18 AM
The query below is taking 3-4 seconds to run under a light load, which seems to be a bit lengthy for the indexes that are in place and the amount of data that exists in the tables. I have outlined everything below, including all table definitions, indexes, and row counts. Any help at all will be...more >>

Currency Fromatting
Posted by Jonathan at 4/4/2005 3:35:02 AM
Hi Everyone, I am a bit of a newbie to SQL, I have created a table to hold supplier invoice details which has three columns to hold currency values i.e. Nett Value VAT Value Gross Value The columns for VAT and gross calculate automatically from the Nett value, however the values in th...more >>

HOW TO GET THE PERMISSION ON OBJECTS
Posted by Sharad2005 at 4/4/2005 3:33:04 AM
Dear Friends We have setup a server with replicaiton which will work as a backup server now the problem i have is permission on the objects as the same is created as new sql database there are no permission on the objects, I have created the same roles in the database now i want to give the...more >>

Tricky SQL problem
Posted by robfiskgoogle NO[at]SPAM hotmail.com at 4/4/2005 3:11:10 AM
Hi, I'm hoping someone can help with a bit of a tricky SQL problem we're having. We're using MSSQL 2000. We're trying to implement a search routine for hotel availability, a simplified schema is given below (watch out for word wrapping!): --This table holds possible stock for various r...more >>

Backup in multiple backup files
Posted by Venkatesan at 4/4/2005 2:05:50 AM
Hi folks What are the advantages of specifying more than one backup file in the backup operation. One advantage I know is, it can be spread across multiple hard drives if it is a huge database. Are there any other advantages for doing so. Thanks in advance. ----- *** Sent via Develo...more >>

How to start a URL from sql server?
Posted by suresh at 4/4/2005 2:01:03 AM
Hi , I have one asp page that send sms to the users. i just want to send that sms in a particular time. Since i coudnt execute that asp page in a particular time, i just want to make use of sql server job Schedule. i used the sql server job to run that particular asp page using xp_cmdshel...more >>

Problems with quick record count (no table info in sysindexes)
Posted by sivrik at 4/4/2005 1:57:01 AM
Hi everybody, In my program, I use the following statement to get a quick count of the records in a given table: SELECT [rows] FROM sysindexes WHERE [indid] = 0 AND [name] = 'table_name' I don't know if it's just a bug with SQL, but it sometimes happens that when there are changes to a ...more >>

Need a good insert statement
Posted by TargetBleigh at 4/4/2005 12:53:39 AM
Hi, I need some help. I've spent nearly a week of work and lunch time trying to crack this nut, and I guess I am finally stuck. I have a table with financial data like invoices. The tables are huge. Hundreds of millions of rows per year. I want to store some additional information related to g...more >>

Is any way to call a WebService in SQL 2000?
Posted by Jerry at 4/4/2005 12:19:05 AM

Update field if record doesn't appear in FK field in another table
Posted by TimP at 4/4/2005 12:02:52 AM
Hi I'm developing an ASP app to be the new front end to an existing SQL Server DB. The db has tables for Exhibitions, Venues and Organisers (amongst other things). Because it is a legacy db there are tables which contain old data and I have taken the decision to delete Exhibitions held 2 year...more >>

Problem adding fields to tables as it effects stored procedures and views
Posted by BobRoyAce at 4/4/2005 12:00:20 AM
I have inherited a database and system where tables have like four fields at the end that must remain at the end. So, if I need to add new fields to a table, I need to add them before those fields. The problem is that, when I do this, it "breaks" views and queries that have "SELECT *" from th...more >>


DevelopmentNow Blog