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 > september 2005

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

Database/Application Documentation
Posted by Chad at 9/30/2005 11:47:54 PM
Just general thoughts... It seems to me that there is a lack of compile time binding between a .NET application and the a SQL server database. Can someone suggest the best way to do things like -identify stored procedures that are no longer being used by an application -genrerate a call tr...more >>


Totally OT: 'Celko' Pronounciation
Posted by Frankie at 9/30/2005 11:13:50 PM
How is the name Celko correctly pronounced? Is the 'Cel' part of 'Celko' pronounced like "sell" as in "Let's sell it"??? or is it pronounced like the musical instrument - cello?? "CHELLO"? -Just curious. ...more >>

Cursor question
Posted by ninel g via SQLMonster.com at 9/30/2005 9:21:15 PM
I have a table that contains employees punchin and punchout times. An employee can punchin and out multiple times during day(Lunch/Breaks). Sometimes they forget to punch out, but punch in again. So I can have records that look like this: EmpId Project PunchIn PunchOut 1 A ...more >>

Can we specify timeout for a SQL server job?
Posted by Pushkar at 9/30/2005 8:28:39 PM
Hi, I have created a SQL Server job. I want to know that wether I can specify a timeout value for the job, ie = after running for some days that job should finish off. Thanks in advance. Pushkar...more >>

Cursor question
Posted by ngorbunov NO[at]SPAM onetouchdirect-dot-com.no-spam.invalid at 9/30/2005 7:05:21 PM
I have a table that contains employees punchin and punchout times An employee can punchin and out multiple times durin day(Lunch/Breaks). Sometimes they forget to punch out, but punch i again. So I can have records that look like this EmpId Project PunchIn PunchOu 1 A 09:0...more >>

Need advice on ETL architecture...
Posted by sqlster at 9/30/2005 5:06:02 PM
I am about to design (I think it could be considered as) ETL system and here are my thoughts on how it should work at a very high level. My intention in this post is to find out if there is a better way to design this. Data is originally entered in an as400 system. On nightly basis, ...more >>

Dynamic Execute in Function?
Posted by xenophon at 9/30/2005 4:54:52 PM
Is it possible to dynamically execute SQL in a Function? Set @selectit = ' Select Startdate from [dbo].[' + @tablename + '] Where testcol=113' Exec (@selectit ) Is what I want to do but Query Analyzer won't let me do it. SQL Server 2000. Thanks. ...more >>

Count Attempts!
Posted by Adam Knight at 9/30/2005 4:20:08 PM
Hi all, I want to SELECT the most recent ATTEMPT_ID (in this case attempt_id=3) and determine how many attempts (using COUNT) have IDENTICAL QUESTION LISTS based on the ATTEMPT_RESULTS table? IE: Attempt 2 has an IDENTICAL QUESTION LIST (to 3) in the ATTEMPT_RESULTS table using the D...more >>



Subqueries in Case statement
Posted by Terri at 9/30/2005 3:59:08 PM
Can I use a subquery in a case statement. Current code. CASE SECURITY.SEC_TYP_CD WHEN 'MUNI' THEN do action A here WHEN 'CB' THEN do action A here WHEN 'CONB' THEN do action A here ELSE do action B here END Rather than checking every security type I'd rather use a subquery and see ...more >>

SQL query help
Posted by Mike Read at 9/30/2005 3:52:44 PM
Hi I have a table of IDs and distances eg ID distance 1 0.2 1 0.1 2 0.3 2 0.35 3 0.2 3 0.2 4 null I like to pull out the row for each ID having the minimum distance (for a given ID). i.e I'd like my resultset to be 1 ...more >>

Need help with how to get a count of unique values in a table
Posted by kevin NO[at]SPAM questionmark.com at 9/30/2005 3:13:00 PM
Topics sounds confusing, right? Welcome to my world! Here's an example. I have a database of phone numbers, such as this: table: members field: phone_number values: 123-456-xxxx 123-234-xxxx 324-667-xxxx 555-767-xxxx 555-876-xxxx 661-661-xxxx 555-555-xxxx 324-324-xxxx I ...more >>

delete records
Posted by Dion at 9/30/2005 2:45:02 PM
I am having trouble trying to figure out how to delete some records. I have the following query: select * from p join ppt on p.PatNo=ppt.PatNo where p.DayTime>=ppt.Discharge this returns 1,000 records. These are the records I want to delete from p. I created this delete query: delet...more >>

Partitioning - Execution Plan
Posted by Christian Hamel at 9/30/2005 2:43:36 PM
Hello group, I'm considering creating a Partitioned view on a Sales table that contains up to 20 Millions records. I'm doing some test and have a result I'm questionning when looking at the Execution Plan generated. First, let me explain a bit my structure. In my Sales table, I have Ex-...more >>

Problem with SQL Server and odbc, please help me!
Posted by Tonio Tanzi at 9/30/2005 2:41:22 PM
I have Visual Studio Dot.Net on Win XP and use the MSDE to access to Sql Server. This morning I've attempt to create a new ODBC DSN for Sql Server so I've executed the wizard for a new System DSN by the ODBC administrator of Windows. But when it attempts to connect to the server (the third ...more >>

Surrogate Keys
Posted by Frankie at 9/30/2005 2:33:08 PM
What is an accurate definition of a "surrogate key" and what would be a straight-forward example of when it would be a good idea (if ever) to use one? I ask because I think "surrogate key" is sometimes misused and/or is not the correct term for what is being communicated. For example some s...more >>

Help! Need assistance!
Posted by nashak NO[at]SPAM hotmail.com at 9/30/2005 2:15:08 PM
I have a table with following columns: Tutorial Number Lesson Number Order Number where each tutorial has many lessons and there is a order number for each lesson within that tutorial. In the UI, once the user re-sorts the lessons in any manner which they like, I am to store the new ord...more >>

TOP Operator - Variable?
Posted by Adam Knight at 9/30/2005 2:09:35 PM
Hi all, I am wanting to select a particular number of rows using the TOP operator. The number of rows in particular are provided by a varable if possible. SELECT TOP @oqs NEWID() AS ID,asmt_v2_question_id, qtext, qindex, qtype, answer_url FROM asmt_v2_questions Obviously this does...more >>

Is this a bug, CURSOR_STATUS() always return -3 ?
Posted by S.M at 9/30/2005 1:35:15 PM
Hi, With this simple test, CURSOR_STATUS() function always return -3 use Northwind go if object_id('dbo.TestCursor') is not null drop proc dbo.TestCursor go create proc dbo.TestCursor as declare @ContactName varchar(50) declare My_Curs cursor fast_forward for select ContactN...more >>

select only first row
Posted by mcnewsxp at 9/30/2005 1:20:18 PM
i need to get only the first row from one of the joins in a multiple join query. i am join several tables to the main table. all but one of the joins are simply replacing key values with text. the last join may find several rows is is causing a row to be displayed for eahc value, i only ne...more >>

SQL Server and case sensitive instance
Posted by Alain at 9/30/2005 12:07:44 PM
Hi, I was under assumption that case sensitivity in SQL Server will be apply to both object data as well as identifiers (object names). I've istalled the new case sensitivity instance and I'm able to create 02 databases with same name (in different case), but it does not work for tables or S...more >>

Trigger on Insert for existing data
Posted by Stephen Russell at 9/30/2005 11:46:40 AM
Got a new biz rule that fits a trigger implementation. Table = Orders. It already has 2 triggers in place on insert so adding a third. NewRule is to update columns from a metadata rules for this particular client. The rules will come via a cursor, 1-5 rules (chage data input to "official...more >>

Distributed Transactions fail
Posted by JP at 9/30/2005 11:26:02 AM
We are trying to create SPs that are using linked servers. I have been able to create the linked server and see the views and tables. The issue is that after creating a SP the uses the 4 part naming convention all atempt to actually save the querry have failed. In some cases I can run the SQL ...more >>

QA Reserved/Keyword 'HELP'
Posted by mlh at 9/30/2005 10:10:04 AM
Does anyone know what the 'HELP' keyword does in QA? It shows up in blue but I can't find any documentation for it....more >>

Access 97 / VBA Users...
Posted by Mike Labosh at 9/30/2005 10:08:24 AM
....should NEVER be allowed to touch EM, no matter how much T-SQL they know. She sent 7800 records into an external "black-box" system -- records whose status wee need to track. And then she deleted them from SQL Server. Now she's talking to one of our C# guys about using a hex editor to ...more >>

converting a column from varchar to int
Posted by et at 9/30/2005 10:08:09 AM
I need to copy the data from varchar column into an integer column, obviously only copying integer values. How can I do this? I am not even sure how to select data from a column so that the results are only the numeric ones. Thanks for your help. ...more >>

Count with Group By
Posted by kiran at 9/30/2005 10:01:57 AM
Hi, I am using GROUP BY on two columns. SELECT ID,T_ID FROM EMPLOYEES GROUP BY ID,T_ID Result: 154 1 154 2 154 3 154 6 154 7 154 8 154 9 154 10 161 11 I tried SELECT COUNT(ID) FROM EMPLOYEES GROUP BY ID,T_ID Result: 1 1 3 3 6 1 1 1 2 But I was expecting a r...more >>

SQL Select Last Receipt Statement
Posted by Joe Williams at 9/30/2005 9:49:41 AM
I have a transaction table that has PartNumber, TransactionType, Date, and Quantity as fields. Obviously each PartNumber will have many transaction records with many different types of transactions (shipments, receipts, inventory moves, etc. ) The transaction type for receipts is "POR" For ...more >>

Inline Queries Definition
Posted by Sudhakara.T.P. at 9/30/2005 9:45:01 AM
hi, Can anyone let me know the exact definition of "What do you mean by Inline Queries in SQL Server?. I have heard lot of people talking about Inline Queries but when asked about the definition of that, I am not getting the exact answer for that. Regards Sudhakara.T.P....more >>

scramble password
Posted by Rich at 9/30/2005 9:40:02 AM
Hello group, I have a fairly simple question (hopefully simple anyway). I have a table that has basic application user data: name, address, city, email, password. I now have a requirement to in bulk take the password and encrypt them. They have already given me the function name to use: ...more >>

UPDLOCK problem with Stack
Posted by Tom at 9/30/2005 9:22:58 AM
Hi all i have a table, which is my stack. from this table i want to select row by row the records. after selection i set a currentuser flag, so no other user will get this record. following procedure does this things for me: ALTER PROCEDURE GetSheetFromStack @UserId INT AS SET NOCOUNT...more >>

IsNumeric Function Question?
Posted by Uday at 9/30/2005 8:51:04 AM
Hi all, Please take a look the queries below: select isNumeric('0000E000110') as IsNum IsNum ----------- 1 (1 row(s) affected) select isNumeric('0000D000110') as IsNum IsNum ----------- 1 (1 row(s) affected) select isNumeric('0000A000110') as...more >>

Incorrect syntax near 'COLLATE'
Posted by SteveInBeloit at 9/30/2005 8:41:07 AM
Hi, I have an ACCESS ADP project that hooks to an SQL database. I have been working on in may weeks and it is ready to go. While testing yesterday, I found that when I know try to open a table from ACCESS, I get the above error message. I can still see it OK in EM. Today, when I call one ...more >>

Percent Range for a list of numbers
Posted by luvgreen at 9/30/2005 8:19:03 AM
Hello experts. I need to give a percentile rank for a list of numbers, is there a SQL server built-in function doing this? Thanks much Example below: Data Rank 13 100.00% 12 88.80% 11 77.70% 8 66.60% 4 55.50% 3 44.40% 2 33.30% 1 0.00% 1 0.00% 1 0.00% ...more >>

viewing index info in query analyzer
Posted by AHIhelp at 9/30/2005 7:57:03 AM
Does anyone know of a way to get index info on a table within query analyzer? In the same way that you can run sp_pkeys, sp_columns, sp_tables etc.... -- AHIhelp...more >>

Group By OR ?
Posted by Mij at 9/30/2005 7:45:43 AM
I have a query that produces the following result set: Effect. Date Expir. Date Cert. Type 7/23/2002 7/22/2005 O 5/10/2004 7/22/2005 P 7/23/2005 7/22/2008 O 7/23/2005 7/22/2008 P The last two lines have the exact ...more >>

Group By OR ?
Posted by Mij at 9/30/2005 7:23:46 AM
I have a query that produces the following result set: Effect. Date Expir. Date Cert. Type 7/23/2002 7/22/2005 O 5/10/2004 7/22/2005 P 7/23/2005 7/22/2008 O 7/23/2005 7/22/2008 P The last two lines have the exact ...more >>

More not in issue
Posted by qjlee at 9/30/2005 7:16:04 AM
Hi, I have three tables, one is the client information table (T1) contain an uniqueid for the client, the other is client address table (T2), which contains different type of address for the client (e.g. business address, home address) and the different type of address is identified by add...more >>

User Roles and Permission
Posted by Tony at 9/30/2005 6:26:03 AM
How do I change user role/permission for a user/s on time in different databases if possible pls assist thanks to Uri Dimant and R.D for my other post , it made a difference -- Eager to Learn...more >>

Error in GroupBy
Posted by Wayne Wengert at 9/30/2005 5:52:10 AM
I have the query shown below which throws an error that "JudgeName" is an invalid column name? Is using an alias not allowed here? Wayne ================= code ============== SELECT (Names.LastName + ', ' + Names.FirstName) As JudgeName FROM JudgeEvals Inner Join Judges On Judges.JudgeI...more >>

Table Manipulation Issue
Posted by thomson at 9/30/2005 2:48:44 AM
Hi all, i do have 3 tables with me FIRST TABLE fid code description 12 asc newfor SECOND TABLE sid FID code description 20 12 FD NEWDESC THIRD TABLE TID SID CODE DESC PARENT_TID 1 20 HJ HJ NULL 2 20 LK ...more >>

datediff comparison to previous row in select statement
Posted by robz8701 at 9/30/2005 1:48:08 AM
In a table I have information of a vehicle's status with an appropriate date, what I am trying to achieve is to display the number of days between two dates of two different statuses. Problem is that the same scenario can happen on more than one occasion and there is no data linking 2 statuses t...more >>

copy tuples from table tsql?
Posted by pnp at 9/30/2005 1:01:46 AM
Hi all, I'm trying to write a TSQL procedure that takes as an argument a tablename in a database and then it copies the first 100 tuples of the given table in the same table (it actually duplicates them). The table doesn't have a standard schema and the query should be able to deal with dif...more >>

problem with xp_sendmail
Posted by Hans at 9/30/2005 12:52:48 AM
Hello, I have the following problem. I use the xp_sendmail often in the SQL query analyser with the folowing script: >> USE MASTER EXEC xp_sendmail @recipients = 'hans.de.korte@verder.nl', @subject = 'Test mail', @message = 'Testmail1' << This worked OK for months. After r...more >>

file backup
Posted by Joe at 9/30/2005 12:19:03 AM
Since i backup a database with file backup option, then i delete the database , then i use the file to restore, it can't, why...more >>

no recovery option
Posted by Joe at 9/30/2005 12:17:09 AM
what is the meaning for no recovery option...more >>

Upgrading our system
Posted by Enric at 9/30/2005 12:01:02 AM
Dear folks, Nowadays, we have got an Active-Active cluster for to attend our business as usual. Each node own the following main features: -8 processors xeon 700 Mhz -8 Gb RAM -RAID 5 (up to 400 gb ) 12 disks approx. -OS 32 bit (Advanced Server) -Sql2000k with sp3 -Quorum disk have...more >>

SQL 2000 UserID & Password Question
Posted by Hugh O at 9/29/2005 10:29:30 PM
Hi, I have the following error that I have gotten when I try to use Crystal Reports within Visual Studio.Net 2003 and within a VB ASP.Net app that accesses a SQL Server 2000 Database CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. Searching through Google it seems t...more >>

Non-deterministic UDF's?
Posted by Arthur Dent at 9/29/2005 9:40:44 PM
Hello all, i want to make a non-deterministic UDF... is this possible? Heres what i have... its an online catalog. The site has an option DAYS_LIST_AS_NEW, where the owner can specify a number of days for which a product is listed as new, so if the user puts a value of 30, products are listed ...more >>

INSERT INTO query exception
Posted by bruce lawson at 9/29/2005 7:51:38 PM
Hi, I'm fairly new at SQL query language and am running an example program from a text in VisualBasic where I want to just insert a new row in an existing table, but I keep getting a syntax error in the INSERT INTO statement. Here's the program flow and below that, the error message caught i...more >>

Select statement on multiple values
Posted by Antonio Budano at 9/29/2005 7:13:50 PM
Hi there, I have a table as defined below that contains some configuraton values. ConfigurationID CharacteristicID CharacteristicValue --------------- ---------------- ------------------- 1234567890 Lenght 2300 1234567890 Height 1900 12345678...more >>


DevelopmentNow Blog