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 2004 > threads for monday september 13

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

last execution
Posted by alf at 9/13/2004 11:08:49 PM
How can i konw how many time pass since las execution of all my sp. thnks may thanks ...more >>


How to access a local text file from SP on remote database.
Posted by Mark Butler at 9/13/2004 9:44:00 PM
I have a set of text files which are ftp'd to my server daily. I have to update these to multiple remote SQL databases. I am linked to these databases via a VPN and use the IP address to set up the link to my local server. Each of these stored procedures build a work file from these text file...more >>

GROUP BY HAVING
Posted by Bogus0 at 9/13/2004 6:49:01 PM
I'm having trouble understaning a code snippet from Ken Henderson's book The Guru's Guide to Transact-SQL. The exmple computes a statistical median (see below). I've used GROUP BY and HAVING lots of times. I usually use a simple HAVING clause like HAVING COUNT(*) = 1 or something like that....more >>

Passing in multiple values to one parameter
Posted by Ace at 9/13/2004 6:09:02 PM
Hello, I have a sproc declared like this. CREATE PROCEDURE [dbo].[GetMyResult] @Param1 varchar(50)=null AS... SELECT * FROM TABLE1 WHERE Col1 IN (@Param1) As you can see above, I need to select result set filtered based on values passed in. First, is it how I should do? Secon...more >>

View Error using GROUP BY
Posted by Jim K at 9/13/2004 6:07:09 PM
I have the following View in SQL 2000: SELECT DISTINCT [Property ID], SUM(Amount) AS SumOfAmount FROM dbo.[Payments more than 60 days old] GROUP BY [Property ID] and get the following error: [Microsoft] [ODBC SQL Server Driver] [SQL Server] Location: recbase.cpp 1375 Expression: ...more >>

numeric data type
Posted by Savas Ates at 9/13/2004 6:06:31 PM
st_getfriendoffers @offerid='26',@userid='' CREATE PROCEDURE st_getfriendoffers @userid numeric(18), @offerid numeric(18)=0 AS if @offerid ='' select * from crosstable where towhom=@userid and block=0 and active=0 else select * from crosstable where id=@offerid GO Error convertin...more >>

HELP!!! - STORED PROCEDURE TRANSACTIONS
Posted by GG at 9/13/2004 5:39:06 PM
Can someone please help me? I am working on a dual 2.4 GHz Compaq Server with 2 GB of RAM. This server has Hyperthreading enabled. SQL Server 2000 SP3 I have been doing some performance testing of one of our applications. My issue is related to Transactions. Lets say that I have tw...more >>

Search from 3 tables & display acc to best match
Posted by Mike at 9/13/2004 5:27:10 PM
Hi, I am trying to write a search query which should query 3 tables based on the keyword provided by the user.I am using ASP as a front end. The search should be displayed according to best match (the best match should be displayed first) The tables & fields of each table are : main : mai...more >>



SQLDMO installation and server machine name
Posted by Yannis Makarounis at 9/13/2004 5:13:36 PM
I would like to be able to check if SQLDMO is installed in a machine and if no to install it without installing SQL Server. Is this possible? If yes what do I need to install and register? Is it possible to get the machine name knowing the name of an instance of SQL Server? Thanks Yannis ...more >>

Store procedures
Posted by John J. Hughes II at 9/13/2004 3:52:50 PM
I have been switching my C#.Net application so it uses stored procedures. Mostly this is not a problem but I have a couple windows that allow the user to search based on different values in the database. To do this I give them a screen with a list of check boxes and entry fields and then buil...more >>

Replication Without VPN?
Posted by Steve Bishop at 9/13/2004 3:46:13 PM
Can't seem to get help on the replication group so I wanted to ask here. Is it possible to use Transactional replication between 2 sites without using a VPN? How about SSL? This seems like the only other option. Would I need to get the servers to talk to each other first by connecting in Enter...more >>

Executed SQL history??
Posted by A Traveler at 9/13/2004 3:44:36 PM
Hi,.. Is there any way i can see an history of the SQL statements (DDL and DML) which have been executed against a database? I have a sproc which runs fine when i run it from Query Analyzer, but when i try to run it from my application, the procedure is throwing a syntax error from somewhere i...more >>

sql server
Posted by Martin at 9/13/2004 3:19:17 PM
Hi, I have sql server agent jobs that are failing becuse the "SQL server job log" is full. apparently this is causing notifications to stop being sent. My question is how do I delete all sql server job logs. I also find this error strange because there is plenty of disk space, which make...more >>

Join on a Like field?
Posted by Justin Drennan at 9/13/2004 2:58:50 PM
I have 2 tables. One of the fields in the second table needs to be linked to the first table, using the 'like' operator Table1 ------- Name, Description Table2 ------- Description, Price The description in table 1, must be 'like' that in table2. Is there a way to do this? ...more >>

Copying objects and data fails on relationships (I think)
Posted by RobGT at 9/13/2004 2:49:25 PM
Hi, I have an SQL Server 2000 database with several tables, views and SPs that need to be copied to new databases on semi-regular occasions (copying the structure and data of one "master" database to another) The problem I have is, for reasons unknown to me, the copy always fails at around...more >>

Duplicate column DTS error
Posted by Steve W at 9/13/2004 2:35:49 PM
I'm trying to find duplicates between a temp table and a live table. If there are, it creates an error and emails an attachment that reports which record(s) were duplicated. I have a data transformation step that uses this T-SQL: SELECT * FROM temp_lifting LEFT JOIN lifting ON temp_lifting....more >>

what's wrong w/ my queries?
Posted by John at 9/13/2004 2:24:01 PM
select a.*,b.* into New_MPWORK from MPWork as a, TestData as b Behold the above query! Simplistic, no? When run using the two small tables above, the query runs for well over an hour and consumes gigabytes of server space... Far, far more than both tables combined. What gives? What am I doi...more >>

Ouput Format
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 9/13/2004 1:46:15 PM
When I run the query below I get the following output: PostFICO_Score 627.0000000000000000000 I want to output to look like this: PostFICO_Score 627 Please help.. Query: SELECT ((CONVERT(numeric(18, 0), PostFICO_v)) / (CONVERT(numeric (18, 0), PostFICO_n)) )as PostFico_Score ...more >>

Best way to search database table - parsing?
Posted by Harjinder Singh at 9/13/2004 1:35:57 PM
does anyone have an optmized method of searching a database or database table? I've already done an index on my table with all possible columns and have no difficulties doing one word searches using: CREATE PROCEDURE [dbo].[spSearchDatabase] @search VARCHAR(50) AS SELECT jobid FROM ...more >>

Space for My MetaInfo?
Posted by localhost at 9/13/2004 1:29:22 PM
Ihave created a (non-temp) table with a single column. I would like to annotate this column so the DBA after me knows exactly what "ColGrtRte" is used for. Are there any INFORMATION_SCHEMA columns I can hijack, or a reasonable equivalent? I don't want to make an entirely new table if I can ...more >>

Choosing Primary Key
Posted by Aaron Prohaska at 9/13/2004 1:16:44 PM
I am trying to figure out what to use for a primary key in a products table and need some advice. At the moment there isn't any single column that distinctly identifies a product/Item in the system. What I would like to find is a way to identify a unique product in the system with a single c...more >>

Create SQL Database or Tables in SQL Database using VB.net
Posted by Peter at 9/13/2004 1:08:55 PM
Hello£¬everyone, My program will collect a testing machine's data ,save the data and deal with the data everyday. I want to use vb.net to create database, add and delete tables or modify the records in the database. Is it possible to create a SQL Server database using vb.net? I know I can ...more >>

Trigger Accuracy?
Posted by don larry at 9/13/2004 1:08:50 PM
Greetings, I have a Trigger that runs and updates a date field. It's accurate 98% of the time. Is it possible that something in SQL Server would prevent a trigger from being accurate 100% of the time? Maybe a system issue? Here's the syntax: ----------------------------- Create TRIGGER trg...more >>

The table design returned from the stored procedure
Posted by psd at 9/13/2004 1:03:39 PM
Hi, is there a way that I can learn the table design (DDL) of the output table of a stored procedure? The procedure only returns one recordset. psd...more >>

ADO Data Control 6.0 (OLEDB)
Posted by Just D. at 9/13/2004 12:45:37 PM
The problem occurred with this control. ADO Data Control 6.0 (OLEDB) MSADODC.ocx 6.00.8171 L,P,E This is one of the fileVB6.0 ships with. I am able to work with the control in design mode, (connection string setup and database table selection works) but at run time the control is d...more >>

Using Triggers
Posted by Oded Kovach at 9/13/2004 12:19:15 PM
Hello there I have a table that i would like to have a huge history of the table: when i add new record the entire records that was before should be saved and the same for update and delete for this i'm tried to use the trigger FOR INSERT, UPDATE, DELETE and working with the table But...more >>

Weird Cast operator
Posted by ganesanrajaraman NO[at]SPAM gmail.com at 9/13/2004 12:19:11 PM
In the following examples, why the first case statement works and why the second doesn't, I wonder. Could anyone shed some light on this? Thanks, Ganesh -- this is an attempt to: -- Remove leading zeroes if @in is all numeric -- return same value, if not all numeric dec...more >>

Need help with a query
Posted by AMD Desktop at 9/13/2004 12:02:59 PM
Here is the table: CREATE TABLE [EmployeeOBenefitApproved] ( [emp_obenefit_id] [int] IDENTITY (1, 1) NOT NULL , [empplan_id] [int] NOT NULL , [obenefit_id] [int] NOT NULL , [cost_per_month] [float] NOT NULL CONSTRAINT [DF_EmployeeOBenefitApproved_cost_per_month] DEFAULT (0), [coverage_st...more >>

User ID Address?
Posted by Radovan Dobriæ at 9/13/2004 12:00:58 PM
Hi, I know that I can get client name (SUSER_SNAME), client host (HOST_NAME), but can I get Client IP address? Thanks in advance Radovan ...more >>

how to set sql2000/ado(vb) to notify when recordset changed (insert,update)
Posted by SÁRINGER Zoltán at 9/13/2004 11:51:38 AM
Hello experts! sql2000,vb,ado2.8 I want to notify the user about recordset changed while he is browsing the recordset. How can I do this? i know, one way is to create a second recordset, requery regularly, and watch the differences..., but i assume, there are automatism in sql2000 to do th...more >>

selecting different columns in where clause depeding on parameter
Posted by Harjinder Singh at 9/13/2004 11:35:45 AM
does anyone know a simpler way of writing a select statement where we filter using a different column depending on what the parameter passed into the stored procedure. For Example: CREATE PROCEDURE [dbo].[spSelectJobInfo] @condition INT AS IF @condition=1 SELECT * FROM JOBS WHE...more >>

Prevent deadlock in select
Posted by Kristoffer Persson at 9/13/2004 11:31:18 AM
I have an "inner join" select statement that is part of a deadlock situation. It seems to me as the tables in the select statement are locked one by one as the select statement is processed. And between these locks, another process is inserting/updating the tables in reverse order, cusing the de...more >>

Sloww Query (performance)
Posted by desechable1 NO[at]SPAM yahoo.com at 9/13/2004 11:28:12 AM
Howdy, First of all thanks in advance, I'm runnig SQL 2000 from my desktop I've created a table that I use for reporting purposes sysfact_temp. This table is created via a series of SQL statements. Once created, there are around 15000 rows and 20 fields. The second ].[dbo].[CXMSShip_Fact Vi...more >>

24/7 Database
Posted by Justin Drennan at 9/13/2004 11:16:50 AM
Hi Guys, I've got a bit of an issue with a database / Server. Its a server which needs to be up 24/7 and the SAN for the Databse is about 2.7TB. Basically lots of transactions going through the database every day. How would I go about indexing/tuning the database, while people need 24/7 con...more >>

Image value column question
Posted by canaries at 9/13/2004 11:07:41 AM
I have a table that has a column defined as 'image' with the text in row option set to ON where the value is in the data row. The table is growing to fast, and I want to change the text in row option to OFF to allow a pointer in the data row instead of the value. What is the process fo...more >>

Query to find overlapped dates
Posted by Craig Kenisston at 9/13/2004 10:51:15 AM
Hi, I have a table in which I store an attribute for a given record over a period of time. It has an effective date and ending date. When the attribute change, I insert a new record on the table and enter the range of dates to which this is effective. I have like 1,000,000 records on the or...more >>

simple question
Posted by John at 9/13/2004 10:46:30 AM
I have to perform a full outer join on two massive tables using query analyzer. Since the server consistantly bombs out each time I try, I decided to create one index on each table, as supposedly this will speed up the process, and decrease the overhead processing. However, how do I write the co...more >>

Select? but how?
Posted by Jan Schmidt at 9/13/2004 10:38:59 AM
Hi, i try to select users from a specific table and for each user i want to do something, so: [code] select UserName from UserTable where fragen_flag=1; -- for each user do -- select something... [/code] howto realize that? i tried while structure, but it seams not to be ...more >>

sp_who2
Posted by SQL Apprentice at 9/13/2004 10:37:44 AM
Hello, is there a way to sort sp_who2 results by DatabaseName? Any suggestions? Thanks, ...more >>

Using CASE for a dynamic "WHERE fld IN" ??
Posted by A Traveler at 9/13/2004 10:14:37 AM
Hello, I am trying to write a dynamic where clause without DynSQL. I found a great example showing how to do this using CASE to switch on a value (and a COALESCE too). The examples ive found are for single values. Follows one of them (@LastName is a param to the sproc this is in)... select...more >>

Managing Release Compatibility
Posted by Brian Denomey at 9/13/2004 9:55:52 AM
I have been tasked with the responsibility of managing "Release Compatibility" of our products with Microsoft products. Basically, it is my job to make sure that we keep a detailed list of which of our products work with which of Microsofts products. This includes not only different versio...more >>

Security approach
Posted by Vlad at 9/13/2004 9:10:34 AM
I'm new to this area. Now my VB6 application uses ADODB DSN-less connection with a single password and user name for any user (users do not know these values. It's hardcoded stuff). Then I'm requesting a list of user names and passwords from SQL Server table. User is asked to enter her name and ...more >>

Removing all users programmatically from a SQL database.
Posted by ancient_skyman NO[at]SPAM hotmail.com at 9/13/2004 6:24:00 AM
I've been tasked with creating a method for performing database transfers from production to development . . . it seems many changes happen on the live server, for whatever reason, and we need to periodically back-up and restore Production onto Development. Problem is, the production database ...more >>

Transaction around a SELECT statement
Posted by Rachel K at 9/13/2004 6:09:16 AM
I am working with several developers who feel that it is necessary to use a transaction around a select statement in order to prevent 'dirty reads'. I believe this is handled with the isolation level, but that a transaction around a select is unnessecary. Anyone have any thoughts or proo...more >>

Autonumbering in a VIEW
Posted by Brandon Campbell at 9/13/2004 5:57:03 AM
Hello, I have a VIEW with two autonumber fields. The autonumbering works correctly. However, I needed to add a trigger to the view; therefore, I added the option WITH VIEW_METADATA. This forced the trigger to look at the VIEW's metadata instead of the underlying tables metadata. The problem...more >>

deploy on second machine
Posted by C Williams at 9/13/2004 4:17:09 AM
Hi, I am quite new to Sql Server and am using 2000. I have written a fairly simple collection of stored procedures and views that I would like to deploy on a client's Sql Server. In other words, the client has the necessary data already, and my code provides some functionality. The cli...more >>

Ordinal Position
Posted by x-rays at 9/13/2004 3:55:54 AM
Hello Experts, Is there any stored procedure or something, that can change the ordinal position of a column in a table programmaticaly (T-SQL maybe)? Thanks in advance...more >>

Identity col as primary key
Posted by Satya at 9/13/2004 2:57:04 AM
hi, there are 275 tables in the database. I want to list out all the tables who are having identity col as primary key. please suggest me a script for this -- Satya Rao ...more >>

Checking state of Sql Server without permission
Posted by pnmm NO[at]SPAM portugalmail.pt at 9/13/2004 2:41:11 AM
Hi all; Hope someone has the rith answer for this; I have one windows app written in vb.net and i'm using SQLDMO to check if my Sql Server is running. I don't have any troubles when connected to my local DB (MSDE) for checking the state of Sql Server, but when i try do it on my remote Sql S...more >>

using table datatype..
Posted by Nataraj at 9/13/2004 2:31:04 AM
Hi, Can any of you help me with examples in using the table datatype in SQL Server 2000. I am trying to take the output of a stored procedure, into a variable of type table. I tried Books Online but it does not seem to help me :-( Thanks in Advance, Nataraj...more >>

xp_cmdshell
Posted by Mahesh at 9/13/2004 12:39:59 AM
How can i run window programs through xp_cmdshell eg calc program. which requires user intervention. if i use execute master..xp_cmdshell 'calc' this is hanging ... Thanks and Regards Mahesh...more >>


DevelopmentNow Blog