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 > october 2005 > threads for friday october 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

CASE statement in dynamic query
Posted by Dan Slaby at 10/21/2005 9:52:01 PM
This query runs ok: SELECT Mission FROM tblProviders WHERE ProviderID = 'rnpo' When I pass the @providerID and @WhichOne values dynamically to this stored procedure: DECLARE @ProviderID varchar(15) SET @ProviderID = 'rnpo' DECLARE @WhichOne int SET @WhichOne = 1 DECLARE @QRY varchar(1...more >>


Adding column problem
Posted by Karolus at 10/21/2005 7:12:01 PM
I consulted the SQL2K help for adding a table and copied the code and substituted my own variables, but I get an error message about incorrect syntax regarding the AS in line 1. I'm a newbie and am bummed that the code provided in the help doesn't work--I'm assuming there's something I don't ...more >>

Date time trouble in JTDS.
Posted by tutm at 10/21/2005 5:36:56 PM
Hi all, I have data in the table myTable like following: myTable_oid, myTable_Time 1, 2005-10-21 10:58:34.531 And I want to perform the SQL query in java code using JTDS, like: SELECT myTable_oid, myTable_Time FROM MyTable WHERE (myTable_oid=? AND myTable_Time>=?) ...more >>

Internal SQL Server error
Posted by rdjabarov at 10/21/2005 4:02:03 PM
Running the script below will result in this error in SQL2K SP4 environment: create view dbo.vw_INTERNAL_ERROR as select top 100 percent * from (select top 100 percent [DateField]=getdate() order by 1) x1 go if exists (select 1 from dbo.vw_INTERNAL_ERROR) print 'Exists' else prin...more >>

Time only values
Posted by MurrayTh at 10/21/2005 2:53:01 PM
I have a table with time values in one field. The field is datetime data type with no date entered. During some processing, I want to offset the time in the schedule by a number of minutes, but keep the date value part "empty", even if the offset causes the time to cross a date boundary. ...more >>

How to quickly create and populate a table 1GB?
Posted by MittyKom at 10/21/2005 1:57:02 PM
Hi All How do i create a table which is as big as 1GB? I have tried some thing below, but it it taking too long. Is there any quick way to do it? Here is my sample i have tried and it's taking too long: CREATE TABLE TableD ( X text) GO insert into tableD values (replicate('h', 5000...more >>

@@ERROR Handling
Posted by Mark at 10/21/2005 1:40:02 PM
To All Gurus: I am trying to log some information to another table when @@Error returns an error. Below is the sample code to see how @@error works. In this sample code, I am purposely failing INSERT INTO TEST command and want to log informaiton in TestLog. Even though there is a error but ...more >>

COM+ Applications hanging
Posted by Eric Margheim at 10/21/2005 1:34:55 PM
I have two ATL Dlls that have multiple interfaces and run under two COM+ Applications. Each DLL accesses SQL Server db via ADO calls and one of the components also interacts with a 3rd party report server system. We run into intermittent issues with the COM+ Application hanging. Our clien...more >>



HELP Cant get connection to my server with SQLDMO
Posted by SteveM at 10/21/2005 1:22:13 PM
I am trying to learn SQLDMO for working with our SQL Server 2000 servers. I grabbed a demo program from: http://www.csharphelp.com/archives2/archive342.html called SQLDMO for C# from Kevin Goss I built the program successfully in VS 2003 and it shows me a list of servers (mine being on the li...more >>

Trigger Problem
Posted by Ed Dror at 10/21/2005 12:58:41 PM
Hi there, I'm using MS SQL Server 2000 on Server 2003 One table emp and one empArchive I wanted every time that one record in the emp table will be inserted updated or deleted. Same thing will happend in the empArchive table. So I created three triggers look like this CREATE TRIGGER my...more >>

Slpitting a string
Posted by Asher_N at 10/21/2005 12:02:15 PM
I have a badly designed legacy database. The product number column has the format 'xxx -yyy', where x is the style and y is the colour. Both style and colour have a variable length. They are always separated by 3 blamks and a '-'. I need to be able to isolate the colour part in order to joi...more >>

How to alter DBCC INPUTBUFFER text output
Posted by Chris at 10/21/2005 11:57:03 AM
DBCC INPUTBUFFER(12) - This command returns what spid #12 is doing. (1 row(s) affected) DBCC execution completed. If DBCC printed error messages, contact your system administrator. I am 99% confident the output above "DBCC execution completed..." is choking my VB.NET client on th...more >>

DateTime - overlaping Timespans
Posted by mathiasfritsch NO[at]SPAM gmx.de at 10/21/2005 11:54:51 AM
Hi, I have a Table with reservations for Northwind Products: ReservationID ProductID StartDate EndDate Quantity I need to tell how much Reservations are still possible in a given TimeFrame. Is this possible without Cursor? Here is a sample: ID StartDate EndDate Quanti...more >>

Dates from multiple fields
Posted by Blasting Cap at 10/21/2005 11:35:04 AM
I have fields that are listed as nvarchar in a table. Field1 contains the month, Field2 contains the day, Field3 contains the year. I need to pick stuff off this table with a "date" >= 12/10/2004. How do you construct the "date" from the 3 fields above? I've tried cast & converts on it, ...more >>

Add Permission Stored Procedure!
Posted by Adam Knight at 10/21/2005 11:25:36 AM
Hi all, Just wondering, is their a system stored procedure i can use to grant permission to all objects in a specified db to a specified user ? Cheers, Adam ...more >>

multiple distinct and time...
Posted by Petr SIMUNEK at 10/21/2005 10:59:27 AM
Here comes the table: Id_Prices | Shop | Product | Price | tStamp -------------------------------------------------------------------------------------- 1 eMall Pen 10 20.5.2005 2 eMall Pen ...more >>

Add composite primary key
Posted by Rick Charnes at 10/21/2005 10:52:29 AM
I'm a bit unclear on the syntax to add a composite (multiple columns) primary key to a table. The columns already exist. Thanks....more >>

How to determine last "monthversary" date of an account?
Posted by White Echo at 10/21/2005 10:17:33 AM
I work on a project where advertisers on a classifieds Web site have the possibility to place a certain number of ads per month. The difficulty comes from the fact that a month period starts at each "monthversary", meaning that if somebody created his account on June 15, I would need to tak...more >>

Newbie : Hard sql query?
Posted by Sparticus at 10/21/2005 10:04:08 AM
Hey, I have a table that records all my bank transactions. So in it there is one entry per transaction. This entry has the date the transaction occured. All I want to do is perform a query that returns how many transactions I had for each month. Ie. jan : 24 transactions feb : 19 t...more >>

What is wrong with this SQL statement
Posted by Steen Persson (DK) at 10/21/2005 9:46:17 AM
Hi When I run the query below in QA, it works fine and gives me some results. When I try to run the same query in Microsoft Query from an Excel sheet, it fails. I get the error "No column was specified for column 1 of 'FSS'. Statements could not be prepared". The query I try to run is th...more >>

Aggregate Functions - and no records
Posted by Rebecca York at 10/21/2005 9:41:06 AM
Is the following statement documented/supported? I can't find it documented in BOL the results for Aggregate functions when there is no input data. If a Aggregate function gets 0 records input, it returns null. eg. SELECT MAX( Field ) AS ReturnsNull FROM ( SELECT TOP 0 1 AS Fiel...more >>

REPLACE query help plz!
Posted by Test Test at 10/21/2005 9:38:44 AM
Hello! I am posting this problem again. I have gotten somebody's help with the right solution but I have one more case to work on. I would appreciate your time and help on this. create table #temp (ID int, Cust varchar(80)) insert into #temp values(23, 'Name: abcd DBX: abcdefgh Addr1: 1...more >>

Zero Truncated
Posted by docsql at 10/21/2005 9:30:19 AM
We have a float (length = 8) field in the table. We want to store values out ot 4 decimal places. In some cases, where a value ended in 0 or 00, the places are probably truncated (e.g., 38.9560 = 38.956 or 38.6500 = 38.65). I would like for us to see the field value out to 4 places. In other...more >>

Export?
Posted by Adam Knight at 10/21/2005 8:39:32 AM
Hi all, I am needing to export the data contained in my database as series of sql insert statements? How do i do this in SQL Server? Cheers, Adam ...more >>

Full-text Catalog
Posted by bob at 10/21/2005 8:39:14 AM
I am have an application that uses a full-text catalog for word searching. I need to dsitribute this application so is there a way to distribute the full-text catalog with a script like I do for the database, sp's and triggers? Thanks ...more >>

multiple distinct and time...
Posted by Petr SIMUNEK at 10/21/2005 8:30:43 AM
Here comes the table: Id_Prices | Shop | Product | Price | tStamp -------------------------------------------------------------------------------------- 1 eMall Pen 10 20.5.2005 2 eMall Pen ...more >>

Automate Admin Activities
Posted by Tarek at 10/21/2005 8:13:01 AM
Hi, I want to automate some administrative activities (Check Integrity, Shrink DB Log Space after backup, rebuild indexes...). I'm using Database Maintenance Plan, is this ok? After I run these jobs, in the job history and in the log generated I just see that the activity succeded, but not w...more >>

Who Added Indexing to Table?
Posted by Colette at 10/21/2005 8:02:02 AM
Is there a script to query a table that will tell me the user that added the Indexing or the user that changed on table on a specific date? It appears to me this is not an option in SQL 2000. Any help is appreciated. Thanks....more >>

Retrieval of IDENTITY after "bulk" insert?
Posted by lmcphee at 10/21/2005 7:44:09 AM
I will be inserting large numbers of records into a table with an Identity column. I need the Identity value back to use for subsequent inserts to other tables which link to 1st table on the ID. I can insert to "parent" table one-by-one, retrieving the ID each time. INSERT INTO MyTable (M...more >>

Database Design
Posted by max at 10/21/2005 7:32:01 AM
Hello, I am not so experienced in database design and in my job now I have to design a database for publications. The problem is the design should be worked out as soon as possible.:( The publication database should contain the following details: Title Subtitle Authors Place of public...more >>

sql weird
Posted by Jose G. de Jesus Jr MCP, MCDBA at 10/21/2005 7:02:01 AM
create proc SQLweird as select * into #temp from employees exec('select * into #temp from employees') select * from #temp where is the result of or how can i access the result of the exec() statement -- thanks, ------------------------------------ Jose de Jesus Jr. Mcp,Mc...more >>

ETL Tools for EDI to DB Import
Posted by Joseph George at 10/21/2005 7:01:28 AM
Hello, We're trying to come up with a solution for loading large EDI (X12) batch files into a SQL Server 2005 system. We tried using Altova Mapforce which now has a code generation feature which can be compiled and run, but it does not seem to scale well for large data loads. Any one hav...more >>

Current Date Format
Posted by Madhivanan at 10/21/2005 6:49:00 AM
How do I know the current Date Format of the Database? Madhivanan ...more >>

ETL Tools for EDI to DB Import
Posted by Joseph George at 10/21/2005 6:45:46 AM
Hello, We're trying to come up with a solution for loading large EDI (X12) batch files into a SQL Server 2005 system. We tried using Altova Mapforce which now has a code generation feature which can be compiled and run, but it does not seem to scale well for large data loads. Any one hav...more >>

Primary Key Foreign Key Tables
Posted by thomson at 10/21/2005 6:41:04 AM
Hi All, i do have two table a Master and a Detail which has a primary key on the Master Table and Foreign key on the Detail Table How do i insist that when ever there is a entry in the Master table there should atleast exist one record in the Detail Table. Any sort of condition can...more >>

Move a table from filegroup??
Posted by Tarek at 10/21/2005 6:35:03 AM
Hi, I created a table in a wrong filegroup. Is it possible to move it to another filegroup? If yes how? Do I need to drop the table and create it in the new filegroup or this can be done online (like oracle's alter table t move ....). Thanks in advance, Tarek...more >>

Sort Warnings / Multi Pass Sort
Posted by parasada at 10/21/2005 5:12:02 AM
I traced my app for some perf related issues and found that a proc is giving Sort warnings (EventClass) and Multi Pass Sort (EventSubClass). Where in the query should I start looking into the problem? when do we get these warnings - BOL/msdn doesn't explain in dtl; it just says that - The Sort...more >>

Trigger to capture the new record only
Posted by MartinTeefy at 10/21/2005 4:58:03 AM
Hi, I want to write the second field from customer table (cm_name) to another table to act as a lookup. This table LICENCINGLOOKUP has two columns (LookupType,LookupValue) For this insertion the first is set to 'CUSTOMER' but it appears all records from the customer table are trying to ...more >>

please solve timeout error
Posted by raghu veer at 10/21/2005 4:14:03 AM
i am facing timeout error problem on my server using dot net applications how to solve this will no lock option causes this...more >>

SQL Query
Posted by savvaschr NO[at]SPAM nodalsoft.com.cy at 10/21/2005 2:09:13 AM
Well Actually I have this situation I have a table with AccCode, AccMovement, AccYear, and AccPeriod and my data looks like this AccCode AccYear AccPeriod movement 110401 1998 02 541870.00 110401 1998 03 1210000.00 110401 1998 04 2687330.00 110401 1998 0...more >>

Getting ASP.NET 2.0 user name in Sql Server 2005 trigger
Posted by Mike Kelly at 10/21/2005 2:04:01 AM
Hi. I'm using ASP.NET Membership and Role Management (Forms authentication) to secure my web application (accessible to a restricted user base via the Internet). This is such a great feature of ASP.NET 2.0. My app accesses data in a Sql Server database which is running on the same box as I...more >>

T-SQL...How to set column collation to database default?
Posted by throat.wobbler.mangrove NO[at]SPAM gmail.com at 10/21/2005 1:59:01 AM
Hi, Does anyone know the T-SQL code I need to set the collation of a column to the database default? Following books online, I have tried: ALTER <TABLENAME> ALTER <COLUMNNAME> COLLATE DEFAULT GO but this doesn't seem to be correct. I'd be grateful for any assistance! Many thanks....more >>

NEED HELP ABOUT CURSOR
Posted by savvaschr NO[at]SPAM nodalsoft.com.cy at 10/21/2005 12:55:37 AM
Hello, I have this Store Procedure and i am new in "Cursor" programming The store Procedure is this CREATE PROCEDURE Testing_Cursor AS DECLARE @AccCode varchar(12) DECLARE @YEAR varchar(4) Declare CODE CURSOR FOR SELECT DISTINCT(NLAcc_Code) FROM NLMovement_TMP OPEN CODE BEGIN FETCH ...more >>

info about sysprocesses
Posted by Enric at 10/21/2005 12:37:03 AM
Dear all, I want to know all the possible values for the status field bring up for sysprocesses table. Values such 'running' or 'sleeping' seems very evident but there is one so-called 'DEF-WK...' or something like that which I haven't idea. In this occasion I am not be able to find it in...more >>

Newbie - Student - Help
Posted by Deanna Cusic at 10/21/2005 12:22:34 AM
I am working on an assignment that was due at midnight. The question is = using the "Northwind database write the following SQL statements to be = executed against on of the tables within the "Northwind database" a.) Alter a table and add a column b.) Alter a table and add a constraint c.) A...more >>

NOLOCK
Posted by Lara at 10/21/2005 12:00:00 AM
Hi can any one tell me about the use of NOLOCK. Whrere can we use it and where dont ? pros and cons of the above ? rgards lara ...more >>

Creating multiple Stored procedure on SQL Server through ADO
Posted by Pushkar at 10/21/2005 12:00:00 AM
Hi, I want to create a set of procedures through my application on SQL = Server, through ADO. My Scipts is something of the form: Use DB1 Go create procedure <procedurename> as < procedure text> Go Create Procedure <procedurename> as <procedure text> Go But when I execute thi...more >>

Error validating check constraint
Posted by Chris at 10/21/2005 12:00:00 AM
I am using Enterprise Manager to create a relationship between two tables (Bookings and BookingTypes). The relationship on column BookingTypeSerialNo (int) in both tables with no cascading actions. BookingTypes contains a column called OfficeCopies which is a tinyint. I've created a check ...more >>

OLE DB error
Posted by Squirrel at 10/21/2005 12:00:00 AM
I have a stored procedure that consists 4 set of statements (delete rows and then insert rows from excel files with openrowset). It returns error when execute the 4th insert statement. The error message is: OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error. [OLE/DB provider...more >>

ADOMD.NET Sample
Posted by BI-Solutions at 10/21/2005 12:00:00 AM
Hi, Anybody tells me about any sample application available for ADOMD.NET. Regards Stephen ...more >>


DevelopmentNow Blog