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 2004

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

Open DBF file with MSDE
Posted by H.S. at 1/31/2004 10:49:53 PM
Hi Sori, but how is possible to open a DBF file with MSDE. The server MSDE is already instaled, but I d'ont know how atache the Teste.mdb file? Is necessary to run same script? Please urgent. H.S. ...more >>

Backups with MSDE
Posted by SStory at 1/31/2004 10:40:46 PM
How can I setup backups with MSDE? I have the DBAMGR2 but don't know how to set up backups for it. What is the best strategy. The people who are using it with my app have a tape backup on the machine, but I'm not sure how to set up backups. And they are not super users or anything. Wha...more >>

Which is faster?
Posted by William Chung at 1/31/2004 10:07:53 PM
Q1. I have to create a table with new schema which has 10 billion rows. Which is faster? method 1: select ...... into alter table NEW alter column c1 char(5) NOT NULL alter table NEW alter column c2 char(5) NOT NULL alter table NEW alter column c3 char(5) NOT NULL ... alter table ...more >>

String Result!
Posted by Jeff at 1/31/2004 9:48:07 PM
Hi, I've a SQl 2000 Standard Editon on 2K Server. I've a VB program that run locally. Recently I got Timeout probelm where the command timeout = 90. Then I tried on other PC to call reomtely. It's worked fine. Is there any differences for SQL to react on local and remote query and update. ...more >>

Unique Values and NULL output
Posted by don larry at 1/31/2004 8:49:59 PM
Greetings, here's my table --DROP TABLE Tbl2toe CREATE TABLE Tbl2toe (ThisID int IDENTITY(1,1), NameID int, myName varchar(20), myPhone varchar(20)) INSERT INTO Tbl2toe (NameID, myName, myPhone) VALUES (1,'Droof', '233-2223') INSERT INTO Tbl2toe (NameID, myName, myPhone) V...more >>

Simple Cursor Question
Posted by CSharp ( ILM ) at 1/31/2004 5:08:51 PM
Hello, I am using a cursor but getting my results doubled, Trippled etc.. DECLARE some_cursor CURSOR FOR SELECT C1S, C2S, FROM SomeTable WHERE OST= @OST -- this has some value OPEN some_cursor FETCH NEXT FROM some_cursor WHILE @@FETCH_STATUS = 0 BEGIN Insert TargetTable(C1...more >>

smallint and int
Posted by Alex Chan at 1/31/2004 3:03:25 PM
Hi All, I would like to use the smallint as the primary key for some tables which is enough. Is there any impact for the performance issues? If compare with integer fields? Will it be slower when I use it as the primary key? Thanks and Regards Alex ...more >>

Help with Date
Posted by Kissi at 1/31/2004 2:48:42 PM
Could anyone help me with this Please. I want to write an SQL statement in VB. A user enters a start date using inputbox. Sql statement searches database with two fields, BeginField and EndField. If date entered by the user exist within the range BeginField and EndField, prompt user(Dates not a...more >>



Problem with a SQL Statement
Posted by Atley at 1/31/2004 2:24:37 PM
I have three tables: Products Table PID PName PType Linking Table LID PID CID Customers Table CID CName CPhone I am trying to make a single statement that will give me all the customers that haven't bought a certain single product so i can make a list of people to c...more >>

weird errors when precompiling genwin.sqc with nsqlprep
Posted by akumar1 NO[at]SPAM mn.rr.com at 1/31/2004 2:16:37 PM
I am trying to compile the sample program genwin.sqc, using nsqlprep which is used to precompile embedded sql in C. I am getting weird errors and that is because windows.h is included in the genwin.sqc file. I am using Setting the lib and include path: set INCLUDE=C:\Program Files\Microso...more >>

SQL Server User Group
Posted by Roji. P. Thomas at 1/31/2004 1:16:03 PM
How can I start a SQL Server loca user group (community) that is recognized by MicroSoft? -- TIA Roji. P. Thomas ...more >>

Problem with INFORMATION_SCHEMA.SHEMATAS
Posted by Per Hultqvist at 1/31/2004 1:05:01 PM
Hi, I have used "SELECT * FROM INFORMATION_SCHEMA.SCHEMATAS" to give me the names of all databases on the SQL-server. The problem is that I just realized that the list is not allways complete. I have 30+ databases and there are 6 or 7 who is missing. I have seen this happen from different com...more >>

nvarchar and field collations
Posted by Sedat Eyuboglu at 1/31/2004 12:37:49 PM
is the collation of the field effective when i use the nvarchar for the field as the datatype. sorting properties may be still effective but the charakter set? i can't understand exactly what happens when i use the nvharchar although i use it successfuly. i need any description about this poi...more >>

Northwind SQL UPDATE problem
Posted by Nick Butler at 1/31/2004 11:47:58 AM
Hi, I have added a field to the Customers table called TotalValue with a type of Currency. I want to populate this field with the total value of all sales to that customer, so I tried this: UPDATE Customers SET TotalValue = ( SELECT SUM( Quantity * UnitPrice * ( 1 - Discount ) ) FROM O...more >>

Is it possible to Alias a database name?
Posted by Enzo at 1/31/2004 11:28:22 AM
We have an application where we create two databases in SQL Server. The data is seperated for a reason, however, there are some stored procedures that need to reference the other database for some business rules. Lets say I have DB_ONE and DB_TWO. In a stored procedure in database DB_ONE ...more >>

Convert Date Varchar To smalldatetime
Posted by allen NO[at]SPAM oysterweb.com at 1/31/2004 9:27:55 AM
I am having a difficult time accomplishing the following. I have a text file that contains fields containing dates with and without the time stamp. ie; 1/12/2003 1/12/2003 12:30:00 AM 11/1/2003 11/1/2003 12:01:00 PM etc. I am trying to import the text file using DTS, but it will only ...more >>

Stored procedures
Posted by Peter Newman at 1/31/2004 8:11:06 AM
I read a comment someone made that it is better to use a stored procedure thans a T-sql if possible, to this end im trying to write a stored prodedure to create a recordset from several tables, is it possibel t 1. create two temporary tables from two different select statments 2. join the two ta...more >>

Slow UDF in Replicated Database
Posted by dave NO[at]SPAM whconsult.com at 1/31/2004 7:55:39 AM
I have a database that is being replicated to a server. I am finding that some UDFs are running very slow in the replicated version of the database. If I run the same query against a non-replicated version of the database on the SAME server, the query runs quite fast - 3 seconds compared to 59 s...more >>

datetime conversion
Posted by SMK at 1/31/2004 6:46:07 AM
I have numerous datetime fields that are times when something was done. I would like to convert these to smalldatetime but can't because SQL has put in 1/1/1900 or whatever it uses for a date if nothing is specified and whatever date that is is apparently outside the smalldatetime range. How c...more >>

importing and maintaining identity columns
Posted by Glenn Carr at 1/30/2004 10:15:12 PM
I'm would like to import records I select with a SELECT from one database to another but maintain the identity column values. I've read where I can do this by setting IDENTITY_INSERT ON. From the Import wizard on the enterprise manager, I am selecting 'import using a query', then specifying: ...more >>

Way to Reset @@rowcount
Posted by CSharp ( ILM ) at 1/30/2004 9:50:59 PM
hello, is there a way to reset @@rowcount to zero if I have multiple inserts one after another I can't rely on @@rowcount because it does not always reflect the last insert if one of inserts fails then the @@rowcount keeps its value from the previous Insert Am I wrong?? SAM ...more >>

Insert Question
Posted by CSharp ( ILM ) at 1/30/2004 9:47:15 PM
Hello, How do I know that an Insert has succeeded? Should I check both @@rowcount and @@Error like if @@rowcount <>0 and @@Error <>0 or what Does an If statement affect the @@RowCount or the @Error during the check. I know it could effect afterwards? because set @error = @@Error a...more >>

Which SP's for 2000 Developer Edition?
Posted by WhoAmI at 1/30/2004 8:28:16 PM
Which are the correct service packs for SQL Server 2000 Developer Edition? ...more >>

Transaction Easy Q
Posted by CSharp ( ILM ) at 1/30/2004 8:27:50 PM
Hello, I have on SP that calls another ChildSP What is your recommendation on: having a Tran in ChildSP or just send back an error and rollback in Parent SP What happens if I have a Tran in ChildSP and I roll it back does Trans in ChildSP Bubble up to Parent SPs and then what?? Al...more >>

Easy Locking Question
Posted by CSharp ( ILM ) at 1/30/2004 8:18:01 PM
Hello, I have one table (TableC) that has one row and one column to supply couple of tables an Id Table 1 1 3 4 5 8 9 Table2 2 6 7 10 etc... What happens when multiple users are using the system What happens if one transaction is rolledback so by the time I get the ne...more >>

Question on indexing column(s) within a table
Posted by B-Man at 1/30/2004 6:23:03 PM
I have a table that contains about 450K records that represents sales leads. Within this table there are a set of columns (26 to be exact) that indicate the industry the lead is in. For eaxample, lets say: A = Transportation B = Telecommunications C = Utility .. .. .. Z = Other This ...more >>

printing query to receipt
Posted by vncntj NO[at]SPAM hotmail.com at 1/30/2004 5:56:27 PM
I have a computer setup next to a receipt printer. I want the query results to print directly to the receipt printer. i have asp pages that take the input from the users, but at the end of their transaction, i want to print a report (receipt). Thanks...more >>

isnumeric('.') = 1
Posted by Andrew John at 1/30/2004 5:28:29 PM
Dear All, Having just had this little gotcha seared into my memory, ( within 5 minutes of causing a $10k/minute shutdown ), I thought I'd post a refresher, as it is not recently in any archives that I can see. isnumeric('.') = 1 yet cast( '.' as int ) errors isnumeric(',') = 1 ...more >>

Design question
Posted by Simon at 1/30/2004 4:55:06 PM
I am designing some tables for an application and I have an instance where I have a many to many relationship between two tables. I have an EMPLOYEE table and a BENEFIT table. Each EMPLOYEE can have more than 1 benefit and each BENEFIT can be held by more than one EMPLOYEE. I know I need to...more >>

problem with sql
Posted by Pascal Schmidt-Volkmar at 1/30/2004 4:22:34 PM
Hi there. I have a problem with my sql statement. The data refers to an electronic answering form. People are asked questions "KANT_KRIT_ID" and their answers are stored in "KANT_ANTWORT". Now I would like to sort out those people that answered 1 for question KANT_KRIT_ID=1 and at the same tim...more >>

Creating a View and calling it from a Stored Proc. Is it more efficient?
Posted by debartsa at 1/30/2004 3:49:55 PM
Hi Everybody, I'm joining four tables in a Stored Procedure and returning a result based on an input parameter passed in from ADO.NET's OLEDB provider. My question is.... Would it be more efficient to join the tables ahead of time in a View instead and then call the View from the Stored P...more >>

changing data to display different in a select query
Posted by AshaR at 1/30/2004 3:46:25 PM
I have a column in the following select startement called displayvalue. Displayvalue is a varchar column. Primary everything entered into this column is numeric, but there are times when NR is entered. In the select query if it sees NR, I would like to have NR changed in the resultset t...more >>

how to use suprate log file for a table?
Posted by hai microsoft at 1/30/2004 3:25:21 PM
Hai all, I'm working on a project that has around 25 tables of which around 10 tables contains 4 million records. All are culstered indexed. When we issue a select query that joins these tables (at a time 4 0r 5 joins),it creates locks in the database or sometimes it will take too long a ti...more >>

Is Null returns records where value is not null
Posted by SQL at 1/30/2004 3:12:58 PM
Hi...we recently ran a simple query "select * from tableA where columnA is null". ColumnA was not null, but instead a byte (''). But the query still returned records where ColumnA = ''. The ANSI NULL option for the database is not checked. Am I missing something in comparisons of null valu...more >>

get a quote in a big string?
Posted by Stephen Russell at 1/30/2004 2:54:59 PM
I'm trying to remember how I use to place ' in my strings so they were picked up set @WhereClause = ' where ap_basicmodel = '823' '. I've tried the''' and the " ' " but ??? TIA -- Stephen Russell S.R. & Associates Memphis TN 901.246-0159 Steve says get rid of the notat_ to send hi...more >>

newbie Relation problem
Posted by sklett at 1/30/2004 2:49:17 PM
Just getting dirty w/ relations for the first time. I hit a rad block already. Consider these tables Prod_Main [ ProdId(pk) ] Prod_Accessories [ ProdId(fk) ][ AccId(fk) ] so, a basic 1-many relationship, right? Is this what is called a "self referencing table"? Now conside...more >>

ALTER TABLE CONSTRAINT
Posted by Toco Hara at 1/30/2004 2:46:09 PM
I have column name called SendToQIP/ERS, and I'm trying to ADD DEFAULT to column like this ALTER TABLE tblQuality /* sets default to 0 (zero) * ADD CONSTRAINT Def_SendToQIP/ER DEFAULT '0 FOR SendToQIP/ERS This was an ACCESS Database file once before and naming conventions are not good. My e...more >>

SQL problems
Posted by Alison at 1/30/2004 2:41:07 PM
I have a few questions I donnot know exact answer.Can someone help explain ? (1) What are some common causes of Unavailability for a SQL database ? (2) What is Perfmon ? Where can I find more info about it? (3) In a multi-user or multi-threaded SQL environment what issues may arise? Than...more >>

Connect to and send two variables to stored procedure
Posted by chad at 1/30/2004 2:07:54 PM
I'm trying to write a vbscript that connects to an oracle stored procedure and then sends two variables to the stored procedure. I'm connecting to the oracle database via ADO. Can anyone share sample code that would demonstrate connecting to the SP and then sending it two variables from th...more >>

Combining columns and pulling unique fields
Posted by alex NO[at]SPAM totallynerd.com at 1/30/2004 1:51:46 PM
Hi all, I have a table which resembles the following: Dept VP Director Manager Marketing Smith Smith Jones HR Thompson Haskins Packard IT Johns Peterson Jones And I need to somehow combine VP, Director, and Manager to get one un...more >>

Table Size
Posted by Offeral at 1/30/2004 1:31:10 PM
Is there an SP that will show you table size as far as allocated and data similar to the sp_spaceused for dbs? Thanks in advance Offey...more >>

Function or Select
Posted by Darin at 1/30/2004 1:05:13 PM
I have a VB application that I do a select statement to return a table (it is actually only one row that is being returned). This process takes about 30 seconds. Would it be faster to create a function that returns a table that does the same thing as the select statement? Aren't functions "com...more >>

Getting default value
Posted by Ruggero Rossi at 1/30/2004 1:02:43 PM
How can extract only records from a table where the value of a field equals to its default? I mean something like select field1, field2 from table where field1 = defaultValue(field1) I have used user defined functions as default value, so if I query information_schema.columns ...more >>

Analyze Queries
Posted by brians at 1/30/2004 12:55:25 PM
I am begining to look at learning more about analyzing our servers performance. Understanding the profiler is a little overwhelming. For now I want to find poor performing queries which are all views now. Can I somehow set up profiler to track performance on all views ran from a datab...more >>

rownum
Posted by tex at 1/30/2004 12:46:10 PM
Hi, is exists some feature in SQL Server se rownum in Oracle.? I do not want identity, I need select XX, YYY, rownum from dual transform to SQL server want to do it in one select not procedure ... T. ...more >>

starting 0 in variable string
Posted by clifford at 1/30/2004 12:41:33 PM
Here's the procedure: CREATE PROCEDURE proc @id varchar(50),@acct_num varchar(10) OUTPUT,@no_go int OUTPUT AS SET NOCOUNT ON SET @acct_num = '00' + @id SELECT first_name,last_name FROM $table WHERE account_number = @acct_num IF @@ROWCOUNT = 0 BEGIN SET @no_go = 1 RETURN END ELSE BEGI...more >>

Multiple literals in a variable for use in a where statement
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 1/30/2004 12:38:35 PM
I have a series of about 30 queries that need to be run. The where criteria contains many warehouse locations and status codes. Rather that repeat the code 30 times, I would like to place it in two vaiables and reference the variables in the where clause. I have tried using double and singl...more >>

Trying to remove multiple spaces in a string
Posted by Carl Unternahrer at 1/30/2004 11:53:42 AM
I have some values that I need to convert a varring number of spaces between words and letters to one space. Is there a way to do this other than running an update similar to the following until no more rows are updated? Update tblX Set colX = replace(colX, ' ', ' ') Thanks much Carl ...more >>

Access front end and SQL backbone
Posted by uniquedb at 1/30/2004 11:26:09 AM
I have an Access 2002 database running off SQL 2K advance server back end. Within this database I need to have column A (example column or field A) upon selection of a specific criteria have column B or field B become a automatically filled column with whatever criteria I specify. Basically making...more >>

Getting a substring from a field
Posted by Bob Holmes at 1/30/2004 11:20:08 AM
Hello everyone, I have a field value like this: "RQ1234LN1". It comes from my receipts table and makes reference to the requisition on which that part appears and the line number. Is there a way to extract the numbers between "RQ" and "LN" and to extract the numbers following "LN"? The al...more >>


DevelopmentNow Blog