Archived Months
January 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
all groups > sql server (alternate) > march 2006

Filter by week: 1 2 3 4 5

alter table column, which is part of foreign key
Posted by RamaKrishna Narla at 3/31/2006 10:00:17 PM
In MS SQL Server, I have the following tables with some data in it. create table table1 ( column1 varchar(32), column2 int not null, column10 varchar(255), ..... primary key (column1, column2), ); create table table2 ( column1 varchar(32), column2 int not null, column...more >>


Math functions
Posted by kai at 3/31/2006 2:22:18 PM
Hi, How to find the list of SQL math functions in SQL Server 2005? Thanks Kai ...more >>

ERROR_STATE() Always = 0?
Posted by wackyphill NO[at]SPAM yahoo.com at 3/30/2006 6:20:43 PM
Below is the contents of a SPROC I have. I want to return the error info in the catch block for it so I call RaiseError. But the ERROR_STATE() always comes up as 0 which is ilegal since it must be between 1-127 I guess. So I wrote a stupid if block to set it to 1 to stop that error. But I'd r...more >>

Need a So-Called SSN Encryption
Posted by ILCSP NO[at]SPAM NETZERO.NET at 3/30/2006 9:28:53 AM
Hello, perhaps you guys have heard this before in the past, but here is what I'm looking for. I have a SQL 2000 table with Social security numbers. We need to create a Member ID using the Member's real SSN but since we are not allowed to use the exact SSN, we need to add 1 to each number in t...more >>

Update SQL 2000 Query (converting an Old Access 2k query to SQL)
Posted by ILCSP NO[at]SPAM NETZERO.NET at 3/30/2006 9:01:09 AM
Hello, I have the following query in Access 2000 that I need to convert to SQL 2000: UPDATE tblShoes, tblBoxes SET tblShoes.Laces1 = Null WHERE (((tblShoes.ShoesID)=Int([tblBoxes].[ShoesID])) AND ((tblBoxes.Code8)="A" Or (tblBoxes.Code8)="B")) WITH OWNERACCESS OPTION; The ShoesID in the...more >>

Timeout Expired
Posted by cheesey_toastie at 3/30/2006 8:39:07 AM
Hi, I'm connecting to a SQL server (7.0) from Excel and VBA. I've checked the VBA and don't think I've got this wrong but I keep getting a Timeout Expired error message. Is there a setting in SQL that I am not aware of that I need to set? Could it be the connection string I use? The...more >>

Bind Variable in CURSOR
Posted by traceable1 at 3/30/2006 7:13:25 AM
SQL Server 2000 SP4 with AWE hotfix. Windows 2003 SP1. I have a stored procedure which is not working the way I think it should be. I have a CURSOR which has a variable in the WHERE clause: DECLARE get_tabs CURSOR local fast_forward FOR SELECT distinct tablename, id, shcontig1dt, sh...more >>

Automatic statistics update
Posted by Chris Weston at 3/30/2006 6:07:04 AM
Hi. I have automatic statistic update turned on for all my databases. Is this an overhead I can do without? Could I update them overnight when the database is hardly in use? Thanks -- Chris Weston ...more >>



Full text indexing with Japanese characters problem
Posted by ibiza at 3/29/2006 7:56:36 PM
Hi all, I am quite experimented with SQL Server, but not that much with full text indexing. After some successful attempts with english fields, I've decided to try it with Japanese characters. I don't know why, but it seems to have a strange behaviour. As in this screenshot (http://img65.i...more >>

I'm sure this is an easy one...Error trap to skip over a "bad" object.
Posted by rod.weir NO[at]SPAM gmail.com at 3/29/2006 7:07:34 PM
Hello, I have the following code to iterate through each view in a SQL Server and call the "sp_refreshview" command against it. It works great until it finds a view that is damaged, or otherwise cannot be refreshed. Then the whole routine stops working. Can someone please help me re-write t...more >>

Sqlserver Login and user
Posted by waqarkust NO[at]SPAM gmail.com at 3/29/2006 6:09:57 PM
What is the diffrence between Sql Server Login and Sql server Database User? I want to put a funtionality in my application from where administartor make Application User. these application user will be made also in sqlserver.. Now I am confuse here In sqlserver Login and User Well I will make...more >>

Can this be optimized? Newbie question
Posted by wgblackmon NO[at]SPAM yahoo.com at 3/29/2006 2:59:16 PM
Hi, I'm running the following SQL to get values for 4 fields. It is unacceptably slow. I have no control over the structure of the database, field names, indexes etc. - what I'm given as far as DB design is all I'm going to get. If anyone could make any suggestions I'd really appreciate it! ...more >>

Transpose Rows to Columns ?
Posted by bogtom NO[at]SPAM gmail.com at 3/29/2006 2:32:41 PM
I have records ID Sku Name Date 2 41 Blair 01/04/03 3 45 John 03/04/03 that should look like... ID 2 3 Sku 41 45 Name Blair John ..... and so on. Number of source rows will be fixed (12) so no of target columns will be...more >>

database design for fast client updates
Posted by T.H.N. at 3/29/2006 2:24:43 PM
I'm trying to work out a database design to make it quicker for my client program to read and display updates to the data set. Currently it reads in the entire data set again after each change, which was acceptable when the data set was small but now it's large enough to start causing noticable ...more >>

Hiding NULL
Posted by jim_geissman NO[at]SPAM countrywide.com at 3/29/2006 9:43:16 AM
In SQL 2000 Query Analyzer, you can set up the text output pane to leave null values blank. That could give you this (assuming it's set to comma-delimited) -- CREATE TABLE #Test (A int, B int) INSERT #Test SELECT 1,2 INSERT #Test SELECT NULL,4 INSERT #Test SELECT 5,NULL INSERT #Test SELEC...more >>

Optimizing SQL - Union
Posted by das at 3/29/2006 9:02:18 AM
Hello all, I have a table with thousands of rows and is in this format: id col1 col2 col3 col4 --- ------ ----- ------ ------ 1 nm 78 xyz pir 2 bn 45 abc dir I now want to get the data from this table in this format: fiel...more >>

speeding up inserts
Posted by zelnaga NO[at]SPAM gmail.com at 3/29/2006 7:25:25 AM
according to the mysql manual, multiple inserts can be sped up by locking the table before doing them and unlocking the table afterwards. is the same true of multiple inserts in mysql? if so, how would the table be locked? any insights would be appreciated - thanks! ...more >>

Down and dirty database infrastructure
Posted by Beeker at 3/29/2006 6:41:21 AM
Does any have a link, or know of an MS book(s) that details the underlying database structure, tables, processes? Something that explains in detail how/why this stuff is configured and works, like DDL, TDS, varchar, int, index, tables, normalization, DML, Primary Key/Foreign key. ...more >>

2005:how to find installed assemblies
Posted by LLik at 3/29/2006 6:10:48 AM
Did this as a exercise and am fed up with my fruitless searching. Went and create an CLR assembly and all with min hassel. Now that I have that dll out there, I am tring to find some system table or some display in management studio that shows me where the file is located on the hard drive an...more >>

Stored procedure with unknown numer of paramters, how?
Posted by Igor at 3/29/2006 2:27:03 AM
I have one table with categories tblCategories cat_id | cat_name ----------------- 1 | cat 1 2 | cat 2 3 | cat 3 4 | cat 4 5 | cat 5 6 | cat 6 and one table with projects which relates to tblCategories tblProjects proj_id | pr...more >>

Problem with a join due to multiple Nulls
Posted by chudson007 NO[at]SPAM hotmail.com at 3/29/2006 1:40:10 AM
I want to join 2 tables by a unique ID field, but the ID field also has multiple NULLS which I do not want to ignore and I fear they will cause duplication. Using TableA and TableB below i will demonstrate the problem. TableA TableA.ID Field1 Field2 1 Paul 1 Null John 1 ...more >>

Update Table
Posted by Nothing at 3/28/2006 2:50:33 PM
I have a field, Y, in table A that I need to update from table B, matching on comman field X in both tables. Table A has 10K+ records with field X in it (Field X multipul times). Table B has only disctinct records in it based field X. Table B also has a colume Y that I need to copy to table A'...more >>

Stripping input mask from phone numbers
Posted by ILCSP NO[at]SPAM NETZERO.NET at 3/28/2006 1:55:42 PM
Hello, I have this Access 2K query that I need to re-create in MS SQL Server 2000, so I'm using the Query Analyzer to test it. One of the Access fields stores the home phone number. In the Access query, if the phone number is null, it fills it up with zeroes "000000000." If the phone has an i...more >>

Cursor looping versus set-based queries
Posted by JayCallas NO[at]SPAM hotmail.com at 3/28/2006 12:06:31 PM
I know this question has been asked. And the usual answer is don't use cursors or any other looping method. Instead, try to find a solution that uses set-based queries. But this brings up several questions / senarios: * I created several stored procedures that take parameters and inserts th...more >>

Odd query plan for view
Posted by JayCallas NO[at]SPAM hotmail.com at 3/28/2006 10:07:33 AM
I have a SQL 2000 table containing 2 million rows of Trade data. Here are some of the columns: [TradeId] INT IDENTITY(1,1) -- PK, non-clustered [LoadDate] DATETIME -- clustered index [TradeDate] DATETIME -- non-clustered index [Symbol] VARCHAR(10) [Accoun...more >>

Updating Linked Records Across DB's
Posted by johnrou NO[at]SPAM ci.green-bay.wi.us at 3/28/2006 8:39:23 AM
Here's a problem that I can't find anyone else has run into. I'm using Access and SQL Server, but the theory would be the same for any db. I have a large number of tables that contain linked records (intersection tables mostly). In the interest of space, I'll illustrate an example: tblS...more >>

Select first n rows of table
Posted by Andrew Lias at 3/28/2006 7:51:09 AM
Let us say that I have a table with two sets of values as such: Item Extension --- ---- 100023 1 100025 1 100025 2 100028 1 100029 1 100029 2 100029 3 [...] Note that a given item number can appear multiple times if it has more than one extension number. I w...more >>

Sql server report
Posted by Daniel at 3/28/2006 7:32:24 AM
Does SQL server have any build in generated report function ? or like pivot tables for analysing data ? Pls advise. Rgds Daniel ...more >>

Database poster
Posted by Beeker at 3/28/2006 3:32:40 AM
Does anyone know where to get posters for the database/objects/infrastructure for MS SQL 2005? ...more >>

Management Studio Express
Posted by Maury at 3/28/2006 12:00:00 AM
Hello, I downloaded and installed SQL Server 2005 Express and Management Studio Express CTP, but I noticed that there are several limitation in MSEE: for example I can't create a new database, is this true or I need some other tool? Thanks M.A....more >>

SQL Server 2005: Migrate DTS to Where?
Posted by Peter Nurse at 3/27/2006 11:22:31 PM
I have right clicked on my DTS package and selected Migrate... I assumed this is a good idea for future upgradeability (?) The process worked without error but I have no idea where the resulting migrated package can be found. The DTS package itself (apparently) remains unchanged. If your an...more >>

How to fire a trigger without changing table data
Posted by John Smith at 3/27/2006 8:55:19 PM
I have tables that I want to fire either an update or insert trigger on. I could write a script containing a long list of inserts but I'm looking for something simpler. Would isql work? Any special conditions to get it to work? I've tried tricks like 'update x set col = col' or 'update x s...more >>

Row Numbers for a View
Posted by Andrew Lias at 3/27/2006 4:32:09 PM
I've been given a task that I believe is, basically, impossible, but I'd like to see if there's a way to do it. What my boss wants me to do is to create a view, in SQL Server 2000, that will provide not only a row number field of some sort, but that will produce sequential ordering for arbitr...more >>

ranged datetime predicates & cardinality estimates
Posted by scott.swank NO[at]SPAM gmail.com at 3/27/2006 2:16:48 PM
Hello all. I'm running SQL Server 2000 and I'm trying to get a very few, recent rows of data from a table based on an indexed datetime column. Here's my predicate: where order_date > dateadd(hour, -1, getdate()) i.e. everything more recent than one hour ago. This corresponds to the 3 or ...more >>

Order by in a INSERT INTO..SELECT
Posted by pb648174 at 3/27/2006 11:24:43 AM
I have the following basic statements being executed: Create a temp table, #TempPaging Insert Into #TempPaging (Col1, Col2) Select Col1, Col2 From SomeOtherTable Order By Col2, Col1 Select * from #TempPaging I can't provide a reproduceable scenario right now without making this into a ...more >>

Assigning group numbers for millions of data
Posted by jacob.dba NO[at]SPAM gmail.com at 3/27/2006 9:58:55 AM
I have a table with first name, last name, SSN(social security number) and other columns. I want to assign group number according to this business logic. 1. Records with equal SSN and (similar first name or last name) belong to the same group. John Smith 1234 Smith John 1234 ...more >>

Where to write XQuery statements?
Posted by Shilpa at 3/27/2006 3:50:00 AM
Where to write XQuery statements? ...more >>

I need help, please
Posted by Newsgroup at 3/27/2006 12:00:00 AM
I have a problem with my sql server. I use a lot of Request.QueryString("Index1") But the Request.QueryString is always the same. I use in If-Loops. The server send me the follow message: Response Buffer Limit Exceeded Execution of the ASP page caused the Response Buffer to exceed its co...more >>

SQL Server 2005: Collation Conflict Error when selecting Database Properties
Posted by Peter Nurse at 3/26/2006 4:58:46 PM
I have just upgraded to SQL Server 2005 from SQL Server 2000. In Microsoft SQL Server Management Studio, when I click on database properties, I receive the following error:- Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in th...more >>

LDAP authentication for Yellowfin on SQLserver
Posted by duncan beaumont at 3/26/2006 4:42:35 AM
Hi, - SQLserver 2000 - Yellowfin 2.4 - Windows 2003 server I have been asked to investigate seting up LDAP authentication to access our Yellowfin reporting. If anyone has experience in setting this up? Your help would be appreciated. Tips and tricks .. ?? Thanks Duncan Beaumon...more >>

Multiple Foreign Keys on Same Table
Posted by FreeToGolfAndSki at 3/25/2006 7:41:59 AM
Hi, I have an Orders Table that has Employee1 and Employee2 (one is the sales rep the other is the telemarketing rep) Both of these fields need to cascade update against the Employees table. I can't seem to create the desired relationship in a Diagram and I'm not sure how best to set this u...more >>

Multiple Foreign Keys on Same Table
Posted by FreeToGolfAndSki at 3/25/2006 7:41:49 AM
Hi, I have an Orders Table that has Employee1 and Employee2 (one is the sales rep the other is the telemarketing rep) Both of these fields need to cascade update against the Employees table. I can't seem to create the desired relationship in a Diagram and I'm not sure how best to set this u...more >>

Query/View: The 2 newest periods for each indicator
Posted by Ryan Dahl at 3/24/2006 11:08:18 PM
Hi, I'm working on a simple performance-program, where I need to extract information from the 2 newest periods for every performance-indicator - And from there calculate a trend between these results. The problem is, that I can't find a simple way to extract the 2 latest results. The Tab...more >>

Copying encrypted stored procedures.
Posted by nickwilson.nick NO[at]SPAM gmail.com at 3/24/2006 1:44:50 PM
I have several stored procedures, created in a development environment, that I need to move to a 'QA' environment, and then in turn, to various production environments. When I move these stored procedures, I would like to encrypt them, using the 'WITH ENCRYPTION' clause. My question is, how d...more >>

French characters are not imported properly with bcp
Posted by Wael at 3/24/2006 10:30:10 AM
Hi I have a script that uses bcp to import data from an ascii text file into SQL tables. The french characters are not copied properly. They are converted to letters of the alphabet. I tried to change all the fields to nvarchar instead of varchar and nchar instead of char, but I got Greek chara...more >>

Accessing Oracle Tables From Within SQL Server 2000
Posted by Mark D Powell at 3/24/2006 9:05:08 AM
We are running SQL Server 2000 SP3. We have linked servers in use that we use to access Oracle tables. Recently the claim has been made that you can access Oracle tables from within SQL Server without using a Linked Server. I searched Books Online using keywords: linked, remote, and Oracle a...more >>

Licensing Question
Posted by jaustin NO[at]SPAM nautalex.com at 3/24/2006 7:27:46 AM
We are about to build web application that connects to a MS SQL database. We are planning on building the application to connect to the database through one user account, say "webuser" that all visitors to the site will use. For example let's say the site is an online store (for simplicity) an...more >>

SQL Server 2005 install - no Management Server
Posted by traceable1 at 3/24/2006 6:54:56 AM
I installed SQL Server Enterprise 64-bit. The installation seemed to go fine, except the only thing listed under "MicroSoft SQL Server 2005" is "Configuration Tools" in the startup menu. I have no Management Tools. Visual Studio 2005 is also installed on the box, and I read that because ...more >>

Grant Win Acct Permission
Posted by wackyphill NO[at]SPAM yahoo.com at 3/24/2006 4:51:37 AM
I'd like to grant a WIndows account permission to connect to a db and exec stored procedures. But am having trouble. I want this type of effect but can't get the syntax correct: USE MyDB GO CREATE USER 127.0.0.1\ASPNET --ASPNET Account for current machine GO GRANT EXECUTE ON AllStored...more >>

Help selecting an alias
Posted by Pumkin at 3/24/2006 4:20:49 AM
Hello guys, I need help in something as I don't know if it is possible what I want. I have a select like this... SELECT Cod1 as SQL, Cod2 as Oracle FROM table and I need to sort by alias SQL or Oracle as the select is composed dinamically so it could be either Cod1 as SQL or Cod2 as SQL and...more >>


DevelopmentNow Blog