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 > january 2005 > threads for monday january 10

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

BULK INSERT
Posted by David Mohandas at 1/10/2005 11:19:44 PM
I am trying to run a simple bulk insert command it says it has completed successfully, but no data gets inserted. Even if i give a bad filename, which does not exist it still says command completed successfully. If i run the same command on a different machine with a different instance of SQL se...more >>


Trigger/Foreign Key limitation for real?
Posted by Gary K at 1/10/2005 8:41:04 PM
I'm aware that the documentation says that you cannot create an INSTEAD OF DELETE/UPDATE trigger on a table with a cascade update/delete relationship defined. I have even tested this out using the enterprise manager & yes, you get big error messages when you try. However, it was during this t...more >>

Preventing a stored procedure to return result set
Posted by Tümay Tuzcu at 1/10/2005 8:35:13 PM
I have two stored procedures like procA,procB where procN return results as OUTPUT parameters In procA i have called procB and generate some custom table to return to user But in procB i used some SELECT statements to process data I want to prevent procB to return Result set... Is there and ...more >>

T-SQL script write to text file
Posted by Sa at 1/10/2005 6:43:00 PM
Hello, In a T-SQL Script, is it possible to write some text into a text file? If so, may I know how to do it? Thanks a lot. Sa ...more >>

Week and Day function question
Posted by David C at 1/10/2005 5:51:02 PM
Hi All, Quick question - when using the week function in analyser e.g { fn WEEK(On_Sales_Date) }, why would the 6/1/04 (6/Jan/04) be coming up as week 2. I thought it would have come up as week 1. Any ideas? Cheers David...more >>

Rule or check
Posted by aleblack at 1/10/2005 5:25:30 PM
I have one tabel, with 2 columns , named cust and price, i need to make a check or rule ( i dont know ), for block if the price is minor than 50 % of cust, sample Cust Increment(50%) Price 1 0,5 1,5 2 1 ...more >>

Conditional Join?
Posted by Brian at 1/10/2005 4:42:19 PM
I currently have a stored proc that is dynamic. I build it up based in a variety of variables passed in. I would like to move away from this if possible. I have one sticking point, I have a series of statements like this if @language_id <> 'NA' BEGIN set @joins = @joins+' JOIN c_langua...more >>

dbopen() returning NULL
Posted by Per Thygesen at 1/10/2005 4:16:54 PM
The DB-library function dbopen() is returning null. When running as a Domain user (SAM) or Workgroup, dbopen() is working just fine. When running as a Domain user in an active directory, dbopen() is also working fine - as long as the user is connected to the active directory. When the user ...more >>



Cross tabs without aggregating
Posted by Philip Poole at 1/10/2005 4:09:56 PM
Hello everyone, I am looking for a way to create a cross tab table ( or at least I think its a cross tab tables) however I do not want to too sum the values fro each column up. To explain: I have a table called data whocjh consist sof the following columns. series_code series_data re...more >>

order
Posted by ls_y041 at 1/10/2005 3:59:37 PM
1+A+1 ²Öλ 1+A+2 1+A+1 1+A+3 1+A+2 1+A+4 1+A+3 1+B+1 1+A+4 1+B+2 1+B+1 10+A+1 1+B+2 10-B-1 2-A-1 10-B-2 2-A-2 10-B-3 2-A-3 10-B-4 2-A-4 10-C-1 2-A-5 10-C-2 ...more >>

SQL and XML
Posted by Khurram Chaudhary at 1/10/2005 3:52:30 PM
Hi Everyone, I have the following XML data coming from a VB app and want to pass it to a SQL stored proc which will intern INSERT certain data it into a table. Can someone tell me how to do it? I can't seem to get it. I'm using SQL 2000 with SP3. XML Data <?xml version="1.0" encoding="UT...more >>

Getting rid of cursors to help with performance
Posted by Kevin Munro at 1/10/2005 3:51:45 PM
Hello, I've been in and out of this ng for a while and I've read that you should really get rid of cursors to increase performance. Well, I'm in a bit of a pickle with this stored procedure and function and wonder if anyone can help me out! My database has a million records scattered over ...more >>

Distinct SQL Statement's problem?
Posted by norton at 1/10/2005 3:17:27 PM
Hi, I am writing a SQL statement which is trying to get the latest record for Each product However, i don't want to use Cursor / Fetch Next method to do so Is there any other ways to write that statmenet? Here are the datatable and my desired result [ContentTable] Type Content ...more >>

How do I make columns into rows?
Posted by rvantol NO[at]SPAM webfront.net at 1/10/2005 3:17:24 PM
I have a data table that looks like this: key f_1 d_1 f_2 d_2 f_3 d_3 ----------------------------------------- 1 da1 zb1 dc1 zd1 de1 zf1 2 da2 zb2 dc2 zd2 de2 zf2 3 da3 zb3 dc3 zd3 de3 zf3 I need it to look like: Key f_Name ...more >>

Check Job-Status
Posted by Re Fo at 1/10/2005 2:48:06 PM
Hi NG, I defined a database maintenance task as a job. The job will normally be executed by the SQL-Server according it's schedule. Furthermore I'd like to start the job on demand. Before I execute my job with EXEC msdb..sp_start_job @job_name='my_job_name' I have to check if it is already ...more >>

dbcc showcontig
Posted by UNOTech at 1/10/2005 2:15:03 PM
I am going to make a cursor that runs a reindex based on certain fields in the dbcc showcontig return. I need to know if there is a way to get the query that runs the dbcc showcontig procedure where i can pull certain records and do a where clause based them. thanks in advance...more >>

fulltextindex
Posted by Rafael Chemtob at 1/10/2005 12:54:08 PM
In my search feature on my site, I placed all product names, UPCs, Manufacturer, etc separated by a pipe (" | ") into one field in a table. the table has the fields (product ID, searchText - which contains the info above). now, when I do a search for "digital camera", SELECT TOP 100 tbl_searc...more >>

DeleteAllowed stored proc.
Posted by virgusha at 1/10/2005 12:49:44 PM
Hi, I'm thinking of stored procedure, which is called from client application and user interface allows/dissalows deletion of records loaded onto form if references to the table exist. Database records have unique ID; so parameters for this procedure might be targetTable and uniqueID. A...more >>

Simple SQL task
Posted by robert.yung NO[at]SPAM l-3com.com at 1/10/2005 12:36:50 PM
Hi everyone, Im a newbie at SQL programming, so please bear with me. I have a table with multiple fields, one of which is the "EmailAdress" field. The current format of this varchar field is %lastname%.%firstname%@%domain% I need to write a function/stored proc/query to convert this fie...more >>

How to write query for full-text search on multiple tables?
Posted by Do Quyet Tien at 1/10/2005 12:36:45 PM
Hi, How do I write query for full-text search from multiple tables (which full-text index enabled)? Thanks, ...more >>

Need to understand the code
Posted by Nitin at 1/10/2005 12:31:05 PM
All, Here is the UDF code that basically returns the concatenated version of a column based on some recurrence of data column. I need some help in understanding the UPDATE part of the code. I dont see any column name (only variable name @r) in the update command and yet the code works. ...more >>

Update Performance
Posted by Brian Linden at 1/10/2005 12:12:34 PM
I have a stored procedure that is executed on every web request that we get. On the web server, I get about 50 Requests a second. After looking into the bad performance I narrowed it down to my update statement in my stored proc: Update tblStats set counter = counter + 1 Where id = @id If I...more >>

How to determine Authentication Mode?
Posted by Hal Heinrich at 1/10/2005 11:55:01 AM
Given a server name, how can I tell if it's using Windows Authentication Mode or SQL Server Authentication? I'm retreiving a list of servers as follows: Dim dmoApp As SQLDMO.Application, dmoServerList As SQLDMO.NameList, srvrNm As String dmoApp = New SQLDMO.Application dmoServerList = dmoA...more >>

Yes/No insted of True/False
Posted by Otto Miros at 1/10/2005 11:50:15 AM
Hi, my select statement (select tib from table1) returns true or false. tib is a bit value. Can I modify the select statement, so that the return values are Yes or No, or something like value1 or value2. Thanks Otto ...more >>

query for calendar app
Posted by bighead at 1/10/2005 11:13:04 AM
Hi all, I have a table that holds calendar info with these fields: id, username, date, description. //fieldnames and some sample data looks like: 1, 1, '01/01/2005', 'task1' 2, 1, '01/02/2005', 'task2' 3, 1, '01/03/2005', 'task3' 4, 1, '01/04/2005', 'task4' 5, 2, '01/01/2005', 'jane1' e...more >>

Dynamically creating columns
Posted by Schoo at 1/10/2005 11:09:36 AM
[SQL 2000, writing Tran-SQL]: I have an appliation where I need to create columns in a temp table dynamically. The code is supposed to scroll through #tempA and create columns in #tempB for every record it finds in #tempA. I can't get the alter statement to work when I try to add the column to...more >>

limit records
Posted by Jason at 1/10/2005 10:52:48 AM
Hi, How can i limit records on insert? I have a table where i store different type of forms. Each type of form has a max for inserting data. The table definition looks like this: CREATE TABLE FORMS ( form_Id int identity(1,1) Primary Key, main_Id int not null, form_type int not null, ...more >>

Management Studio 2005
Posted by Justin at 1/10/2005 10:42:40 AM
Hi Guys, I've installed 2005 Management Studio, and would like to know where I could get more information regarding the user interface, and new featuers? Where would be a good place to start? Thanks, Justin ...more >>

UPDATE & CASE statement order
Posted by aamirghanchi NO[at]SPAM yahoo.com at 1/10/2005 10:38:07 AM
Hi, If anyone knows: what is the order in which the Update and Case statement work together when they modify data. Will it be the order in which the WHEN <expr> are listed OR will it be the order in which the rows are listed based on their position inthe table/index. For e.g. in the followi...more >>

udf in computed column
Posted by CJR at 1/10/2005 10:10:53 AM
Can anyone please advise if there are any obvious problems with the udfGetWorkingDays function and its use in the computed column in the AbsenceDetails table? thanks IF EXISTS ( SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[EmployeeTypes]') AND OBJECTPROPERTY...more >>

Automatically Create Linked Server?
Posted by Torquin at 1/10/2005 10:07:22 AM
I am trying to automatically create linked servers, then extract the DB names from them and delete the linked server. This is for an inventory program I am writing to keep info on all of our SQL Server up to date. The problem I run into is the linked server procedure, even when run with Exec(), ...more >>

Need help with Function declaration syntax!
Posted by stephen.accetta NO[at]SPAM honeywell.com at 1/10/2005 10:07:01 AM
I'm trying to create the following function to return a string based on an input string in a complex IF ELSE statement CREATE FUNCTION Describe (@Data varchar(32)) RETURNS @Description varchar(50) -- Description AS BEGIN if SubString(@Data, 0, 5) = "*0020" select @Description = "Nor...more >>

Best way to implement this kind of a matching?
Posted by KK at 1/10/2005 9:18:25 AM
Hi This is a question about "best implementation" option(s) The problem is basicaly a matching service. For example, like in most online dating services. Now, when a male searches for his criteria there will be some results. However, each of the result (female) in turn have their own pr...more >>

Datatype for storing serialized class instance in database
Posted by Mark at 1/10/2005 8:56:26 AM
What datatype should be used for storing a serialized .NET class instance in a SQL Server 2000 database? For what it is worth, assume the class has 8 fields, 8 properties and 5 methods. Data stored in the class is typically integers and short strings. Thanks in advance. Mark ...more >>

Returning a concatenated string
Posted by Jim Corey at 1/10/2005 8:49:11 AM
Let's say I'm in the Northwind database and I do this: select regiondescription,territorydescription from region r, join territories t on r.regionid = t.regionid I will get results like: ---------------- Eastern Westboro Eastern Bedford ......more >>

Composite Key History Table
Posted by DatabaseBob at 1/10/2005 8:19:02 AM
I have two tables, ClientDataStore and AcctStatusHist. Here are abbreviated column lists: ClientDataStore AcctNum char(26), ClientID char(2)... these two columns are a composite PK for the table. AcctStatusHist StatusRecID int identity (1, 1), AcctNum char(26), ClientID char(2), Stat...more >>

date variable in a DTS package
Posted by Ryan at 1/10/2005 7:17:09 AM
I have some sql in a DTS package and one of the fields gets updated with a date variable that is based on a calculation...the problem is that the package will only run fine on any computer that has a local SQLserver on the specific machine...For some reason it will not work on any machine that...more >>

Missing Data problem
Posted by Asim at 1/10/2005 5:23:04 AM
I have a table with provider names and their primary locations (dictionary) and another table with transactions like discharge date and patient account numbers. There is a report(SQL Server Reporting Services) which displays the number of patients seen by each provider in a pivot table for...more >>

How to calculate time in scheduled jobs
Posted by R.D at 1/10/2005 3:33:03 AM
Hi If i configure a job to be executed for every sixmonths on the first and Iam starting job on 1st of jan( that is ,it should be executed every year 1st jan and 1july), will it fire on 1st july or 1st agust i:e DATEADD(MONTH,6,01-01-2005) WILL BE 07-01-2005 - MDY R.D...more >>

Sp_addlinkedserver - specify password
Posted by Mal at 1/10/2005 1:29:01 AM
Hi My problem is a simple one. I build up a connection string for linkedserver but it won't work. EXEC sp_addlinkedserver @server = 'MYSERVER', @provider = 'MSDASQL', @provstr = 'DRIVER=SQL Server;SERVER=MYSERVER;UID=sa;PWD=pass;'...more >>

time format
Posted by Tom at 1/10/2005 12:51:35 AM
Hi i want to convert myDateTime to an hour string in the right format so 00 and not 0 when hours = 0, this does not work: select Convert(nvarchar(50),DatePart(hh, myDateTime),'00') from ... any ideas? thanks Ch Tom ...more >>


DevelopmentNow Blog