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 > may 2007

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

I can't find the sql server 2005 Imports and export wizard
Posted by Robert Dufour at 5/31/2007 4:04:08 PM
Where is it, it does not appear in any of the menu items I show in my sql server management studio. Where can I find it? Thanks for any help. Bob ...more >>

How do I create a "Modify existing search criteria" functionality?
Posted by DPH1 at 5/31/2007 3:16:06 PM
hello -- I'm trying to help a colleague enhance a dynamic Web-based query tool. The query hits a database with records of disease reports. Each record has county, race, age, disease, date of report, etc. Currently, after running a query, the user always has to start from scratch to build a ne...more >>

Rebuild Index
Posted by Ed at 5/31/2007 3:01:01 PM
Hi, If the leaf level of Clustered Index is the actual data page, is that necessary to reorganize the clustered index? I undstand the non-leaf and root level but should not be at the leaf level. Am I right? Thanks Ed...more >>

UDFs and sp_xml_preparedocument
Posted by Michael MacGregor at 5/31/2007 2:51:12 PM
I am trying to create a UDF that involves the use of sp_xml_preparedocument but I get the following error when I attempt to use the UDF: "Only functions and extended stored procedures can be executed from within a function." which I think is a totally misleading error message seeing as sp_xml...more >>

Help on Partitioning column was not found.
Posted by Sonny at 5/31/2007 2:11:09 PM
Hi, I don't know if I missed anything. I have 2 member tables and one partition view in SQL 2000 defined as following CREATE VIEW Server1.dbo.UTable AS SELECT * FROM Server1..pTable1 UNION ALL SELECT * FROM Server2..pTable2 CREATE TABLE pTable1 ( [ID1] [int] IDENTITY (1000, 2) NO...more >>

Turning on READ_COMMITTED_SNAPSHOT mode programmatically
Posted by Eli Tucker at 5/31/2007 1:00:02 PM
Hello. I'm trying to turn on the READ_COMMITTED_SNAPSHOT mode of SQL Server 2005 programmatically from C# by executing SQL statements. The general idea is as follows: turn on single user mode to force all .NET db connections held in the pool to be closed, turn on READ_COMMITTED_SNAPSHOT mode...more >>

returning a dataset from a sql function? to vb.net
Posted by jobs at 5/31/2007 12:33:45 PM
I have this function, which likely needs to change: ALTER FUNCTION [dbo].[GetAllUsers_test_fn] ( ) RETURNS TABLE AS RETURN ( SELECT * from users ) I'm trying to get a dataset out with this vb.net code: Function GetAllUsers() As DataSet Dim cmd As New SqlComman...more >>

Purge a Huge Database Table
Posted by Curious at 5/31/2007 12:33:30 PM
Hi, I'll need to create a stored procedure for purging a *huge* EventLog table. Since EventLog table is huge, will I need some special techniques to speed up the "DELETE" process, or prevent the system from getting frozen? FYI, my stored procedure for purging is as follows: CREATE PROCED...more >>



Query Help
Posted by bonnerd83 at 5/31/2007 12:11:01 PM
I'm working with SQL 2000. TABLE A/Column1 varchar(30) which contain titles such as: 0599899 0505000 I want to return those titles where the 3rd character is <=5 ...more >>

trigger why fired
Posted by Chuck P at 5/31/2007 11:44:02 AM
Is their a reliable way to tell why a trigger fired? For example if I write a trigger for Insert, Update, Delete on a table with NO PK or identity column, can I in the trigger code identify whether the trigger was fired for either the Insert, Update, or Delete action? In Oracle you would do:...more >>

Laying vertical data horizontally
Posted by Eugene at 5/31/2007 11:16:34 AM
Hello All, I have three tables: Students, Assignments, and Scores. Students: ( STUID int, --primary key LNAME varchar (20), FNAME varchar (20), Teacher int ) Assignments: ( AssignmentName char(20), --primary key AssignmentDate datetime, --primary key Teacher int, --primary key Topi...more >>

convert normal date to julian date
Posted by Chris at 5/31/2007 11:10:01 AM
Hi, I would like to convert a normal date of : mm/dd/yyyy format to a julian date. We use an ERP system that holds values as julian dates. to convert from julian date to normal date we use: SELECT CONVERT(VARCHAR(10),(dateadd(dd, 732646 - 693594, '12/30/1899')),101) -- Returns Calendar ...more >>

Question about capturing datetime through DBCC statement
Posted by Big Ern at 5/31/2007 10:11:01 AM
I've created a table to capture the output from DBCC SQLPERF on SQL 2005 and I'd like to have a date timestamp in that column. However, when I execute the DBCC statemnet, it errors out giving me the error that there are not enough values to insert into the table. Would anyone happen to know of...more >>

Importing Excel to SQL SERVER using ADODB
Posted by eric.west NO[at]SPAM passporthealth.com at 5/31/2007 9:18:23 AM
Does ADODB ignore the SQL configuration regarding AdHoc access? I tried running an OPENROWSET from Query Analyzer against a non-local XLS file but it returned an error saying the provider did not give any more information about what happened. Then, I did the same within ADODB. It worked. No ...more >>

SQL server front end
Posted by Manjree Garg at 5/31/2007 8:09:00 AM
Hi, I am new to SQL server. I am creating a database for a small company using SQL server 2005. I need to know what can I use as a front end to make a user interface so that other people can have access to the data base and can search the database?...more >>

field usage
Posted by ganesh at 5/31/2007 7:00:39 AM
Hi There, Is there any way to find out a field has been used in the past, are currently being used by someother procedure I'd like to change field type to int to varchar, it seemed to be not being used anywhere, but just want to know more details which process using the field and when it wa...more >>

Parsing a Name Colomn
Posted by MACason at 5/31/2007 6:51:00 AM
Can anyone how to use a query to parse a name column and extract the name as separte values. The data is currently stored as one column in the format Lastname, Firstname MI (ie: Smith, Roger E). Thanks. Mike C....more >>

documentation purposes
Posted by rodchar at 5/31/2007 6:29:01 AM
hey all, i have this view and i just want to list the fields involved so i can paste into my word doc for documentation purposes. Can someone please show how this can be done? thanks, rodchar...more >>

Decimal Formatting
Posted by Jonathan at 5/31/2007 3:49:01 AM
Hi Group, This is my probelm, I have a SQL view which holds prices to 2 decimal place in the Management Console they are displayed to two decimal place i.e. 1.99. However when I run an ODBC report the values are all to mutiple decimal places i.e. 1.9900000000000000000. I have been told th...more >>

Using events instead of polling in OleDb
Posted by news.nospam.cechner NO[at]SPAM gmail.com at 5/31/2007 1:38:15 AM
Hi, I have some VC++ code that effectively polls until the database status is 'online' using a simple "SELECT DATABASEPROPERTYEX(mydb, 'status')" query command in a while loop. Id like to change this to some event-driven model, but the OleDB documentation isnt helping out much. Is there ...more >>

What does sql really look like?:
Posted by Steve Dassin at 5/31/2007 12:54:44 AM
http://alesrarus.funkydung.com/images/troll.jpg :P -:) ...more >>

Almost nubee needing help with CLR and SQL
Posted by Roy Chastain at 5/31/2007 12:00:00 AM
Even though I have a couple of small SQL applications running, I have minimal experience with SQL. My current experience consists of C# code using classes and methods from System.Data.SqlClient name space such as SqlConnection, SqlCommand and SqlDataAdapter. I am starting on a new adventure and...more >>

ntext or nvarchar(MAX)
Posted by JJ at 5/31/2007 12:00:00 AM
Today I had a problem with one of my tables. When I was doing some testing I typed directly into one of the columns (in SQL Server Management Studio) and received an error "string or binary data will be truncated" - which stopped me being able to change or even delete data in any of the column...more >>

Subquery efficiency
Posted by Peter at 5/31/2007 12:00:00 AM
I'm a bit puzzled how I can make a subquery more efficient. Here is a simple example of what I'm after: SELECT em.Name, tr.DistanceTraveled FROM Employee em, (SELECT SUM(distance) AS DistanceTraveled, EmployeeID FROM Trip GROUP BY EmployeeID) tr WHERE em.ID = 123 AND tr.Employe...more >>

how to test parametrized queries?
Posted by Fritz Franz at 5/31/2007 12:00:00 AM
Hello! Is there a way or a tool where I can test queries in which I use paramteres like select * from tab1 t where t.f1 = :myparam1 Thx in advance, Fritz ...more >>

inline tables in select
Posted by New Bee at 5/31/2007 12:00:00 AM
Hi In my UDF I have an inline table @msTotals ( market_space nvarchar(50), totalHours float) INSERT @msTotal (some function ) -- so far so good. I need to use an item from this table SELECT m.columnName AS Name1, m.columnName2 As Name 2, ...more >>

Optimization of query
Posted by aap31374 NO[at]SPAM gmail.com at 5/30/2007 11:20:52 PM
Hello ! I am using this query, my tables contains more then 900000 rows, and i am getting result very slow. pl. help to optimize it . GetDocumentsOfIndex is function whcih will return table. select distinct document_id, cached_folder_id from rep_document where document_id in ((select docu...more >>

TimeZone Information after Serialization
Posted by Sugandh Jain at 5/30/2007 10:00:07 PM
Hi, I am serializing a collection of objects of a Type(Class). The class contians a DateTime type property in it. Now, I am serializing this collection. For some of the DateTime values, I get the DateTime with the TimeZone Information included in the XML. Like this ... 2007-05-30T16:12...more >>

Connecting to a remote server with SQL Management Studio Express
Posted by Andrew Chalk at 5/30/2007 9:53:26 PM
I installed a copy of SQL 2005 Express on another computer here using the automatic download and install from Microsoft supported by the setup toolkit. I can't access this server from another machine on the LAN using SQL Management Studio Express. I can 'see' the server but cannot connect. ...more >>

SQL 2005 Linked Servers
Posted by Mike Labosh at 5/30/2007 7:29:53 PM
Can I just say, SELECT * FROM ServerA.DatabaseA.SchemaA.TableA UNION SELECT * FROM ServerB.DatabaseB.SchemaB.TableB Without explicitly creating a "linked server" ? -- Peace & happy computing, Mike Labosh, MCSD MCT Owner, vbSensei.Com "Escriba coda ergo sum." -- vbSensei ...more >>

Read-Only Join
Posted by scott at 5/30/2007 6:56:06 PM
I'm trying to create a sql statement to use as a recordset on an Access data form. I have 2 tables called "users" & "accounts". The "users" table on contains an id field, first name and last name field. Any "user" record may have many records in the "accounts" table. They are joined by the "us...more >>

where's the ( IF ) in sql server 2000
Posted by New Bee at 5/30/2007 3:54:16 PM
Hi there, Im writing a query in which I wan to calculate a colum based on the values of other columns, so what I wanted to do was something like IF colType=3 then colRecovery * .234 ELSE colReverb * 0.6 How can I do this ?? Cheers ...more >>

delimited list within select
Posted by Terri at 5/30/2007 3:39:32 PM
I can't do this client side as my "client" is excel Desire result is three fields returned 1,8,A;B 2,30,B;C;D CREATE TABLE #Orders ( Order_ID int ) CREATE TABLE #OrderAccounts ( Order_ID int, Account char(1), Amount int ) INSERT INTO #Orders (Order_ID) VALUES (1) INSERT INTO...more >>

Indexed views driving me batty ...
Posted by SQL Practitioner at 5/30/2007 3:19:32 PM
I have an indexed view iv_cm. And I have a query like this: select * from iv_cm with(noexpand) where iv_cm.col_a = 12345 The optimizer does the right thing for this query. It does an "index seek" on iv_cm using the index on col_a. But if there is any other constraint on any other column ...more >>

Restore of a Database
Posted by Gary Johnson at 5/30/2007 2:55:08 PM
When using the SQL Server Management Studio to restore a database from a device (filename.bak, for example), the options page shows the logical name and the fully qualified file name for each of the database files. Does anyone know how I might determine that type of information from a backup ...more >>

Help with SQL Query
Posted by Dan Shepherd at 5/30/2007 2:11:02 PM
I am trying to summarize data based on a period range in related tables. Table one has a column that includes a date/time field. Table two has an array field (MTD_1 to MTD_12) that has values I want to summarize based on the date field in table one. Example... Chekdate is 03/15/2007 in ta...more >>

Drop and Create view 2005
Posted by David C at 5/30/2007 1:36:59 PM
In SQL 2000 I could create one script that both dropped (if existed) and created a view. Does SQL 2005 have anything like it anywhere. I can only find separate DROP and CREATE scripting. Thanks. David ...more >>

Users and Groups problem.
Posted by Alex at 5/30/2007 1:22:28 PM
OK, I can't think of a good way to do this so I'm hoping someone else has some ideas: My boss and I are trying to create a help desk system for our customers. Boss decided that instead of only assigning tickets to one particular tech, he wants to be able to assign techs to groups and assign ...more >>

For XML Path/ WITH XMLNAMESPACES
Posted by MicroMite at 5/30/2007 11:29:02 AM
Is it possible to create generate xsi:schemaLocation="http:// http://.../name.xsd" while using the for XML Path syntax? I am able to define everthing else except that (see example) below. Any help would be greatly appreciated...Thanks Example: <Example xmlns:xsi="http://..." xsi:schemaLoca...more >>

how to grab decimal portion of the amount?
Posted by Mehbs at 5/30/2007 11:26:42 AM
I have to update the prices in SQL2K. if the price is 201.10, decimal ends with 0, I need to add 1 so it is 201.11. How to select the record with amount's decimal ending with 0? Thanks ...more >>

8152 Error
Posted by Loren Z at 5/30/2007 10:58:14 AM
This is concerning a problem on an application database on SQL Server 2005 SP2 (Build 3159) If I run the following command everything works fine. BEGIN TRAN UPDATE Table9 SET Remarks = 'Test' WHERE Id =1 ROLLBACK TRAN but if I change the above command to BEGIN TRAN UPDATE T...more >>

Anyone knows of a good free Data Generator for test databases?
Posted by shlomoid at 5/30/2007 9:34:12 AM
Hi, I'm looking for a simple and freeware data generator application. I've googled for an hour, and couldn't find something reasonable that is also free. Do you guys have some recommendations for something like this? Which tools do you use? Thanks, Shlomo ...more >>

Help getting output from sproc to avoid DTC problem
Posted by Curtis at 5/30/2007 8:58:49 AM
I have a stored procedure that returns a value from a linked server. I am unable to enable remote DTC access on that server. The sproc returns the correct value, but when I try to insert that value in to a table, I receive the "unable to begin a distributed transaction" message (Msg 7391). I'm t...more >>

Allow Updates
Posted by CLM at 5/30/2007 8:55:02 AM
I got these msgs on one of my servers (SS 2000 SP4). It looks like someone was playing around with this which is rather chilling. Is there any legitimate reason for this? What I mean by that is that I know that clicking on Enterprise Manager or running the Copy Database Wizard will sometim...more >>

Challenge-1 text column to many columns
Posted by Stephanie at 5/30/2007 8:49:00 AM
Okay, brainiacs, I need some help. I have a field in a database that is defined as text and contains some characters and some bars (|). The bar separates the values in the field into columns. For example, 5235D4793912C9O|120543||385 would mean 4 columns equal to: A: 5235D4793912C9O ...more >>

SQL For Xml - Master Detail Nesting
Posted by Anastasiosyal at 5/30/2007 8:42:01 AM
Hello, I will step right into this with an example. Let's assume we have the following tables: CREATE TABLE #ProductType( ProductTypeId int Primary key, ProductTypeDescription varchar(50) ) Insert Into #ProductType Values (1, 'Gizmos') Insert Into #ProductType Values (2, 'Gadgets') ...more >>

comparing dates
Posted by ITDUDE27 at 5/30/2007 8:07:00 AM
Hello world, I have a table i'm trying to get the number of days difference using the DATEDIFF() funciton. I was wondering if I can use something other than MIN or MAX function to get the datediff from the Next MIN date. (i.e. 2006-08-15 ) table_b order_no rel_no rel_date 1150 ...more >>

Space is not released after you delete some rows from a table in S
Posted by Shyam at 5/30/2007 6:54:00 AM
Hi, I delete some rows from a table in Microsoft SQL Server 2000, and the result of the sp_spaceused stored procedure shows that lots of space in the table is not released. I went thru the Article ID:934378 related to Space is not released after you delete some rows from a table in S2K and...more >>

Return table from Stored Procedure into another stored procedure
Posted by R C at 5/30/2007 5:58:00 AM
hi, can this be done? i have stored procedure 1 that calls stored procedure 2 in the FROM clause. Stored procedure 2 is supposed to return a table. For example: select a, b, c from table1 , (exec storedproc2) table2 where a = b and..... please advise...more >>

Usage of 'set xact_abort on'
Posted by Mohans at 5/30/2007 5:56:01 AM
Hi, One of my procedure is extracting data from flat files and insert that records into 4 tables. Two of them in same DB and rest of that tables in some other server(using linked server we are inserting into these table). This procedure has 'set xact_abort on' in two places one of that in...more >>


DevelopmentNow Blog