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 > march 2007 > threads for monday march 26

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

Parameterising DB Names
Posted by obelix at 3/26/2007 8:02:10 PM
I've got cross database joins in s-procs and triggers. For ease of deployment I would want to refer to db names through a variable but I have tried this without success: a rough e.g declare @db_name varchar (20) set @db_name = 'my_database' select * from @db_name.tbl This is for MS SQL ...more >>

Restore database help
Posted by bubbles at 3/26/2007 5:58:58 PM
SQL Server 2005 Enterprise. I had tried to take a database offline, then cancel it midway as it seemed to take very long. Now I cannot connect to this database. How can I restore this database? Thanks, Bubbles ...more >>

Run Stored Procedure as a Scheduled Job
Posted by bubbles at 3/26/2007 5:53:19 PM
SQL Server 2005 Enterprise version. I have a stored procedure that executes several stored procedures. The SPs were set up individually for ease of debugging, then run as a batch. Individually and as a batch, they run fine. How do I set up this SP to run as a scheduled batch? I need to ru...more >>

Emulate Oracle's "Sequence" on SQL Server 2000/2005
Posted by Aamir Mahmood at 3/26/2007 4:53:23 PM
Is there any equivalent of Oracle's Sequence in SQL Server 2000/2005? Or can I emulate it somehow? Thanks, Amir Mahmood. ...more >>

Temp tables inside a stored procedure
Posted by MarkusJNZ NO[at]SPAM gmail.com at 3/26/2007 4:49:19 PM
Hi, I have some temp tables inside a stored procedure. Is it good practice to explicitly drop these temp tables at the end of the stored procedure or will MSSQL drop them for me? Obviously, best practice would not to have temp tables in the first place but I am unable to avoid this scenario. ...more >>

Need SQL 2000 equivalent of a SQL 2005 based query
Posted by Aamir Mahmood at 3/26/2007 4:45:04 PM
Hi, Could anyone please help me write a SQL 2000 compatible query for the following query. The following query runs perfectly on SQL 2005, but NOT on SQL 2000. --- select t.name, c.name, c.is_computed from sys.columns as c join sys.tables as t on c.object_id = t.object_id where c....more >>

Stop when SUM Count =
Posted by Karch at 3/26/2007 4:01:35 PM
I have a table that looks something like this: CREATE TABLE [dbo].[Counter]( [ID] [int] IDENTITY(1,1) NOT NULL, [Date] [datetime] NULL, [Count] [int] NULL, [Product] [int] NULL ) ON [PRIMARY] Given a specific date (today), I want to sum the values in the [Count] column (starting wit...more >>

Bulk insert error -- "Unknown version of format file"
Posted by Peter Nofelt at 3/26/2007 3:36:39 PM
Hi all, ISSUE: ==================== In SQL 2005 (sp2) I get the following error when preforming a bulk insert with an associated xml format file: "Could not bulk insert. Unknown version of format file" Question: ==================== I am unsure what they mean by "unknown version". Spec...more >>



stored procedure
Posted by at 3/26/2007 3:32:28 PM
I have stored procedure that is doing alot read high I/O, it is doing clustered index scan on the Order Summary table. here is the text of the SP. Can you please help identify what index I need to add or change the way the stored proceure are writen. Thanks in Advance! ----------------------...more >>

Stored procedure
Posted by at 3/26/2007 2:50:45 PM
I have stored procedure that is when executed , it does Clustered Index Scan on he below table with alot of read . the Table JDEOrderSummary has over 3 Million record. Here is the DLL for the table . Can any one help me identify what column should be indexed to be able do clusterd index seek a...more >>

sql server 2005
Posted by JJ at 3/26/2007 1:39:05 PM
SQL Server 2005 express. Two questions..... 1. What are default permissions of the owner of the schema with regard to objects (tables, stored procedures belonging to particular schema)? Same for database owner? Will the owner have all permissions by default or do i need to explicity grant pe...more >>

table returning udf
Posted by nkg at 3/26/2007 11:09:21 AM
Is it possible to pass a table's column name as a parameter to a UDF which returns a table? I just need a rough syntax something like select * from dbo.split(select [name] from employee,' ') ...more >>

FIFO Cost Calculation
Posted by Monty at 3/26/2007 5:00:37 AM
Hello, I'm attempting to calculate FIFO cost for outgoing items from my Inventory Transactions table. The table has a TransactionType field that indicates the transaction is either (1) items received (positive), (2) an adjustment (positive or negative), or (3) a sale (negative). It also has...more >>

Ordering by a Date in Stored Procedure
Posted by richard NO[at]SPAM ultraitsolutions.com at 3/26/2007 3:44:57 AM
I am trying to Order results from a stored procedure depending on the columns that the user clicks on the DataGrid. The user end works fine, but I cannot get the sorting correct in my Stored Procedure. At the momnent I use a variable called @SortBy and then use this code in my Stored Proced...more >>

Why does not LIKE operator work on ntext values in my query batch !!! Please, check me
Posted by Orgil at 3/26/2007 2:37:58 AM
/* This is only for example, but my database has to have many values and queries like this. */ I have a table named "table2". Its create statement is below: CREATE TABLE Table2 ( [id] int IDENTITY (1, 1) PRIMARY KEY CLUSTERED, [value] ntext COLLATE SQL_Latin1_General_CP1_CI_AS NULL ...more >>

Converting string to unicode string in T-SQL
Posted by yashgt NO[at]SPAM gmail.com at 3/26/2007 1:06:41 AM
Hi, We have stored proc name proc_test(str nvarchar(30)). So far this proc has been invoked from a .NET application assuming that only English character strings will be passed to it. The calls are like proc_test('XYZ') We now have a requirement for passing Chinese strings as well. Rather tha...more >>

replace value
Posted by Per Henrik Oja at 3/26/2007 12:00:00 AM
Hi. I'm trying to build a field from the values in 4 other fields. The four fields contain 0's and a 1's to mark involvement in a project. So the table looks about like this: CompanyName: Microsoft Inc. ContactPerson: Bill "Humor me" Gates Is_involved_in_watergate: 1 Is_involved_in_iRack:...more >>

what wrong with this
Posted by Calvin Willman at 3/26/2007 12:00:00 AM
ALTER FUNCTION [dbo].[fn_KPI_GET_EXCL_PRODUCTS] ( @CustomerID int ) RETURNS TABLE AS RETURN ( IF (SELECT COUNT(ProductCode) from dbo.KPI_PROD_CDE_EXCL AS ProductCode WHERE CustomerID = @CustomerID) > 0 BEGIN SELECT ProductCode from dbo.KPI_PROD_CDE_EXCL AS ProductCode WHER...more >>

Help with a view
Posted by Rob at 3/26/2007 12:00:00 AM
CREATE TABLE [dbo].[tblManyToMany] ( [Ord] [char] (10) NULL , [Inv] [char] (10) NULL , [FrtKey] [char] (10) NULL ) ON [PRIMARY] GO INSERT INTO tblManyToMany Values('1','1','XYZ') INSERT INTO tblManyToMany Values('1','1','ABC') INSERT INTO tblManyToMany Values('1','1','DEF') INSERT INTO...more >>

Loadbalancing and Failover for SQL Server and IIS!
Posted by Jay Balapa at 3/26/2007 12:00:00 AM
Hello, We have two Windows 2003 servers one running IIS and another for SQL Server. We are at a stage where we need to load balance and provide a failover. Can you show us a technical document which can help us do that? Thanks. -jay ...more >>


DevelopmentNow Blog