Groups | Blog | Home


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
August 2008


all groups > sql server programming > september 2005 > threads for friday september 2

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

Clustered index on Identity field
Posted by Pradeep Kutty at 9/2/2005 7:43:44 PM
Hi All, I have heard that if you create a clustered index on identity column(PK also) it would decrease the page splits. But how? Thanks, Pradeep ...more >>

triggers
Posted by greg at 9/2/2005 3:21:54 PM
hello, i have a basic question about triggers. are they created the same way you create stored procedures? right click on the stored procedure and pick new stored procedure? i created a new stored procedure and inserted this text: CREATE TRIGGER trig_sequence_number ON acd_document_s FOR IN...more >>

Error on query execution in VBA Excel using ADODB on SQL Server
Posted by Glenn Ray at 9/2/2005 3:04:07 PM
We're trying to upsize from MS Jet (Access) db to SQL Server and am having a major problem. Because we've not seen this error with the MS Jet db, I suspect it's related to the user configuration in SQL Server. The servername is "sqlbox" and the database name is "TCR". We use WinNT authent...more >>

Lookup tables
Posted by tshad at 9/2/2005 2:31:20 PM
What are the typical things you look for to decide whether to use a lookup table? I typically have Country lookup tables, State lookup tables, Airline lookup tables, etc. We also have a field that is a company type which would be one of 6 values: Corporation ...more >>

Please help Invalid Cloumn Name
Posted by Dib at 9/2/2005 1:36:07 PM
Hi, Here is my SP I need to run this as this ConFirmOrders_SP 'SVR,UCC' this is giving me Server: Msg 207, Level 16, State 3, Line 1 Invalid column name 'UCC'. Server: Msg 207, Level 16, State 1, Line 1 Invalid column name 'SVR'. ALTER Procedure ConfirmOrders_sp ( @StrTy...more >>

[Vent] SQL Server Upgrade
Posted by Mike Labosh at 9/2/2005 1:24:45 PM
It just occurred to the suits recently that the 240 GB is not enough, so what did they do? Change the RAID configuration?!? NO! Get more drives for the RAID 10 stack?!? NO! They bought a SATA drive and wired it to the SQL Server with a USB connector. And now there's an email storm go...more >>

GoalSeek in SQL Server?
Posted by carmaboy NO[at]SPAM gmail.com at 9/2/2005 12:52:11 PM
Has anyone create a GoalSeek function similar to that of Excel? I've been researching this and trying to script one out myself without much sucess. If someone could tell me that its impossible, that would be helpful too. TIA. ...more >>

Cursor Update problem
Posted by Shannon Thompson at 9/2/2005 11:43:01 AM
I am using a cursor to take information from a temp table and either insert or update another table. I am using a while loop to fetch all the vaules from the cursor and then I close and deallocate the cursor. Everything runs fine the first time but when I run the procedure again it updates t...more >>



GRMPH!!!!!!
Posted by Mike Labosh at 9/2/2005 11:36:06 AM
CREATE PROCEDURE dbo.msl_UpdateMSLJobTitle ( @description NVARCHAR(70), @jobTitleKey INT ) AS UPDATE msl_JobTitle SET Description = @description WHERE JobTitleKey = @jobTitleKey GO Then I have some VB.NET code that runs it: Private Sub fixJobTitles() Dim cnstr As String = ...more >>

Sys Tables for Datetime type
Posted by wnfisba at 9/2/2005 11:33:04 AM
I am looking for a specific Datetime column and I don't know what table it resides in. How can I query the systables looking for all those columns with Datetime type??? Thank You!...more >>

Execute Command No transaction
Posted by Chris Calzaretta at 9/2/2005 11:33:03 AM
How would I execute a stored procedure and turn off the transaction. We do not care on our end if the data makes it over. So we dont need transaciton. Any Idea? Thanks...more >>

between
Posted by js at 9/2/2005 11:01:45 AM
hi, what diff: select * from mytable where intfieldname between 1 and 5 and select * from mytable where intfieldname between 5 and 1? Thanks. ...more >>

select stored proc
Posted by soc at 9/2/2005 10:59:41 AM
Does it make sense to have a stored proc which selects from one of a number of tables depending on a variable, as below. Or should I have a stored proc for each table. Thanks Soc. CREATE PROCEDURE [user].[usp_tables] ( @pg_id int, @pagesource varchar (30) ) AS Select * from @pagesou...more >>

Question about Views in a Multi-User System
Posted by Mark Moss at 9/2/2005 10:58:44 AM
Sirs / Madams I am new to MSSQL and was wondering about data conflicts with Views in a Multi-User System. By that I mean if I have five users execute the same report against a database at the same time but with different criteria how does MSSQL prevent data corruption between them. ...more >>

Age Average
Posted by wnfisba at 9/2/2005 10:51:06 AM
I have to calculate the average age in a group. What is the best way to calculate the average age where I have the individual's birth date??? Thanks in advance!...more >>

How to capture result from READTEXT?
Posted by Snake at 9/2/2005 10:49:05 AM
In the continuing saga of dealing with blobs . . . READTEXT is a fine function, but useless by itself. I need to return the results of READTEXT into a varchar column but have been unable to do so or even find a similar example. Displaying the results in Query Analyzer is all the example MS...more >>

How to do field content search in sql
Posted by Raymond at 9/2/2005 10:36:13 AM
Hi everyone I have a silly question about SQL, I wonder if it is possible using existing technique to accomplish it. I have a binary field(e.g. Image) in SQL, I need to store image file(scanned from original document) in that field. I don't think it is possible but my boss want me to give h...more >>

Shrinking a db
Posted by bagman3rd at 9/2/2005 10:34:03 AM
I am having trouble shrinking a database. The database is 14 gig, with 6 gig free space. I have tried to shrink the db with ERM, and I have tried from command line with dbcc shrinkdatabase and dbcc shrinkfile with no success. Anybody have a clue as to what I am doing wrong. Thanks for the ...more >>

Retrieving ntext column value skips values.
Posted by Snake at 9/2/2005 10:19:03 AM
I have the unfortunate task of dealing with an ntext column. I have to update part of the contents but first I was just trying to display the contents in Query Analyzer using a script from page 61-62 of the Guru's transact sql book. Well, the script does print out a few characters, skip a few...more >>

Insert into another db on same server
Posted by dw at 9/2/2005 10:07:34 AM
Hi, all. What's the syntax for an insert from one database's table into another database's table on the same server? Here's what I've got and it keeps blowing up in SQL Query Analyzer, while connected to db1 which has Table1. I need to insert into db2's Table2. It keeps giving an "Invalid ob...more >>

Query for most recent of duplicate records
Posted by Jeff at 9/2/2005 9:32:01 AM
I need some ideas on this query. I have a table with entries similar to the following with columns name, id, and timestamp. kmyoung 345 2005-08-22 07:29:00.000 kmyoung 345 2005-08-29 07:29:15.000 mphillips 360 2005-08-27 14:48:18.000 rbeheler 360 2005-08-22 09:29:11.000 rbeheler 3...more >>

SQL Profile -- Trigger
Posted by Ed at 9/2/2005 9:18:16 AM
Hi, Is there anyway I can capture the name of the trigger that is fired? I tried SQL:StmtCompleted and SQL:BatchCompleted but both did not show the name of trigger that was fired during the Insert/Update/Delete... Thanks Ed...more >>

SQL Server error 1934
Posted by denix at 9/2/2005 9:01:32 AM
Hello all, I'm trying to write a very basic stored procedure that inserts a row into an indexed table with computed columns. I originally created it with this code : CREATE PROCEDURE insert_test AS SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIE...more >>

stupid coworker designed database with no identity keys.. :-(
Posted by Tony at 9/2/2005 8:50:37 AM
Discuss amoung yourselves; meanwhile I'm heading for the beach! Have a nice weekend folks! ...more >>

Data access advise
Posted by John S at 9/2/2005 8:40:56 AM
Hi vs2005/sql server2005. I have created a simple winform app by dragging a table on a winform. I have used stored procedures for data access. I have the following questions; 1. Using the default code generated by vs2005 for data access, how can I trap record insertion to set some field val...more >>

Recovery Model What Database/table stores info
Posted by Lontae Jones at 9/2/2005 8:21:03 AM
What database/table stores information on the recovery models used for all database on an SQL server? I want to change all to FUll. Thanks...more >>

getting a list of user created tables ONLY
Posted by kevin at 9/2/2005 7:48:05 AM
sql server 2k I am aware of SELECT * FROM INFORMATION_SCHEMA.TABLES ad sp_help, but in each case I also get a table called dtproperties and, in neither case, is there a logical way to tell one apart. I am also adverse to using undocumented system tables seeing as sql server 2005 is just ar...more >>

Query Concept
Posted by Ed at 9/2/2005 7:27:04 AM
Hi, I would like to use Northwind as an example. I am trying to use the Orders table and why the following query only returns one record for each customer if the outer query pass info into the inner query since each customer has more than one records in the Orders table. e.g. customerid...more >>

List of Tables and Primary Key Foreign Key Names
Posted by Alastair MacFarlane at 9/2/2005 7:21:05 AM
Dear All, I am trying to write some SQL that will give a list of all tables and Primary Key/ Foreign Key constraints in a database. The code below goes part of the way but not what I would like. It gives me: Parent Table: Activities Child Table: ActivitiesLocation ForeignKey: 1 Primar...more >>

Query advice
Posted by siaj at 9/2/2005 6:44:03 AM
I need a suggestion. I have a table with Columns (Rec_ID, Amt_Recieved, Amt_given, Rec_Status, Rec_Frequency , Rec_date) here Rec_ID and Rec_date are primary key I need a resultset out of this table which has columns Rec_ID, Amt_Recieved, Amt_given from the day previous to Rec_...more >>

case and order by problem?
Posted by WebBuilder451 at 9/2/2005 6:00:04 AM
Is there a problem with the case and order by when you attempt to order by a column that has been labeled? example (with assist from user MySqlServer, thanks you) CREATE TABLE tenbeat ( tenbeatcol1 int, tenbeatcol2 int ) INSERT INTO tenbeat VALUES(3,4) INSERT INTO tenbeat VALUES(1,2...more >>

table locking
Posted by Rippo at 9/2/2005 5:48:00 AM
Hi I have a table with an identity where I need to insert a set amount of rows. However I need to inser a full block with no gaps in the id's. If this sql was run by 2 people simulataneously then I could not get back a full block. I was thinking that a table lock would help here but do not kn...more >>

wher statement to find a speciffic digit number
Posted by Hans [DiaGraphIT] at 9/2/2005 5:20:03 AM
Hi! I wounder how i can find a speciffic digit numberin a nvarchar string in my table. Case: I have a costumer table. In there I have a column for IdentityNumber (nvarchar 255) - storing a 11 digit number. I want to make a select statement based on this column where the digit number ...more >>

Which one is faster?
Posted by Ion Popescu at 9/2/2005 4:55:51 AM
Which one is faster (regarding compilation time and execution time): SELECT @var1=(some expression), @var2=(other expression), [...] @var6=(last expression) or: SET @var1=(some expression) SET @var2=(other expression) [...] SET @var6=(last expression) All expressions are arithmetic...more >>

Remote insert performance
Posted by karuzo at 9/2/2005 4:22:02 AM
It seems that remote insert takes much more time than "local" insert. My table MyServer.MyDb.dbo.MyTable has hudreds of milions of rows and hudreds of GB. It has 3 indexes: clustered (not unique), nonclustered unique and nonclustered (not unique). An insert of tens or hundreds is imediate ...more >>

Newbie Table Design Question
Posted by Alastair MacFarlane at 9/2/2005 3:03:01 AM
Dear All, I am looking over the design of another person's Database and I find that nearly all tables have Primary Keys and also a column called: rowguid - uniqueidentifier - with a (newid()) default value Why would the designer need a primary key and a GUID in every table. I am confuse...more >>

BCP exporting data, what's this ÿ character?
Posted by Scott A. Keen at 9/2/2005 12:17:08 AM
I'm using BCP to export data. When I look at the data with Notepad, some empty fields have this "ÿ" character, but this character does not appear in the database table. This is apparently causing problems with the company we're exchange data with. They are asking for the field to be empty, n...more >>

SELECT @Variabe = Dynamic string HOW???
Posted by James Hancock at 9/2/2005 12:00:00 AM
Here's a user defined function I'm working on: CREATE FUNCTION dbo.CreateList (@Table varchar(50), @ListField varchar(50), @Query varchar(500)) RETURNS nvarchar(1000) AS BEGIN DECLARE @List nvarchar(1000) SELECT @List = COALESCE(@List + '', '', '''') + @ListField + ' FROM ' + @Table + ' ...more >>


DevelopmentNow Blog