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 > december 2005 > threads for wednesday december 21

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

Create 3 users tables
Posted by Miguel Dias Moura at 12/21/2005 11:10:00 PM
Hello, In my web site I have 2 types of users: students and professors. All users need to login but the personal information for each user type has different fields. So I create 3 tables: professors, students and authentication, "professors" will have all the personal data from professors....more >>


why is it giving output ?
Posted by Manish Sukhija at 12/21/2005 10:34:01 PM
Hi, when i run this query select * from personal where phone > '40-8496-7223' it works fine, eventhough i declared phone as varchar type, it should not operate on > operator. what could be reason...more >>

How to insert data into table varialable in a sp from dynamic table
Posted by John Smith at 12/21/2005 7:09:32 PM
In my sp,I want to get some data from a table which name is dynamic ,and insert the data to a table varialbe,in other words,look like below: StoredProcedure ( DECLARE @TABLENAME VARCHAR(255) DECLARE @MyTABLE TABLE (ID INT,NAME VARCHAR(255),AGE INT) INSERT INTO @MyTABLE ...more >>

data content comparison
Posted by GB at 12/21/2005 7:05:10 PM
Hello: I'm looking for a free tool or procedures to compare data content of two tables which belongs to different servers. Each table does not have any indexes or primary key. I need this as verification procedures for my log shipping process. Thanks, GB ...more >>

Lock and update problem
Posted by GM at 12/21/2005 5:38:26 PM
Hello, I use sql server 2000. I want to create the following stored procedure: I have a table with serveral field including the field "isqueued" I want to select one record (select top 1) from the table and immediatly update the iqueued field to "true" while locking the record. This to make...more >>

Problem connecting to SQL Server 2005
Posted by Pascal Berger at 12/21/2005 5:18:49 PM
Under certain circumstances there seems to be a problem connecting a SQL Server 2005 (Final Release). The connection is done with a Delphi Application using an ADOConnection (SQLOLEDB.1 provider): - Setup a vanilla WinXP PC (Seems to also appear under Win98, WinME, and probably every versio...more >>

Please help - setting order of select in a self-referencing table
Posted by Alan Silver at 12/21/2005 5:11:22 PM
Hello, I have a table of product categories that looks like this (air code, so could be some typos, but it's basically right)... create table producttypes ( ptype int not null identity(1,1) primary key, typename varchar(50) not null default '', ParentCat int references producttypes(ptype)...more >>

Stored Procedure Script
Posted by Bil Click at 12/21/2005 5:04:02 PM
I would like to run a script that takes some variables and creates a view and stored procedure. I keep getting an error saying "'create view' must be the first statement in a query batch". What is the correct way to do this? DECLARE @custview varchar(50), @custID varchar(10) SET @custview ...more >>



How to debug SQL Stored Procedure on 2005
Posted by Shimon Sim at 12/21/2005 4:50:37 PM
I can't debug SQL Stored Procedure on SQL Server 2005. I don't see any options in Management Studio and in VS.NET 2005 I see options but it is disabled. What should I do? Thank you, Shimon ...more >>

Electrical Symbols - Ohms - micro
Posted by Jedawi at 12/21/2005 3:45:38 PM
Hi, would anyone be able to point me in the right direction on how to save the electrical symbols for ohms and micro in a sql server field. Many thanks, ...more >>

Is it possible to insert a PDF File into a SQL 2k Table?
Posted by Jorge Luzarraga Castro at 12/21/2005 3:17:41 PM
Hello, I want to develop a small PDF Management System for our Web Insurance Systems and I´m wondering if I can use SQL Server to save my generated PDF Documents. Is it possible? If so is it suggested? Are there any other alternatives? -- Jorge Luzarraga C Fidens S.A. 321 7610 Anx 23...more >>

Consolidation problem
Posted by tshad at 12/21/2005 2:52:51 PM
I have 2 tables. In the User Table I have a UserID and the CompanyID of the Company he belongs to. In the second table (EmailBlocked), are the users or company a particular user has blocked. If a user blocks a company, then all users in that company are blocked. If the company is not b...more >>

Problem reattaching database
Posted by iScanTeam NO[at]SPAM community.nospam at 12/21/2005 2:49:02 PM
I am writing a program in vb6 to move a database and its log file from one directory to another using sp_attach_db and sp_detach_db. I used 'sp_detach_db mydb' to detach the database, moved it to the new directory location and then tried to attach the database using the command: 'sp_attach_db...more >>

Book Recommendations
Posted by Jedawi at 12/21/2005 2:42:58 PM
Hi, am after a book or two on TSQL and Stored Procedures, any recommendations would be much appreciated. Cheers ...more >>

How to update the newest of several records
Posted by Terry Carnes at 12/21/2005 2:42:31 PM
I'm writing a stored procedure that updates a record in a table which is keyed by [ID_No], [Sub_ID] and [TimeStart]. I can easily find the record to update by finding the Top 1 Where [ID_No] and [Sub_ID] are the IDs I want and I Order By [TimeStart] Desc. I am wondering if there is a more ...more >>

SVF in CLR with Nullable Parameters
Posted by I/Gear at 12/21/2005 2:36:02 PM
I'm just learning to use the new CLR integration features of SQL 2005 and I created the following simple function: [Microsoft.SqlServer.Server.SqlFunction(IsDeterministic=true, SystemDataAccess=SystemDataAccessKind.None)] public static SqlString Foo(DateTime dtStartDate, DateTime dtE...more >>

Which Way is More Efficient - Declare Variable or Use Single Quote
Posted by RitaG at 12/21/2005 2:16:02 PM
Hello. Could somebody please tell me which is more efficient: 1) To declare a variable and set it to a value and then use the variable thoughout the SQL code. E.g. DECLARE @PL Char(2) Set @PL = 'PL' When Left(MyColumn,2) = @PL Then When MyColumn2 = ...more >>

CHARINDEX in CASE Within SELECT Statement
Posted by RitaG at 12/21/2005 2:11:02 PM
Hello. I need help with using CHARINDEX. I have a column in a table (Discount_Specification) that could hold the following values: LF(I03U,CHA-14,ALL-0) MR(I05U,I06U,CHA-5) etc. I'm inserting into another table and need to pick up the value following "CHA-" in that column. I've c...more >>

Problem Using Alias
Posted by joeacunzo NO[at]SPAM yahoo.com at 12/21/2005 1:43:29 PM
I need a select that sums the same column, but with different criteria. I also need to "roll up" the sums into a "higher level" sum based on some other tables. This is an accounting database, where subaccounts roll up into a single account (i.e. subaccounts 101 and 102 roll up into account 100)...more >>

Dyanamic Where Clause
Posted by John at 12/21/2005 1:12:30 PM
Can anyone advise how i resolve this in SQL, I have the following Stored procedure : CREATE PROCEDURE sp_jp_report_won_lost_open_test @datestart as varchar(12), @dateend as varchar(12), @Region as varchar(25), -- e.g. Scotland @Territory as int, --ie 901232 @ReportType as Varchar(7)...more >>

EXECUTING PACKAGES from vb.net
Posted by Gina Hernandez at 12/21/2005 1:10:14 PM
Hello: I have a web application from where I need to execute a DTS, my platform is SQL 2000 and .net 2003. From a Vb.net module I want to execute the package, my question is: does the package need to be STRUCTURED STORAGE FILE or could it be SQL SERVER package (local to the server)...more >>

Default Value Calculation
Posted by Asp Psa at 12/21/2005 11:20:51 AM
Hi, Is there a way to calculate the Default Value of a column with other data columns? Using "date_of_birth" column and "screen_date" columns, I would like to calculate the "age" automatically with the Default Value definition. Please let me know if it's possible. YC ...more >>

Deadlock updating different rows
Posted by rand at 12/21/2005 10:17:13 AM
Here is the condensed version of my question: why do I get a deadlock when multiple threads are updating different rows in the same table? Details: I have a table with a clustered index spread across multiple columns. I run multiple threads, each of which accesses a separate row in the table....more >>

Performance - php scripts
Posted by culam at 12/21/2005 10:06:01 AM
A vendor wrote a php script to manipulate date within SQL Server, basically process data from 1 table and copy the data to multiple tables within the same server. He said the preformance for others client run really fast, except for ours. Our process run about 1 record (40 fields) per second...more >>

script out table definition and data
Posted by sqlster at 12/21/2005 9:42:02 AM
Is there any free download tool that I could use to script out table definition along with the data? There is a tool by vyas but it was not scripting out correctly. I don't mean to say wrong things about the tool but may be it was "my bad"!! When I used that tool, it was chopping out some ...more >>

stored procedure -> this.getName()
Posted by peppi911 NO[at]SPAM hotmail.com at 12/21/2005 9:39:14 AM
hi, ist there a way to retreive the name of the procedure i am actually in, to send an email with error/name of the procedure? CREATE PROCEDURE xyz as begin if @error<0 sp_sendMessage @error ??@getName -> xyz?? end thanks, mike ...more >>

Strange result associated with execution of stored procedure
Posted by Jack at 12/21/2005 9:23:04 AM
Hi, I got a stored procedure which is as following: CREATE PROCEDURE sp_parmSailorRanking @ClubCode varchar(50), @Rank varchar(10) AS SELECT People.PeopleID, People.PeopleNameLast, People.PeopleNameFirst, People.PeopleProfessionalClass, People.PeopleClubCode, Rank.Year, Rank.Month, R...more >>

No retrieving dupicate rows
Posted by Mike9900 at 12/21/2005 9:19:01 AM
I need to get rows without dupicate ProductID. In the below query, the subquery return 1 row, which is fine. But the query itself returns 2 rows because the TransactionDate has two same date. I want the quesry to return only one row if it has the same ProductID. For example the records: ...more >>

How to find the triggers in a database
Posted by Geoff Pennington at 12/21/2005 8:59:11 AM
One of the databases I work with has several triggers and one of them is throwing an error. I thought I knew which table it is on, but that table has no triggers. Is there an easy way to identify all the triggers in a database? Much obliged, Geoff. ...more >>

Login Failed error 18456
Posted by RSH at 12/21/2005 8:54:48 AM
I was reviewing our logs from yesterday and today and I have probably 100 errors: 12/21/2005 08:30:26,Logon,Unknown,Login failed for user 'ApplicationUser'. [CLIENT: 1.1.1.119] 12/21/2005 08:30:26,Logon,Unknown,Error: 18456<c/> Severity: 14<c/> State: 16. This is the login that we are u...more >>

case and group by problem
Posted by Sammy at 12/21/2005 8:23:03 AM
Hi I have this code below it gives me the right results but there are load of null values. Is there a way to group by on a case statement to elimiinate these nulls to smarten up ther report select ,c.name ,c.custno,c.salesno, case catno when 'n' then sum(qtyshp* netprice) end as 'Cat-N', ca...more >>

Service Broker - BEGIN DIALOG CONVERSATION @dialog_handle
Posted by bvbone69 NO[at]SPAM yahoo.com at 12/21/2005 8:08:04 AM
what is @dialog_handle? i assumed it was the same value as conversation_handle in my dbo.MyQueue table but looking at these values they are different. when i do SEND ON CONVERSATION @dialog_handle... i see the message appear in dbo.MyQueue, but conversation_handle holds a different value....more >>

Performance
Posted by mvp at 12/21/2005 7:37:02 AM
Hello Everybody, We have arround 10 reports, i have written store procedures and i have created proper indexes on all the required columns. When i run specific report, it takes around 40 secondes but when around 20 users log in to the system (we have microsoft reporting server as a reporting ...more >>

XP_smtp_sendmail
Posted by Peter Newman at 12/21/2005 7:09:04 AM
We have SQL2000 and Exchange server 2003 I have been trying to send out an email from the SQL server using the XP_smtp_sendmail stored procedure. If i address it to an email address within the company ie me @mycompany.co.uk it works fine, however if i try to send it outside of the com...more >>

How to Restore an Archived Filegroup on Another Server?
Posted by Zarrin at 12/21/2005 7:08:36 AM
Hello, I have several archived filegroups that have data in them partitioned based on the date. These filegroups have been removed from database after archival. For example two months ago. Meantime my production database is populating everyday. Now I would like to restore one of my old arch...more >>

Would like an Exists in a Case statement
Posted by yitzak at 12/21/2005 6:57:50 AM
I'm writing a select statement to to show products which have been sold in the past 6 months and those not sold recently. SELECT ShopID, PTypeID, ProdID case WHEN MAX(Trandate) < '20050601' then 1 else 0 end as Unused FROM tblShopSales GROUP BY ShopID, PTypeID, ProdID for each prod...more >>

i want help to build a application that will load data in msolap
Posted by kuldeep kumar at 12/21/2005 6:10:04 AM
Hi , i am new to msolap , i want to make an application that will update data or insert data in msolap. Any link , help ,book,sample program will be helpful . thanks in advance . kjangir...more >>

Collation issue
Posted by Enric at 12/21/2005 5:45:02 AM
Dear all, I''ve got a database which own sql1_latin1_General_cp1_ci_as. That's fine. I'd like to change the current collation for 'Traditional_Spanish_CI_AS' using the following statements: 1-ALTER DATABASE bdtestman SET SINGLE_USER with rollback immediate 2-ALTER DATABASE bdtestman COLLAT...more >>

Indexed view wrong count
Posted by Bart Holthuijsen at 12/21/2005 3:59:02 AM
Hi all I seem to have a problem with an indexed view, the count returned by the view is not the same as the actual record count in the database. The table definition is as follows: CREATE TABLE [dbo].[CursusBijdrageAanvraagCursist] ( [CursusBijdrageAanvraagCursistID] [bigint] IDENTITY (...more >>

how to duplicate my database?
Posted by Naby at 12/21/2005 3:49:02 AM
Hello guys I have to do a demo and I need to bring my database with me...how can I do that. I have ms sql server 2000. Is there a way of executing a script or something? Thanks...more >>

Urgent Requirement for identity
Posted by Chinnappa at 12/21/2005 1:40:03 AM
hai i have a requirement Is there any query available to set identity increment value to '2' . at present it is '1' without using table design mode. Thanks in advance for any help...more >>

SQL Server with Access2000: Unique identifier and Dates restriction
Posted by Amir at 12/21/2005 1:21:58 AM
Hi, I am a newbie using SQL Server 7 with Access 2002 I have a DB with 2 tables. The first table is called EVENTS, and it's primary key is EVENT_ID (field type is UniqueIdentifier). The second table is called Z_EVENTS (field type is UniqueIdentifier) and it's primary key is Z_EVENT_ID (f...more >>

List only the visible columns in a view?
Posted by Paul Ritchie at 12/21/2005 12:20:08 AM
In SQL Server 2005, when using INFORMATION_SCHEMA.VIEW_COLUMN_USAGE I get a row for every column in a view including those that might not be visible but used only in the WHERE or ORDER BY clauses for example. Is there an easy way to reduce the list to only show the columns that actually appear...more >>

SQL sequence of subprocedures
Posted by peppi911 NO[at]SPAM hotmail.com at 12/21/2005 12:19:03 AM
Hi, i have a general question about stored procedures. If have a procedure and call other procedures within, do they always wait for each 'line' to finish or do they run parallel? say i have got an id = 9 exec sp_insert 9 exec sp_update 5 is it save that the insert sp is always running...more >>


DevelopmentNow Blog