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
August 2008


all groups > sql server programming > october 2005 > threads for thursday october 20

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

Memory Usage
Posted by Reggie at 10/20/2005 11:23:49 PM
Hi and TIA! Problem I'm having is after or during when I work in SQL EM designing views/sp/tables etc and I close down EM and I then start noticing a degraded performance on my computer. I view task manager and notice that the Mem. Usage is way up to 200mb and continues to grow. On the Perf...more >>

Bulk Insert from Excel file
Posted by bill_morgan at 10/20/2005 7:42:01 PM
Hi ... Having trouble getting Bulk Insert to work with .xls file. Following code works fine for text file: BULK INSERT MyTable FROM 'C:\bulkinsert.txt' with (fieldterminator ='\t', datafiletype ='char') Anybody know what changes I need to make to above code so it works for Excel file? ...more >>

inserting new rows into table from fields derived from other tables?
Posted by j.murray at 10/20/2005 7:33:23 PM
Hi, I was wondering if someone could help me. I have 3 tables: A, B, C. I need to insert rows into table A derived from data in B and C. The condition is that information from B and C are thrown into A based on the fact that the added information is based on a userID that is in B, but not curr...more >>

Edit data with Query Analyzer
Posted by Rick Charnes at 10/20/2005 6:51:58 PM
Is there any way I can use Query Analyzer to edit data in a table via a graphic grid, i.e. actually changing individual values in cells? Using SQL statements is too cumbersome for my purpose; I need to have more hands-on control....more >>

how to generate full-texting setting script for porting to another SQL Server?
Posted by ABC at 10/20/2005 6:15:36 PM
how to generate full-texting setting script for porting to another SQL Server? ...more >>

Return Results Horizontally
Posted by David at 10/20/2005 5:47:01 PM
All I have a table as illustrated with the DDL below and I would like to group the records and return the results horizontally as per the desired results below. Any assistance would be appreciated. Thanks CREATE TABLE colours ( i INT, colour VARCHAR(10) ) INSERT INTO...more >>

Problem with GROUP BY/COMPUTE : error message 8120
Posted by Laurent CLAUDEL at 10/20/2005 5:42:46 PM
Hi, I have this query ( it is Ok with Sybase SQLServer) select 'Voie'=NVOI,'Mois'=datepart(mm,DPSTVOI) ,'Année'=datepart(yy,DPSTVOI),'Période'=CPST,'Nombre'=count(NVOI) from HREH3M group by CPST,NVOI,datepart(yy,DPSTVOI),datepart(mm,DPSTVOI) order by CPST,NVOI,datepart(yy,DPSTVOI),datepa...more >>

Grouping... and grouping... and grouping...
Posted by David Lozzi at 10/20/2005 5:34:18 PM
Hello, I have a table with about 30 fields in it. I am returning to asp.net a distinct selection of class. From there, I also need to provide a count of 2 other field specific values, count of males and females and count of race. For example, below is a sample table: class gender r...more >>



Update Query
Posted by JoseM at 10/20/2005 5:07:03 PM
Please help! I want to run an update query to match the service price (serprice) of a specified service code ("1") from another ("2") in the same table. Here is a sample that doesn't work. UPDATE t1 ; SET t1.serprice = t2.serprice ; FROM sertable t1 ; JOIN sertable t2 ; ON t1.customer...more >>

SQL Agent Mail Issue
Posted by Andre at 10/20/2005 4:25:02 PM
I am trying to setup my Agent mail. When I go to the properties of SQL Agent the mail profile is grayed out completely. I have looked around but cant find the answer. If anyone can shed some light I would greatly appreciate it. Also, another thing is on my desktop machine is it not grayed ...more >>

Simple Query
Posted by kiran at 10/20/2005 4:07:17 PM
Hi, This looks simple but I couldn't get it right For eg. Table1 has 1 ABC 2 DEF 3 GHI Table2 has 2 DEF I need the result as(basically all the records of table1 and the matching record of table2 must be at the top) 2 DEF 1 ABC 3 GHI Any help will be appreciated ...more >>

Returning customised strings in a column
Posted by Christopher Carlander at 10/20/2005 2:58:22 PM
Hi, I'm fairly new to SQL Server, but have at least basic knowledge of SQL (as language). Building a web application I normally process retrieved data directly in code, but after having read about and begun to realize the power of stored procedures, I'm sure there are better ways to solve this...more >>

Output query to email
Posted by J1C at 10/20/2005 2:57:21 PM
How could I email the output results of a query to an HTML table? ...more >>

Nested join
Posted by xauxi NO[at]SPAM yahoo.com at 10/20/2005 2:56:13 PM
ID IAParent Entry Level 110 95 Request [NULL] 4 111 95 Install [NULL] 4 112 95 Remove [NULL] 4 113 76 Power [NULL] 5 114 109 Power [NULL] 5 115 109 Display [NULL] 5 116 109 Keyboard/Touchpad [NULL] 5 117 109 Docking Station [NULL] 5 118 109 Memory [NULL] 5 119 109 Reimage Mac...more >>

compare mdf for success restore of data and file storage
Posted by Ram at 10/20/2005 2:48:01 PM
Gurus, I have a scenario where in if i restore a database file(mdf) onto say some AppManager,i want to make sure its restored properly comparing with the mdf that it came from(i take this as base).i hope iam making sense here....more >>

Linked Server Query
Posted by vibs at 10/20/2005 2:04:07 PM
When I execute the SQL Statement in the SQL Query Analyzer, I get the results returned in 4 seconds but when I use the same query from a stored procedure and execute it from SQL Analyzer, it is taking too long about 50-55 seconds. Am I missing something? I have a join between external and inte...more >>

Linking Microsft Access in Sql
Posted by bob at zachys at 10/20/2005 1:41:05 PM
Is it possible to link a Microsft Access table in Sql? What I am hoping to do is to update an Access table using a DTS package. I need to join a SQL table and a Access table and use the results to update anouther Access table. Is this possible. Thank you in advance...more >>

Last 10 minutes
Posted by J1C at 10/20/2005 1:26:52 PM
How could I return all records in the last that were entered in a single table in the last 10 minutes? One of the columns is datetime ... ...more >>

Simple JOIN turned ugly - Help!
Posted by Michael Strange at 10/20/2005 1:21:46 PM
All: Thanks in advance for any insight. I got turned on to associative ("bridge?") tables by an MCAD friend, but he hasn't had the time lately to show me how to really utilize them. This is my first post, and I'm relatively new to MSSQL, so I hope I'm providing adequate information. I ca...more >>

using .NET with a view
Posted by Yaniv at 10/20/2005 1:09:59 PM
Hi, I have a C# code that selects from a base table OK, but when selecting from a view referencing the base table I receive an exp stating 'Invalid object name <view_name>' (where view_name is the corrcet name of my existing view). The view is referencing a table in the same database The ...more >>

Ordering a heap
Posted by Raul at 10/20/2005 1:01:03 PM
I have created and populated a table with no indexes and would like to order the data prior to creating an index. I realize I can use "order by" in my queries to get my output the way I want it, but I was wondering if: 1) is there is a way to order/sort the data in a table based on the values ...more >>

3 questions
Posted by Art at 10/20/2005 12:30:02 PM
Hi -- I'm new to SQL and thus also new to SQL Server. I'm working on a project that has data stored in 4 databases. I want to create a 5th database for my work. I will need to retrieve data from those other 4 databases -- usually creating tables in my 5th database. I want to put together...more >>

Question about subquries and logic
Posted by mindjuju at 10/20/2005 12:21:05 PM
i'm trying to create a sql statement that will feed a report. it will pull from 3 tables. to get the exact data i need, 1 of the tables i'm pulling data from is hit 3 times. Here is the code that I have so far: SELECT Sec.[user_id], Sec.exp_date, Cus.first_name, Cus.last_name, Cus.type...more >>

Insert error in Store Procedure
Posted by DNKMCA at 10/20/2005 12:19:54 PM
Hi, I want to find out the max number and insert into a table Please help me in correcting the code below Thanks -DNK ---------------------------------------------- CREATE PROCEDURE [dbo].[ORS_AddDailyReport] ( @tabname varchar(500), @rdate datetime, @wdone int, @amtach float ...more >>

Check Foreign Key integrity of existing data
Posted by ESPNSTI at 10/20/2005 12:15:06 PM
Hi, I'm in the process of writing a script that inserts or updates default data for a database. I came to the conclusion that I have to temporarily disable certain foreign keys. At the end of the script however, I'd like to check existing data to verify that everything is still ok. Basica...more >>

INSERT table (column1, column2) (@variable, '100')
Posted by tom at 10/20/2005 11:47:27 AM
Generally, you can't use a variable in this way, correct? INSERT table (column1, column2) VALUES (@variable, '100') Do I need to be learning about stored procedures to make something like this work? Do I need to restructure the insert statement? Thanks -tom ...more >>

Fix Replace function plz!
Posted by Test Test at 10/20/2005 10:34:44 AM
Hello! I need to replace a string which starts from "DBX:" and ends to "Addr1:" with a word "APPLE". The cloumn is Name in #temp table. I am captuting it correctly but not using the replace function the right way. It is replacing eveywhere which I dont want. Thanks for your help. crea...more >>

invalid character value on 7000th record
Posted by naomi at 10/20/2005 9:54:52 AM
Our developers are trying to pinpoint why a function keeps bombing out (email below). The database was created using the same setup as other dbs, none of which have had this problem. I ran a trace, which showed several Sort Warnings before the process stopped, but no error messages. The pro...more >>

Get AD Data via Sequel
Posted by Bahman at 10/20/2005 9:29:06 AM
Hello! Sorry if duplicate question: Is there a way to get data from the AD via the sequel? I would want things like 'name' and 'email' and 'phone'. Off the topic of the fourm but: If not through sequel, how do I set up a database connection to the AD directly for reporting purposes? ...more >>

Is the SQL Server Service Running?
Posted by Guadala Harry at 10/20/2005 8:53:16 AM
Can Enterprise Manager tell us *definitively* if the SQL Server service is running/started on a particular SQL Server (where the SQL Server is not the local machine on which EM is running)? What is the most reliable way to determine if the SQL Server service is in fact up and running on any...more >>

space(0) and replace('123-45', '-', '')
Posted by loop at 10/20/2005 8:34:41 AM
Hi all. If anyone can help me please do. What should the following query return. I am getting different results from different servers. replace ('123-45', '-', '') Sometimes I get '123 45'. Othertimes I get '12345'. -- Sam, Ziggy says there's a 81.25% chance that Chelsea will wi...more >>

Deleting Indexes
Posted by JD at 10/20/2005 7:59:15 AM
Is there a way to delete the indexes on all the tables for a specific database in SQL Server using Query Analyzer without knowing the exact name of the Index? I am able to do this using SQLDMO, but I need to know if there is a way to do this using Query Analyzer. Thanks...more >>

Grouping,Paging Logic
Posted by xslspy at 10/20/2005 7:28:23 AM
Can any one give me the optimized Paging and Grouping Logic in SQL Server, my Grouping shoul like the below.... Group By Filed Name = Group By Filed Value Group count: 2 --------------------------------------------------------------- Row ----------- 1 Row ----------- 2 .. .. ---...more >>

Problem -- not using current login to search for owner of tables
Posted by orwellnelson NO[at]SPAM usa.com at 10/20/2005 5:34:06 AM
I'm having a problem with SQL Server 2000. I have created a user called "abc". I created a slew of tables, procs, etc. When I look in Enterprise Manager, I see they are all owned by "abc". I log into Query Analyzer as "abc" and run a "select" statement and get an "Invalid object name" error...more >>

Database backup
Posted by vanitha at 10/20/2005 5:08:02 AM
hi, I took backup of the database and restored in some other location say mirror database. In the mirror database, I add some constraints by eliminating duplicates and foreign key constraints. In the meantime some data would have been updated or inserted inside the original database....more >>

sql server agent job failing on an error I am handling in code
Posted by Kevin S at 10/20/2005 4:35:06 AM
I have a sqlserver agent job which simply executes a procedure to load data from intermediate tables to corresponding application tables. Withing the procedure, I am handling errors so I can log which records are causing problems, while continuing processing so any subsequent correct record...more >>

Problem after clustering an index.
Posted by Harshad Phadnis at 10/20/2005 4:07:02 AM
Hi, After reading yesterday's mail by Tibor, I clustered all the indexes(on primary key) of all the tables in my database. Then I ran my application which uses this database. It generated some errors & when I checked in the trace files, I found that one of the tables was not getting ...more >>

Fill up missing months.
Posted by maciek at 10/20/2005 3:58:08 AM
Hi, I've got this resultset: year month group value 2005 5 a 10 2005 6 a 20 2005 1 b 15 2005 3 b 16 2005 9 c 15 and now I need to fill it up with "missing" months -- like this: year month group value 2005 1 a 0 2005 2 a 0 2005 3 a 0 2005 4 a 0 2005 5 a 10 2005 6 a 20 2005 7 a...more >>

sORTING ACROSS MULTIPLE COLUMN
Posted by weichung [MCSD, MCDBA] at 10/20/2005 3:49:09 AM
I have a sample table like the following way: Col1 col2 Col3 ------------------------ 3 4 6 7 4 7 8 7 2 5 7 9 6 6 6 After the sorting, I should produce the result like the following: Col1 col2 C...more >>

how would you apply MSF to database moddeling
Posted by Jose G. de Jesus Jr MCP, MCDBA at 10/20/2005 3:23:02 AM
hi all How would you apply MSF and UML to database modeling. -- thanks, ------------------------------------ Jose de Jesus Jr. Mcp,Mcdba Data Architect Sykes Asia (Manila philippines) MCP #2324787...more >>

why it is difference speed when using = or >= operators
Posted by Eric at 10/20/2005 3:07:01 AM
There are about 800,000 records in a table and I want to run an query to get monthly analysis result by using following sql statements: Statement 1: select convert(char(6), invdate,112 ), sum(qty*price) from inv where convert(char(6), invdate, 112)='200509' group by convert(char(6), invdate,11...more >>

CmdExec job step permission
Posted by SQL novice at 10/20/2005 2:38:34 AM
Is there anyway I can make a "CmdExec" job step run by a non system admin? ...more >>

Data Truncation in sp parameter
Posted by Madhivanan at 10/20/2005 2:34:27 AM
It seems that there is no error message if the length of the parameter value exceeds parameter datalength Create Procedure #test (@data varchar(10)) as Select @data Go Exec #test 'This is testing' Go Drop Procedure #test The result is This is te Why does SQL Server not raise any err...more >>

sp_executesql
Posted by vanitha at 10/20/2005 2:11:03 AM
hi, my query is select @sql = 'select count(*) from '+ @i_errorDb + '.INFORMATION_SCHEMA.TABLES where ' + 'Table_Name like ' + CHAR(39) + @reference_table + CHAR(39) exec sp_executesql @sql where i will give the input for @i_errorDb as database name and @reference_table as table n...more >>

Permission to execute a stored procedure
Posted by SQL novice at 10/20/2005 12:31:11 AM
What is the minimum permission required to execute a stored procedure in DB ...more >>

SubString in Look Up Query in DTS
Posted by bali at 10/20/2005 12:30:41 AM
Hi, I am trying to extract a substring out a source column (?) and mappin that to another column like field1 = substring(?,3,2) Looks like this doesn't work. Please advice. on a high level the requirement is to extract a substring and map wit another tables column to retrieve a new valu...more >>


DevelopmentNow Blog