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 > july 2006 > threads for wednesday july 12

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

Executing DTS package as Other Loggin
Posted by Carl at 7/12/2006 11:11:50 PM
I'm trying to have a DTS package execute by the SQL server agent (ie on a schedule). The package executes fine when I manually run it from Enterprise Manager but fails when scheduled. The latest schedule history is: "Executed as user: ATEA\SQLExec. ... OnStart: Drop table Results Step DTSR...more >>


tricky query?
Posted by Lisa Pearlson at 7/12/2006 11:03:54 PM
Hi, Imagine I have 2 different tables, keeping a log of additions of items to some container, and another that keeps a log of when those containers were emptied. For example, simplified: CREATE TABLE additions ( logdatetime DATETIME NOT NULL, boxnumber INT NOT NULL ); CREATE TABLE...more >>

3 most-recent contact dates
Posted by Jim at 7/12/2006 8:34:44 PM
I need to show the 3 most-recent contact dates by our sales staff for each customer. I have a table that includes custid, custname, and contactdate - each row representing one contact with a customer. I need to generate a query to show: custid, custname, date1, date2, date3 where date1, ...more >>

nested insert
Posted by Howard at 7/12/2006 6:04:17 PM
I have 2 tables Table BOOKS with columns BOOK_ID(key), BOOK_NAME Table CHAPTERS with columns CHAPTER_ID(key), BOOK_ID, CHAPTER_NAME the BOOK_ID column in both tables are related my program assumes a new book has at most 1 chapter when I insert a new book I need to do 3 queries - ...more >>

Acess denied with Backup database
Posted by Richard Mueller at 7/12/2006 5:08:23 PM
I can connect and use the SQL Server database, but get errors when I attempt to backup to a unc path on the network. I can backup to a local folder. The SQL statement is: BACKUP DATABASE Mydatabase TO DISK='\\MyServer\MyShare\backup\dbbackup.bak' WITH DESCRIPTION='test' The error in the ...more >>

Store Procedure in Store Procedure
Posted by Alper Özgür at 7/12/2006 4:19:57 PM
Hi; How can i call a store procedure within another store procedure with parameters? ...more >>

column access logging
Posted by Nemo at 7/12/2006 2:54:40 PM
Hi, How can I log every activities from a table based on the colum level? For example, Employee table with columns: name, orgnization, salary and SSN, I don't care who access name and orgnization column, but I need to log who had accessed salary and SSN. Let's say we use windows authenti...more >>

Timestamp in User-Defined Function Causes Error
Posted by Emily at 7/12/2006 2:30:38 PM
Hi All, I've created a user-defined function as below: Create FUNCTION dbo.FnReportInstancesGet @AfterTimestamp timestamp = null output, @MailingNameFilter DTTypeNameLong = '%', @ReportEntityFilter varchar(50) = '%', @AccountIDFilter int = null, @StatusMessageFilter varchar(255) =...more >>



Application Role vs One SQL Login
Posted by Mike at 7/12/2006 2:18:29 PM
What are the advantages of using an Application Role instead of a single SQL Server login account? I'm new to the concept of Application Roles, but it seems to me like they would be functionally equivalent to having a single SQL login that my application uses to connect to the database. With an ...more >>

local time function
Posted by Himanshu at 7/12/2006 2:11:01 PM
Is there a function in SQL Server that'll tell us what the local time in a certain time zone is? Basically, we have replication to London, and they want to modify the date columns to local UK time....more >>

Year earlier than 1753
Posted by Nemo at 7/12/2006 1:29:52 PM
Hi, I have a store procedure accept an datetime varible from ASP.NET. When user input an datetime value earlier than year 1753. I got an err: "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value." For example, user input 05/04/1001, which ...more >>

Year less than 1753
Posted by hope at 7/12/2006 1:15:17 PM
Hi, I have a store procedure accept an datetime varible from ASP.NET. When user input an datetime value earlier than year 1753. I got an err: "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value." For example, user input 05/04/1001, which i...more >>

create PIPE delimited file from T-SQL
Posted by mdscorp at 7/12/2006 12:59:57 PM
I am in need to run a stored procedure on a nightly basis and create an ascii pipe delimited formatted file. I tried already xp_cmdshell to create the file from my queries but I get en error. for example if I write this format: SET @cmd = 'echo ' + @req_id + ',' + @patient_fname + ',' + @date...more >>

Like Comparison
Posted by Chris at 7/12/2006 12:54:03 PM
I need to use a list of characters in my where clause. I only need to compare the first 3 characters of the number. I keep getting 0 results when using the below sql statement. I tried like but it only wants to use one of the numbers in the list. Select '06/01/2006' , 'Active' , Count(A...more >>

newID default value not working using XML Bulk Upload 3.0
Posted by zsmith at 7/12/2006 12:27:02 PM
I am using the SQLXMLBulkLoad.SQLXMLBulkload.3.0 object to load XML into SQL2000 tables. The tables have GUID keys. I am populating parent-child relationships and need to get a GUID while populating the catalog table and use it to populate the CatalogID FK on the Product table. I found ...more >>

RTRIM ?
Posted by Patrice at 7/12/2006 11:57:22 AM
Hello, I need to join two tables on a text field that is an unlimited amount of characters in one table and truncated to 10 characters in the other table. Should I use the RTRIM function? e.g.: where (b.crtd_user = rtrim(d.[user_id]) or b.crtd_user = d.employee) Thanks!...more >>

security strategies
Posted by bringmewater NO[at]SPAM gmail.com at 7/12/2006 10:42:24 AM
I'm using "sa" authentication on my servers. Is there anywhere that tells me best practices for security. Like, should I rename the sa account? thanks ...more >>

Connection Time Out Issue
Posted by D at 7/12/2006 10:39:44 AM
Hello all - One of my views is constantly timing out. I have tried various fixes, some that were recommended on the net, and none have resolved my problem. Here is my code for the view, not sure where/why it is timing out - this has worked for over 2 years now without any concerns SELE...more >>

How to sp_addExtendedProperty for a login?
Posted by BF at 7/12/2006 10:34:02 AM
I can add extended property for database users. But when I try to add extended property for a login like this: exec sp_addExtendedProperty 'MS_DESCRIPTION', 'test desc', 'login', SomeUser I got some error message. Does anybody know how to add extended property for a login? Thanks a lot...more >>

How To Change Default File Location
Posted by Jeremy at 7/12/2006 9:19:10 AM
I'm using SQL Server 2005 Pro and I've been poking around Management Studio trying to figure out how to change the deafult location in which new databases are created (.MDF and .LDF files). How can I do that? Thanks! ...more >>

How can I find names of columns with triggers?
Posted by dj at 7/12/2006 9:08:01 AM
I need to list the names of all columns with triggers defined in a given database. I'm poking around the new Catalog views in 2005, and can find the names of the tables with triggers and the names of the triggers easy enough: SELECT t.name AS Table_Name, tr.name AS Trigger_Name, te.ty...more >>

Backup Restore DB ?
Posted by bringmewater NO[at]SPAM gmail.com at 7/12/2006 8:13:33 AM
Is there an easy way to backup the entire database so restore will take into account dependencies in the proper order? I want one strategy that gets the db and data and a second strategy that does not get that data, only the structure. Thanks ...more >>

Dymanic vs Static Columns
Posted by Faye at 7/12/2006 7:54:49 AM
This query displays data in a crosstab table by joining itself. It works fine. My question is, what do I need to do to make it dynamic. How do I change the query so that the columns for C02A, C02B, E010, C101 and etc. will display based on what is available instead of hardcoding. SELECT LN_NR...more >>

Query abt Srvc Broker Sample HelloWorld_CLR
Posted by Mana at 7/12/2006 6:16:05 AM
HelloWorld_CLR is the sample provided by Microsoft with SQL Server 2005. There is a method called SayHello in HelloWorldService. I could not find any reference to it. But if i write some code in it it gets executed. Any idea from where this method is getting called??? Mana ...more >>

Query on EXECUTE sp_executesql
Posted by JP at 7/12/2006 6:12:02 AM
Hi The input variable values in the following code (@TABLE_NAME ,@S_ID_VAL) is not getting set for the query. I get an error select @min_val2=min(id),@max_val2=max(id) from @TABLE_NAME where schema_id = @S_ID_VAL and status = 0 Msg 1087, Level 15, State 2, Line 1 Must declare the table ...more >>

Query on EXECUTE sp_executesql
Posted by JP at 7/12/2006 5:20:02 AM
Hi I am suppose to get the maximum and the minimum values in the variables @max_val2 and @min_val2 but instead i am not getting any values printed except the query(SQL_TEXT) DECLARE @SQL_TEXT nvarchar(2000), @TABLE_NAME nvarchar(200), @min_val2 numeric(10), @max_val2 numeric(10), SET...more >>

help with update statement
Posted by jack NO[at]SPAM yahoo.com) at 7/12/2006 2:36:15 AM
for each record returned in this select statement I want to update a column x in table tOrderHeader to 'SL' SELECT tOrderDetail.ID, COUNT(DISTINCT tOrderDetail.PCN) AS cnt FROM tOrderHeader INNER JOIN tOrderDetail ON dbo.tOrderDetail.ID = dbo.tOrderHeader.hKey WHERE ...more >>

Problem with local variables, stored procedures and multiple datab
Posted by Henning Kristensen at 7/12/2006 1:11:02 AM
Hi, Thank you for taking the time to look at this problem :o) I have been tasked with the job of automating some of our monitoring/survailence jobs and have run into some troubled waters, hopefully someone can supply me with the piece of information I need to either scrap it all or get o...more >>

help with update trigger
Posted by Chris at 7/12/2006 12:55:02 AM
Hi, Most of the trigger samples I have seen only have insert. I have the following 2 tables TABLE1 COL1 COL2 1 5 2 4 TABLE2 COL1 COL2 COL3 1 5 TEST 2 4 TEST2 How can I create a trigger on table 1 so that when ...more >>

Parsing Query
Posted by Leila at 7/12/2006 12:51:46 AM
Hi, If you type "select * from orders" in QA and only parse it (while Orders table does not exist) using ctrl+F5, you get no error. But this way: set parseonly on select * from orders set parseonly off Error occurs indicating that Orders is invalid object! I expected to get no error even ...more >>

Parsing Query
Posted by Leila at 7/12/2006 12:48:51 AM
Hi, If you type "select * from orders" in QA and only parse it (while Orders table does not exist), you get no error. But this way: set parseonly on select * from orders set parseonly off Error occurs indicating that Orders is invalid object! I need some clarifications. Thanks in advanc...more >>

Sample deployment script
Posted by lara169 at 7/12/2006 12:00:00 AM
Hi, Can anyone give me a sample deployment script /********************************************************************* HEADER - DESCRIPTION AND COMMENTS *********************************************************************/ /* QA REQUEST : CREATED BY CREATED DATE : SCRIPTE...more >>

which one is more efficient
Posted by VSS at 7/12/2006 12:00:00 AM
One of my field is having 3 values: H,F,Y If I say in a query that : 1st case: field = 'H' or Field='F' 2nd case : field <> 'Y' Which of the above case is more efficeient and why? ...more >>

add field query problem
Posted by Mr. Newbie at 7/12/2006 12:00:00 AM
i would like to know if there is a way how to query a table and add some fields with data filled in without really adding those fields into the table structure? for example: <prodCode> <prodDesc> <prodPrice> <prodDateMfg> <prodDateExp> 01AB MyProduct1 5.25 200601...more >>

Synchonization of an application an a SQL Server
Posted by Samuel at 7/12/2006 12:00:00 AM
Hello, I would like to know if it's possible to make both application and SQL server synchronize. I develop: In a normal application, you make the connexion with the database, use data from database but when you want to update your data, you must ask another time the data from...more >>

How to preserve the character '0' from the sql server?
Posted by PenguinPig at 7/12/2006 12:00:00 AM
I am try to write an query to retrieve several records from the database and run on QueryAnalyst However, when I Save the result, or copy the result, from the Query Analyst, and pasted in Excel The character '0' is missed if it occurred in the first character of string... Any solution? ...more >>


DevelopmentNow Blog