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 > august 2005 > threads for thursday august 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 31

Notify events?
Posted by tshad at 8/4/2005 10:27:26 PM
Is there anyway with Sql Server 2000 to notify me of a record being written to a table? For example, I would like to know when a record is written to a table to let me know that some status has changed and that I would need to do something to resolve the situation. I would have a service runn...more >>


Alter Table
Posted by Plantador R via SQLMonster.com at 8/4/2005 7:59:41 PM
Hi, i think that my question is stupid, but i will ask anyway .. I want to allow a user to create stored procedure, alter stored procedure, and drop procedure, but the same user cant alter any table, can i do that ??? Thanks -- Message posted via SQLMonster.com http://www.sqlmonster.co...more >>

Text datatype in SQL Server 2000
Posted by Rach513 at 8/4/2005 7:05:02 PM
I have a text column in my table. Based on what I heard from my DBA, it should take any length of text data. But this is not the case. I am inputting some large amount of text into the database. But when I try to see what is entered, I am seeing only a chunk of what I entered. I thought may ...more >>

SET IDENTITY_INSERT LOCKS TABLE
Posted by jp at 8/4/2005 5:59:37 PM
Hi. I have the following procedure: .... BEGIN TRANSACTION SET IDENTITY_INSERT REGISTROS_TMP ON INSERT INTO REGISTROS_TMP (..., ..., ID, ....) values (..., ..., @Id, ...) SET IDENTITY_INSERT REGISTROS_TMP OFF COMMIT TRANSACTION This locks this table, and a couple more, I think. I ...more >>

Help doing a SUM for Fiscal Year data
Posted by Jason at 8/4/2005 4:41:32 PM
I have a problem that at first sounded easy (perhaps it still is), but as I get into it I'm getting more and more confused. Here is the problem. I have a table holding transctions (we'll call the table Trx for ease of use), and this table has a Date column that records the date of the transa...more >>

Counting Orders in Sub-Select Query?
Posted by Dan at 8/4/2005 4:32:51 PM
Hi, I am summarizing data like this SELECT dbo_Order_Line_Invoice.Cono, dbo_Order_Line_Invoice.CustId, Year([Invoicedate]) & '/' & Format(Month([Invoicedate]),'00') AS [Year-Month], dbo_Order_Line_Invoice.VendId, Sum(dbo_Order_Line_Invoice.Sales) AS Sales_Total, Sum([Sales]-[Cost]) AS ...more >>

DADIFF expressed as float
Posted by Mark Hoffy at 8/4/2005 3:55:27 PM
Hello, I am trying to calculate an age in terms of years and express the result as a float, such as 3.75 years or 5.33333 years etc. I have tried things like... CONVERT(float, DATEDIFF(d, MyStartDate, getdate()) ) /365 as YearsOld But this gives results as whole numbers like 3.0 and 5.0....more >>

DateDiff years as a float
Posted by Mark Hoffy at 8/4/2005 3:52:09 PM
Hello, I would like to calculate the diferrence between two dates and express the result as a float of the number of years - such as 3.75 or 5.33333. I am trying... CONVERT(float, DATEDIFF(d, MyStartDate, getdate() ) ) /365 as YearsOld (I realize that dividing by 365 is inaccurate, but i...more >>



Parsing a comma-delimited text column
Posted by Mike Austin at 8/4/2005 2:51:04 PM
I have a legacy database that was originally in mySQL. It contains many columns that contain comma-delimited lists of foreign keys. So the column may contain "802,1404,25,124" etc. All the numbers in the list point to lookup values in another table. I need to take these lists and create a r...more >>

Erreur_:_Les_donn=E9es_cha=EEne_ou_binaires_seront_tronqu=E9es._L'instruction_a_=E9t=E9_arr=EAt=E9e.
Posted by fchiausa NO[at]SPAM free.fr at 8/4/2005 2:09:05 PM
Bonjour, j'obtiens une erreur lors de l'insertion d'un enregistrement dans une de mes tables. je ne comprend pas porquoi j'ai cette erreur ni meme ce qu'elle veut dire. l'erreur est la suivante : "Les donn=E9es cha=EEne ou binaires seront tronqu=E9es. L'instruction a =E9t=E9 arr=EAt=E9e." ...more >>

Update Question!.............
Posted by tom d at 8/4/2005 2:09:01 PM
Hi, I have a table like this: Name Count(int) Tony NULL Dennis NULL Mark NULL .. .. .. How do I write an UPDATE statement (or a cursor) that will give me this: Name Count(int) Tony 1 Denni...more >>

Syntax error or just too complex
Posted by BBM at 8/4/2005 1:40:01 PM
Hi everyone, I'm trying to do a nested join query and not having any luck. The Query Analyzer gives me a "Syntax Error near 'Left'" on this query... Select PeriodId, Quantity, Balance, ResType, Label FROM ((SELECT DayDate, PeriodId, Label, ResourceType FROM ATSWeeks CROSS JOIN ATSResour...more >>

Code to verify date as Valid
Posted by Earnie at 8/4/2005 1:38:06 PM
Is there code to establish if a date is valid so that I can send an error message if i get the 31st of February for instance im thinking of something like the following but don't know the code @feedback = case when (@date is ok? ) then 'DateGood' else 'DateBad' end regards Earnie ...more >>

UPDATE SQL
Posted by MS User at 8/4/2005 1:30:39 PM
Table A with columns (id, Adate, AType, No) Table B with columns (id, BDate,BType,No) Sample Data Table A 100, NULL, NULL, 1 Table B 100, 01/01/2005, AA, 1 100, 01/02/2005, BB, 1 100, 01/03/2005, CC, 1 I need an update statement which updates Tab...more >>

Stumper of a Syntax Error
Posted by David Snyder at 8/4/2005 1:21:03 PM
I'm trying to write a script to alter a view, and I'm having difficulty getting Query Analyzer to successfully parse the script. Here's the script... IF Exists ( SELECT * FROM dbo.sysobjects WHERE ID = object_id( N'[view_Project_Detail]' ) And ...more >>

Report of every user for every database on server
Posted by Joshua Campbell at 8/4/2005 1:17:29 PM
For auditing purposes, I create a list of all the users who have access to my databases. I do this by issuing this: exec sp_MSForEachDB sp_helpuser However, this doesn't include the name of the database that the list of users is for. How can I include this info? Thanks. ...more >>

How to know which fields are identity?
Posted by Diego F. at 8/4/2005 12:17:01 PM
Hi. I need to know if a table has identity fields. Is there any view to get that information? -- Regards, Diego F. ...more >>

Database maintenance and Database Administration?
Posted by angela.solorzano NO[at]SPAM ca.wunderman.com at 8/4/2005 12:07:40 PM
I need some help.... Can someone please, in point blank form tell me the difference between Database maintenance and Database Administration? This might seem obvious, however apparently I am not certain. thx ...more >>

Write conflict in subforms
Posted by TLD at 8/4/2005 11:07:04 AM
Using Access 2000 as an .adp front end, a form reads records from a very wide table. A subform allows views of different sets of fields from the same record. There are three sets, each of which resides on a different subform that is switched into the subform control on the main form. After ...more >>

transaction log question
Posted by pmcguire at 8/4/2005 10:46:04 AM
I have a fairly small database that is only being used by 2 people (it will be used by many more in the future). I am replicating this database to another database that is currently being used by only a few people. My automated replication process began to fail after only about a week due to...more >>

SQL rollup/update question
Posted by Johnny at 8/4/2005 10:35:20 AM
Hello. I have data in a table, like so: Sample data: claim claimline denied 1000 1 500 1000 1 501 1000 1 502 1000 2 502 2000 1 500 I want to roll up the lines with comm...more >>

compare child records - t-sql
Posted by Stephen at 8/4/2005 10:07:17 AM
I have four records, each containing a date. LineNo ShipDate RefLine -------------------------------- 1 1/30/05 <null> 2 1/1/05 1 3 1/15/05 1 I want to compare the date in line 1 to 2, then 2 to 3 Basically, the lines belong to the same order. Wha...more >>

Is there any API to browse for folder on SQL Server's machine?
Posted by Igor Solodovnikov at 8/4/2005 10:03:24 AM
Hi! I know there is xp_dirtree, xp_subdirs, xp_fixeddrives procedures which allows me to implement a folder select dialog. But SQL Server's Enterprise Manager already has such dialog. For example if you open "Attach Database" dialog and then press browse [...] button Enterprise Manager wi...more >>

"Completing" a time phased table
Posted by BBM at 8/4/2005 9:53:01 AM
Hi everyone, I Need to display summarized, time phased (lets say weekly), data in a datagrid. Pretty straightforward except that my summarized data may or may not be "complete". That is if I do a simple summarization query on my base data I won't get a record for every week. In my DataGr...more >>

2005 - Common Table Expressions Question
Posted by Amos J. Soma at 8/4/2005 9:51:46 AM
I am excited about this new feature in SQL Server 2005. However, it seems to me there is a rather severe limitation to CTE's. That is the fact that any queries that call the CTE must call them right after the CTE definition. For example, Example #1 works, Example #2 fails, Example #3 works. I ...more >>

Security: Accessing data in another db
Posted by Craig HB at 8/4/2005 9:18:06 AM
For all our ASP.Net applications we use a user called 'AppUser' to connect to the database, which only has execute permissions on the stored procedures. This makes sure that client apps only connect to the server via stored procedures. I keep this up-to-date by running a stored procedure t...more >>

Tracking Row Changes
Posted by Chuck P at 8/4/2005 9:01:12 AM
I would like to track who made a change and when a change was made to a row. In Oracle we did this a with a "Before Insert or Update", "Row Level" trigger that would grab the connected users Name and System date and then put it in Fields: Update_Who and Update_When (which had Not Null constrain...more >>

assistance with rounding
Posted by Chris at 8/4/2005 8:50:45 AM
Hi, I have the foll round((convert(decimal(4,0),d.new - d.old)/d.old)*100,0) The result I get is -54.00000000000 How can I change it to only display -54 Thanks...more >>

Nightly Data Structure Refresh
Posted by Steve R at 8/4/2005 8:21:07 AM
We are receiving a reporting database from a vendor nightly. We want to upload this data and structures to SQL Server nightly. We want it to be as flexible as possible - if the vendor adds/deletes a table/column, the import job should handle that. Apparently, the Import/Export wizard in S...more >>

SQL Paging Question
Posted by SouthSpawn at 8/4/2005 8:17:17 AM
Hello, I have an asp.net application that will use a SQL Server DBMS for the backend. On my asp.net form. I have a next, previous, last and first buttons on my form. Basically, this application will allow the user to page through some data one record at a time. Let's say my SQL statement ...more >>

Enforce unique on non-NULL values with Trigger?
Posted by Dave at 8/4/2005 8:15:07 AM
According to the docs, SQL treats NULL as a value so you can't put a unique index on a column that allows nulls for such things as optional values. For an example, an employee table, the cell phone column is optional and can allow nulls since not everyone has a cell number. However, if they ...more >>

Using Count Dynamically
Posted by TroyS at 8/4/2005 7:49:26 AM
I'm trying to get a sum of employee certification by certification name without having to hard-code the certification name into the query. The list of certifications may change as new ones are added via an application .......... In the examples i've found, typically the query hard codes the ...more >>

Problem with deadocks
Posted by Tinchos at 8/4/2005 7:49:06 AM
Hi list, iam very new to SQL. i have a developer that is making a very complex query over a SQL2000 + SP3 database, with a lots of union queries. He recieves this error: Transaction (Process ID 97) was deadlocked on lock | communication buffer resources with another process and has been chos...more >>

Hierarchy - Finding loops in the data
Posted by carmaboy NO[at]SPAM gmail.com at 8/4/2005 7:49:00 AM
I've spent hours trying to find the answer to this with no luck. One of our systems tracks connections between objects. If a user enters an object that is connected to to another object that is connect to its parent object, we have problems. We have many diffent type of objects, so I will tr...more >>

Dynamic crosstab query in MS SQL Server 2000
Posted by Marcin Zmyslowski at 8/4/2005 7:46:58 AM
Hello all! I have a problem with creating crosstab query in MS SQL Server 2000. I spent 8 hours on searching internet to achieve my succes but without result. I would like to transform such data: MRPController WK Value C01 200505 1 C01 200505 1 C02 ...more >>

i know this is a dead horse (natural vs. artificial keys)
Posted by jason at 8/4/2005 7:14:17 AM
if you're sick of this topic, feel free to skip this post. i've read about half a dozen threads focused specifically on this topic, but every comment gave me questions. and the threads were all too old to comment on, so i want to make sure my young opinion is an informed opinion. the databa...more >>

How could I obtain the domain name from SQL?
Posted by Enric at 8/4/2005 5:56:07 AM
Dear fellows, I would need from T-SQL job or through any friendly-user function (VB front-end app) the aforementioned value. With EXEC xp_cmdshell 'IPCONFIG /ALL' I get values such as HOST NAME or IP Adress. Problem is the following: if oneself launch IPCONFIG /ALL from a DOS session ...more >>

insert affected columns in instead of trigger
Posted by sathya at 8/4/2005 5:38:02 AM
hi, i am using instead of trigger in sqlserver 2005, my trigger looks like create trigger [dbo].[docsUpdate] on [dbo].[Docs] instead of update as IF (Update(MetaInfo)) BEGIN bla bla bla bla [Some operation] end my table looks lke this Dirname LeafName TimeLastModified Extension ...more >>

Trouble with SQL stored procedure
Posted by DKrosh at 8/4/2005 5:37:27 AM
Hi. I have stored procedure. ALTER PROCEDURE dbo.test @param1 varchar(1), @param2 varchar(2) as declare @iParam1 int declare @iParam2 int if isnumeric(@param1) > 0 begin select @iParam1 = cast(@param1 as int) end if isnumeric(@param2) > 0 begin select @iP...more >>

Date Problem
Posted by Sunil Sabir at 8/4/2005 4:10:02 AM
Dear All, I am using British English for my database. I am using the following function to convert the date CONVERT(varchar(20),'04/10/2003',23) and its returning me 2003-04-10 which I dont want. The format which I require is 2003-10-04 (yyyy-mm-dd). Any help will be much appreci...more >>

order by bearing in mind seconds
Posted by Enric at 8/4/2005 2:02:01 AM
hi, How could I order by datetime type including the seconds? Now I am using order by <field> and it' getting the values of this way: 2005-08-04 03:03:42.000 2005-08-04 04:00:33.000 2005-08-04 07:31:20.000 Instead of: 2005-08-04 07:31:20.000 2005-08-04 04:00:33.000 2005-08-04 03:0...more >>

Store multi language in DB
Posted by Yoke Heng at 8/4/2005 1:51:02 AM
I have wrote an application using VB6 and SQL7 and it is running LIVE in client side. Due to their business growing, they requested the system is able to capture other characters like Chinese and Portugese. I have no idea how and where to start. Anyone can help? Thx. YH...more >>

I need to figure out an property
Posted by Enric at 8/4/2005 12:14:14 AM
Dear all, I would need to know where is the variable for the time inverted for each DTS in each launching. In what table is stored. Regards,...more >>

cursor problem
Posted by ichor at 8/4/2005 12:00:00 AM
hi, I have a stored procedure in which i have a cursor cur1. when there is an error in the SP the cursor is not closed on exit of the SP. i am currently looping syscursors to find the currently open cursor n then deallocating it as shown below.. but i realize the user needs perm to access the...more >>

SP calls another SP
Posted by Arjen at 8/4/2005 12:00:00 AM
Hi, I some SP I am doing this: DECLARE @EmployeeId INT SELECT @EmployeeId = NULL SELECT @EmployeeId = [EmployeeId] FROM [Employees] WHERE [Code] = @Code Can I place this in another SP or function (What's the best?) to minimize code lines? For example I want something like this: DECL...more >>

Select this week in SQL?
Posted by Mike at 8/4/2005 12:00:00 AM
Our business weeks run from Sunday to Saturday. Is there any way to create a query that filters a date field so that it only returns records with a date >= *last* Sunday. e.g. >=Sunday 31st July 05 and if I run the query next Tuesday it will return records >= Sunday 7th August 05 Obviou...more >>

Help
Posted by Bpk. Adi Wira Kusuma at 8/4/2005 12:00:00 AM
I make a program with vb (ADO) to connect SQL Server. If I want to execute its program at other computer where there is no SQL Server, So what do i have to install (what component of sql Server that I must install)? Can I just copy files that be needed only? ...more >>

how i can skip error messeges within Procedures
Posted by Sam at 8/4/2005 12:00:00 AM
how i can skip error messeges within Procedures such as can't insert to duplicate keys thanks sam ...more >>

Getting last modify date of table design
Posted by Jason Chan at 8/4/2005 12:00:00 AM
Hi, I was wondering whether there is a way to get the last modify date of the table schema. Let's say someday I added a column to a table, will the system capture the day? I want this information. Thanks in advance. Regards, Jason Chan ...more >>

Copying named ranges or arrays from one sheet to another
Posted by Mark Stephens at 8/4/2005 12:00:00 AM
Does anyone know how to achieve the following as my do loop contstructions are taking quite a while to execute and this would be far faster I am sure (i used to know how to do it but cannot for the life of me remember what I did and I cannot find the answer on google)? I have a column A contai...more >>

skip error messeges within the pass-through query
Posted by Sam at 8/4/2005 12:00:00 AM
in MS Access i use vba code to run pass-through queries to run sql server Procedures now errors like can't insert to duplicate keys stop's the code with error how i can skip the error messeges within the pass-through query thanks sam ...more >>

fill down formulas without selecting the sheet
Posted by Mark Stephens at 8/4/2005 12:00:00 AM
At the moment I have a bunch of formulas along the top row of a sheet and I wish to copy them down a predfined number of rows. At the moment I activate the sheet and then select the rows I want to copy down with the row containing the formulas at the top. It would be much cooler if I could a...more >>


DevelopmentNow Blog