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 > november 2003 > threads for tuesday november 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

Performance in SQL Server instructions...
Posted by Frank Dulk at 11/4/2003 11:01:47 PM
Am I with a doubt... as I should define the clause where and from of my select so that her (the query) is it more optimized?! In the from I am accustomed to place the first larger tables (from top to bottom) and in the where I always place the most restrictive termses in the end. Of the left f...more >>


Why we use application role?
Posted by Krygim at 11/4/2003 10:25:18 PM
I create an "application user account" for my application to connects to a database. Security settings are controlled by right settings of this application user account. No other user (except my application) will use this account. I don't see any need to create an application role. Can anybody t...more >>

View and Performance
Posted by Wade Coonrod at 11/4/2003 9:24:30 PM
A question about performance... I am on a project where our DA would like to create views for the tables in one DB and have them reside in another. The views are just of the "select *" nature. The reason for this is so that we would only need to access one database. I am interested in th...more >>

How to use a Table Name in a Variable
Posted by Jon Spartan at 11/4/2003 9:01:07 PM
I was wondering how to use a Table Name in a variable ? I would like to do something such as - SELECT xxx,yyyy FROM (Tablename Variable ) WHERE (conditions) I have tried to set the table name as @TableName and do the above as - SELECT xxx,yyyy FROM (@Tablename ) WHERE (conditions) an...more >>

Pivot Table
Posted by rictonline NO[at]SPAM yahoo.com at 11/4/2003 8:02:24 PM
Hi, I'm quite confused on how to deal with this. For instance, I have this two tables namely: IdMaster & IdCategory. Each record in IdMaster has a corresponding IdCategory but the problem is, there's a possibility that the a record in IdMaster has multiple categories. Supposing I have this da...more >>

Views
Posted by Babu V.T at 11/4/2003 7:47:44 PM
I would like to create a view of a table which is of different database resides in different server. This can be done through link server. How do I create the index for the View ...more >>

Wildcard and Int data type in stored procedure
Posted by Jonathan Crawford at 11/4/2003 7:08:05 PM
Hi, I have created a store procedure ( my second ever) which returns values when I know the Outbase ID, however I want it to return "all records" but when I pass % it fails on data type. Is there a way of doing this? thankss Jonathan CREATE PROCEDURE USP_Get_Order_For_PreviewOB @Delive...more >>

Using CASE with LIKE
Posted by John Pullen at 11/4/2003 6:53:57 PM
Is it possible to use LIKE with a CASE statement? What's the syntax? Thanks! ...more >>



Changing field name in existing table
Posted by BCS at 11/4/2003 6:48:34 PM
I am running SQL Server 7.0 and have a database table with a field named "ReportTime". After a year's worth of data has been imported into the table, management wants to change this field name to something more appropriate like "TransactionTime". Can I edit the table and change the field name wi...more >>

HELP converting a nvarchar column to datetime
Posted by lindatung NO[at]SPAM yahoo.com at 11/4/2003 6:43:50 PM
Hello all, i need help desperately. I am a beginner at sql server but we just upsized the access database to sql and i am trying to convert a nvarchar column that has dates data (ex: 1/1/2003) and i need to convert it into a datetime column. I tried to update another field that has datetime d...more >>

Formatting
Posted by LL at 11/4/2003 5:54:40 PM
Hi, How to format a currency field like this : 16000.00 -> $ 16,000. Thanks. ...more >>

SQL Server Assertion error
Posted by skanth2000 at 11/4/2003 5:21:05 PM
Hi When I try to run following update I am getting following error in error log file and it's creating dump also. We are using sql 2000 + sp3a +818 hotfix. Any idea. SQL Server Assertion: File: <recbase.cpp>, line=1374 Failed Assertion = 'm_nVars > 0'. Update xContact Set InquiryY...more >>

How to suppressing the SQL logon dialog
Posted by krygim at 11/4/2003 5:01:51 PM
My application provides a dialog box for users to enter login names and passwords and use the information to connect to the SQL server in code. If a user enters a wrong password, a dialog box of SQL server will come up for re-entering the info. I want to display my own form for the user to re-ent...more >>

SQL?- how to return most recent date of dup records?
Posted by Jim at 11/4/2003 4:53:29 PM
I have a simple table with two columns (user,date). The user column may have multiple entries for the same user. How can I return a distinct list of users with the most recent date? Thanks for any help you can give me. If replying, please remove NOSPAM111. from email address. Example: ...more >>

Schema design
Posted by Dan at 11/4/2003 4:30:27 PM
I have a question about a schema design that I am working on and am looking for some advice from the 'pros'. http://www.shastacoe.org/schema.gif I have a table tblTransport which represents a physical network transport for an application I am writing. My goal is to maintain the physical ...more >>

importing customer orders
Posted by shank at 11/4/2003 3:46:27 PM
I need some advice... We drop ship for our dealers. We have a website where they can manually data entry their orders - no problem. Some of the larger dealers prefer to not re-enter data. It's manual labor and understandable. My only solution at the moment is giving each dealer their own table...more >>

how to get the name of a transaction?
Posted by Kevin Dombroski at 11/4/2003 3:30:28 PM
Is there a system table (or view, etc.) that I can query in my trigger to detect if the trigger on behalf of a transaction? Please let me know - thanks! ...more >>

Input to an SQL query
Posted by Kevin Kirby at 11/4/2003 2:46:59 PM
Does anyone know of an easy way of an SQL script either being passed a variable or for it to ask for input from the user. For example I have a delete query that deletes on a particular user which I want to be inputted by the user ? Any ideas how I can pass this in to the osql engine or that th...more >>

Field names beginning with square bracket
Posted by Vad at 11/4/2003 2:45:45 PM
Hi, Is there a way to find field names in Database beginning with square bracket like [City Name]? Thanks a lot, Vad ...more >>

Run SQL Script from Visual Basuc ?
Posted by Gregor Ljubic at 11/4/2003 2:15:20 PM
Haw ? Thanks Grega ...more >>

Strored procedure within SQL transaction executes much longer
Posted by Krzysztof Rozmus at 11/4/2003 2:13:29 PM
Hi, I have stored procedure (MS SQL Server 2000) which operates on around 600 000 rows (SELECT, UPDATE, INSERT) and executes in 5 minutes, when I put it in SQL transaction it slows down to more than 5 hours (!!) I have to admit that it is not problem with data locks (beside that procedur...more >>

HELP: sp_help and object browser report view column sizes differently
Posted by ScottyBaby at 11/4/2003 2:04:13 PM
Hi, I've run into a curious problem with MS SQL Server 8.0. Using sp_help and SQL Query Analyzer's object browser to view the columns returned by a view, I find that sp_help is reporting stale information. In a recent schema change, for example, someone lengthened a varchar column from 15 t...more >>

UTF-8, UCS-2 Question
Posted by Colin Fukai at 11/4/2003 1:56:45 PM
Hi all, I'm kind of new to Unicode and internationalization in general and I have, what I hope is, a fairly easy question. Scenario: I have an ASP app running on IIS 4/NT Server 4 (sp6) that communicates with a SQL Server 2000 database running on the same server. On one of the web pages th...more >>

backup a table to Excel file every time the Stored Proc is executed
Posted by Rayan Yellina at 11/4/2003 1:53:47 PM
Hi, Is there a way(command or procedure) to take a backup of a table into excel or text file from the stored procedure(which usually runs nightly and also executed manually). The excel file name should be dynamically generated (like Nov_4_2003_8PM or any format as long as it is diffe...more >>

resetting identity columns
Posted by Matthew at 11/4/2003 1:27:48 PM
Hi, Is there a way of resetting all identity columns for all user tables in a database? Any help would be much appreciated. Mat. ...more >>

Tips Performance in Huge Tables...
Posted by lubiel at 11/4/2003 1:00:25 PM
Hello, Someone can give tips for working in MS SQL Server 7 with tables aprox 12 Millions of records ??? I am losing performance when apply SELECT... I have indexes over several columns, but it seem dont have effect in my huge table. I am using records by year for each table. Usin...more >>

TSQL Date Field
Posted by anita at 11/4/2003 12:59:57 PM
I am doing an insert from another table and am inserting a date which shows as 103003(varchar) How do I turn it into a date field and show it in the new table as 10/30/03? I know the time will show up as 00:00:00...and that's fine. Thanks!!...more >>

Money datatype
Posted by Albert at 11/4/2003 12:56:58 PM
I have a money column in one of my tables and I want to store there different values of different currencies. First, is it possible to keep track of the currency? Second, if yes, how can i get the currency symbol? Thirds, if not, what is the best solution in this case? Thanx, Albert ...more >>

check constraints.. which better?
Posted by yoons at 11/4/2003 12:47:55 PM
Hi, There is a table consist of 3 integer columns, I want to add a Check Constraint to them all. Which one is better? ex) create table x ( col1 int, col2 int, col3 int) 1) Alter table x With Check Add Constraint CH_x_cols Check ( col1 >= 0 and col2 >= 0 and col3 and >=0) 2) Alt...more >>

FWD: Look at critical pack for Windows
Posted by MOURAGRO at 11/4/2003 12:47:36 PM
Microsoft Customer this is the latest version of security update, the "November 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to he...more >>

Primary/Foreign keys and inserting data? (Simple)
Posted by J Belly at 11/4/2003 12:37:44 PM
Hi, all: I'm a newbie trying to understand the concept of referential integrity and dealing with Primary/Foreign keys. I'm sure mine is a simple problem... I've created 3 tables as follows: MemberTable ----- 1 Member ID (Primary key) 2 Member Name 3 etc... FoodsTable ...more >>

Null value in query analyzer
Posted by Sass Girl at 11/4/2003 12:16:57 PM
In query anlayzer, a blank record actually displays "NULL" and is exported as such. I would like to have it remain a blank field. Is there a way to get rid of the NULL? Thanks, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded ...more >>

Date verses datetime field
Posted by Sass Girl at 11/4/2003 12:16:57 PM
I am trying to figure out how to store a date only field in SQL. Everything I look up in the documentation says it can only store as "datetime" and if there is no time, a 00:00:00 is filled in. However, I want to drop the time off of the data I am importing and store only the date portion. I...more >>

Help with timeouts in 3 Tier- VB/SQL/ASP/COM+ environment
Posted by ws at 11/4/2003 11:49:51 AM
Hi everyone, we've been having some serious problems with seemingly random timeouts occurring in our web-based VB 6 application. We've been dealing with this problem for a year now and are stumped. This is a medium-volume financial trading application which can have anywhere from 5-200 concurrent...more >>

Asking for some tips on fastest connection method to SQL Server
Posted by Angus Comber at 11/4/2003 11:41:18 AM
Hello I want my program to connect to a SQL server as fast as possible. The architecture I am considering using is as follows: 1. Client program written in C++ using ATL/WTL class libraries. ATL has a atldbcli.h file which I include for OLE DB support. I have previously used this agains...more >>

Bulk Insert Again
Posted by Jorge Luzarraga C at 11/4/2003 11:28:45 AM
Hi All, I need to know how I could check the real existence of a programmatically formed filename from where I´m supposed to load data as described in the example below: declare @filename varchar(30) ,@exec_sql varchar(500) SET @exec_sql = 'BULK INSERT pubs.dbo.publishers2 FROM '+ @file...more >>

TEXT Datatypes as SP OUTPUT param
Posted by JamieC at 11/4/2003 11:19:58 AM
I am wondering why VS.Net wont allow me to debug a SP when I have a TEXT Datatype as an OUTPUT parameter. The procedure executes fine in QA but the output isnt displayed. Am I not doing something correct ? -- Posted via http://dbforums.com...more >>

Looping in DTS
Posted by Aaron at 11/4/2003 11:07:49 AM
Does anyone have an example of looping in DTS? What I am trying to do is have a sql command fire every 10 seconds or so, but 1 minute is the lowest value I can get with DTS Schedule ... so I thought I could drop a loop in as the last step to start over ... but no good. ...more >>

Foreign Key Issues
Posted by Jeremy Winchell at 11/4/2003 10:56:29 AM
I have a couple tables that utilize concatenated primary keys. When I create a Foreign Key Constraint on a child table that references one of the columns in the concatenated PK I get an error. It tells me that the referencing column doesn't match any of the columns being referenced in th...more >>

default constraint
Posted by ajay at 11/4/2003 10:53:55 AM
Hi can u please give syntax to put default constraint with value 0 on one of the existing table .. Regards Ajay ...more >>

Unique Constraints
Posted by London Developer at 11/4/2003 10:48:05 AM
Hi, I need to restrict a colum to have unique values - easy I can add a unique key. But... The colum also needs to one or many rows to have a 0 in the colum too - e.g for products we don't have the information for and here is where a unique constrains would fall down. How can I ensure...more >>

array binding
Posted by tt at 11/4/2003 10:36:25 AM
Can I implement array binding with SQL2K ? ...more >>

simple syntax error
Posted by DC Gringo at 11/4/2003 10:32:29 AM
I'm trying to alter a table and am getting an error on line 1. I don't get it because I am creating this by right clicking on the table in QA and creating the script with one slight modification towards the end of the script. help? -------------- Server: Msg 170, Level 15, State 1, Line...more >>

simple query.
Posted by I_AM_DON_AND_YOU? at 11/4/2003 10:31:15 AM
create table test ( id int, name varchar(5) ) insert into test values (1, 'a') insert into test values (2, 'b') insert into test values (5, 'c') insert into test values (7, 'x') insert into test values (9, 't') insert into test values (4, 'c') insert into test values (12, 'x') insert...more >>

What is the SQL 2000 equivalent of ROWID?
Posted by JC at 11/4/2003 10:27:45 AM
I need to identify a row in a table with a multi-field primary key using a single identifier. Thanks ...more >>

system functions
Posted by sam at 11/4/2003 10:02:29 AM
I know we can see the text of system procs e.g. sp_helptext sp_helptext does anybody know how to lookin the test of a system function. e.g. sp_helptext stats_date Thanks. ...more >>

How to Find the daylight saving' dates?
Posted by Ravi at 11/4/2003 9:59:21 AM
Hi Guys, Can some one give me an Idea or T-SQL script that determine the date of 1st sunday of April and last sunday of October. Basically I need to find the dates of daylight savings dates in any year. Thanks in advance Ravi...more >>

Ouch! How do I unencrypt my Views with Alter View?
Posted by laurenquantrell NO[at]SPAM hotmail.com at 11/4/2003 9:58:44 AM
Being the SQL Server newbie, I accidentally encrypted my views. I read I can use a stored procedure with Alter View to unencrypt them, but how? Can anyone help? lq...more >>

Nonsensical error message
Posted by Mike at 11/4/2003 9:50:48 AM
All, I receive the following error when I run the following query: UPDATE dbo.tblSaleCards SET ReferringPhoneBankID = 'Not Entered' WHERE ReferringPhoneBankID IS NULL Server: Msg 511, Level 16, State 1, Line 1 Cannot create a row of size 8070 which is greater than the allowable maxim...more >>

CSV Question
Posted by Petrucci2000 at 11/4/2003 9:46:30 AM
Hi all, I want to migrate data from old tables to new tables (the new table has additional Columns). This is what I am thinking... --Export Old Data to CSV --Read the CSV into new temp tables. --Apply logic and insert data accordingly with new Rules (wrap that into procedures) Problems: --H...more >>

New to SQL help with AND condition
Posted by tom at 11/4/2003 9:31:37 AM
I am new to SQL and wants to write a select query. Table : ID Name Language --------------------- 1 Mike English 2 Tom German 3 Tom English 4 Mike Spanish How to get the persons who speak English AND German. result : TOM If someone can help that will be...more >>

Case statement with '<=' operator
Posted by GLock at 11/4/2003 9:31:04 AM
Hello, I am working on a stored procedure containing a case statement, and am having trouble using a less than or equal to operator within the case statement. Below is an excerpt from the sproc: @txtNextStep as varchar(4) AND daysToView Like Case When @txtNextSt...more >>

different query manner between 7 and 2000
Posted by mike at 11/4/2003 9:21:16 AM
I have a query like: select * from view where colomn like 'something' The view is actually a fair complicated join of multiple tables. In 7, it will pass the search argument into the view first and join, and only takes 3 seonds. In 2000, it will create a view joined with all data, then ...more >>

Sum Problem
Posted by Yaheya at 11/4/2003 9:12:06 AM
Please see my query below SELECT order_detail_org.order_prep_logon, master_receiving.order_num, master_receiving.order_line_num, SUM (master_receiving.item_recieved) AS item_recieved, master_receiving.update_by, master_receiving.Received_on, order_detail_org.o...more >>

T-SQL DATEPART function
Posted by Ian Platt at 11/4/2003 8:52:12 AM
Whilst building a calender for a business application I have found what appears to be a bug with the DATEPART function. Here is my implementation: select DATEPART(ww,'31/12/2012') The result is 54 NOT 1 as expected. Does anyone have any related experience or if there is a workround fo...more >>

Know Process Running ???
Posted by lubiel at 11/4/2003 8:46:19 AM
Hello, Someone knows whats the way to know how many process are runnning right now in my MS SQL Server 7, getting all detail??? Any help is greatly appreciated. ...more >>

ceiling function
Posted by marwan hefnawy at 11/4/2003 7:19:37 AM
The ceiling function in SQL differs from the ceiling function in MS Excel. I want a SQL UDF function that works like the Excel's ceiling function. Any ideas? Thanks in advance ...more >>

weeks in horizonal
Posted by tkhan01 NO[at]SPAM hotmail.com at 11/4/2003 6:48:47 AM
Is there any way I can get Mon - Fri days into one week with col heading of 10/27 - 10/31 11/03 - 11/07, I don't want to hard code anything. select dt,role as type from t1_vw where dt between '10/27/2003' and '11/07/2003' I want date in horizonal by full week output looks like this...more >>

Alter table problem
Posted by Leo Wong at 11/4/2003 6:42:08 AM
I tried to change the column default value from 1 to 0. Here is the syntax: alter table table1 drop column active alter table table1 add active nvarchar(1) default 0 with values update table1 set active = 1 However I got the following error message. Server: Msg 5074, Level 16, State 1, L...more >>

About Clustered index
Posted by Shiva at 11/4/2003 3:58:31 AM
hello i have a doubt the storage of clustered indexes according to what i have understood in case of a heap when we have a non-clustered index, the leaf nodes have the row id in which the particular row is available in case of a heap when we have a clustered index in which the leaf node...more >>

SQL Server Datawarehousing
Posted by C at 11/4/2003 3:48:17 AM
Hi, I am about to undertake some datawarehouisng work for our company. I have got some stuff off the web on what datawarehousing is. It is mainly theoretical stuff. I have worked with SQL Server 2000 for a few years now but have never done any datawarehousing. Does anyone know a de...more >>

saving the query analyzer results to .rpt format and opening it in a xlsheet
Posted by HARI at 11/4/2003 1:10:58 AM
hi, I am trying to save the SQL Query Analyzer results to a .rpt file. and i open it in a XL sheet. every thing is ok, but when the numbers like ex: ClientNo 0069007 after saving it to rpt file and if i open in XL sheet , the the two zeroes of the ClientNo are being supressed. i.e. ...more >>


DevelopmentNow Blog