all groups > sql server programming > august 2007 > threads for wednesday august 15
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
Update Multiple Rows
Posted by Camelback at 8/15/2007 6:32:58 PM
Hello
I'm new to SQL -
I'm trying to update multiple rows in a table.
Table -
Column values - ID | Name | IsCrazy
This is my query
UPDATE table
SET IsCrazy = 'True'
WHERE ID = 1,20,3,4,50
I am having a problem with the "WHERE ID =" part.
I have multiple id's that I need to... more >>
Passing array of int into SQL Server stored procedure
Posted by guiroux22 NO[at]SPAM gmail.com at 8/15/2007 6:17:33 PM
I want to pass array of int into a stored procedure to use it as a
list for a IN clause.
I already found this article which use an XML string parameter but i
think it's overkill
http://support.microsoft.com/?scid=kb%3Ben-us%3B555266&x=16&y=11
Maybe someone have something more simple ?
Than... more >>
using more then one processor
Posted by Roy Goldhammer at 8/15/2007 5:32:59 PM
Hello there
I have one script that create data in size of 10Gb.
when i run it only one processor use it.
How can i cause other processors to join in the insert of the script?
... more >>
Store procedure deploying with SMO
Posted by Lubomir at 8/15/2007 5:12:02 PM
Hi,
How could I use SMO to deploy to SQL Server the CLR stored procedures, that
are compiled into the dll?
Thanks,
Lubomir... more >>
Procedure issues
Posted by Daniel at 8/15/2007 5:11:52 PM
New to NOLOCK in general.. but would like some advice or suggestions....
We are using SQL2005 for our online application. Everything seems to be
working fine but its hard to track an issue when there is no error
returned..
Example..
Location 1 completes a form online and submits it.. ... more >>
SSIS Excel Connection Manager Problem
Posted by Mike C# at 8/15/2007 5:04:43 PM
I have a problem with SSIS Excel Connection Manager popping up a message
box, which asks me to enter a Username and Password for the Excel
spreadsheet. The spreadsheet is not protected by a username/password.
Anyone have any ideas what I might be doing wrong?
Thanks
... more >>
Query with Null field not working in Sql Query
Posted by tshad at 8/15/2007 4:36:34 PM
I am obviously missing something.
But I have a SP that works great. I pass 1 or 2 parameters. If I don't
pass the 2nd parameter it gives me all the records for a particular user.
The problem is that I copy and paste the stored procecure to an Sql Query
window and change the first part of... more >>
how to gather these info for my sql2k & sql05
Posted by light_wt at 8/15/2007 4:02:04 PM
is there a t-sql guru that can help me on these:
find top 5 i/o consumer
find top 5 cpu consumer
top 5 sql statements in lock contention for index and table.
thanks.... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Can you help me write this query? Should be easy...
Posted by bodyboarder20 NO[at]SPAM gmail.com at 8/15/2007 3:54:23 PM
So I havent done any SQL queries lately that are beyond basic... I was
hoping maybe somebody can point me in the right direction.
I guess the best thing to do is give an example of the tables and the
result that i am attempting to get
TABLE: PERSON
ID NAME
---------... more >>
Best way to Duplicate a Database with Different Name
Posted by Lit at 8/15/2007 3:24:17 PM
Hello,
How can I duplicate a 2005 SQL Database giving it a different Name like
"dbName_2" original name is "dbName".
Thank you,
Lit
... more >>
Deleting duplicate records
Posted by Dave Navarro at 8/15/2007 3:03:18 PM
I have a database with duplicate records. Is there a query I can run to
remove the duplicates. Example:
"1", "Item1"
"2", "Item2"
"3", "Item2" <-- duplicate
"4", "Item3"
"5", "Item3" <-- duplicate
"6", "Item3" <-- duplicate
"7", "Item4"
"8", "Item5"
"9", "Item1" <-- duplicate
... more >>
Simple Query not running because of CASE
Posted by idelsoq NO[at]SPAM gmail.com at 8/15/2007 2:53:23 PM
Hi everyone,
This is supposed to be a simple Query. It basically is a Select
statement that builds a string (a comma delimited string) and inserts
certain values into it from a table. It was originally built using
cursors (yike !!) and I am trying to modify it to run as a set-based
query. Curso... more >>
Struggling with Query
Posted by Bruce at 8/15/2007 1:52:12 PM
Can someone help me please figure this out. I have a table of products and a
table for prices, like this:
Table Prices
PriceID ProductID MinQty MaxQty Price
1 1 1 3 6.00
2 1 4 7 5.50
3 1 ... more >>
Migration Issue
Posted by FARRUKH at 8/15/2007 1:12:03 PM
can we migrate data or restore/attach data from SQL Server 2005(SP2) to SQL
Server 2000(SP1)? is there any data loss or any effect? backword migration
The reason I am asking because we migrated the sever from SQL Server 2000 to
SQL Server 2005 but we are having some problem and thinking to go... more >>
Executing scalar function inside of SELECT
Posted by Mark Goldin at 8/15/2007 12:57:45 PM
I am testing some speed issues I am having with a use of scalar udf inside
of SELECT statement.
Even if udf does not do anything by simply having return 1 as a first line
of the code still it takes much longer then if I dont call it at all.
Any idea why?
Thanks
... more >>
Stored Procedure Parameter
Posted by Agho at 8/15/2007 12:28:02 PM
I have a stored procedure declared as follows:
create procedure usp_validate @db_name nvarchar(4000) = NULL
In the procedure, I have a code similar to this
if @db_name is null
select dname from InfoTable
else
select dname from InfoTable where dname in (@db_name)
... more >>
Error: Transaction context in use by another session
Posted by masmith at 8/15/2007 12:26:01 PM
I have a SQL Server 2005 instance (A) that has a store procedure that through
a Linked Server executes another stored procedure on a different SQL Server
2005 instance (B). The second stored procedure trys to execute a stored
procedure on the first instance (A). This last stored procedure fa... more >>
SQL Design Question
Posted by Lit at 8/15/2007 11:31:06 AM
Hello,
Not sure if this is the right group to ask, if not please direct.
I have an application to be filled out by users and the application have
some sections like:
Company Info( name, addresses, phones, emails)
Contact Info ( name, phones, emails)
References Info ( names, phones, emai... more >>
SLOW query
Posted by Robert Sheppard at 8/15/2007 10:23:31 AM
I have a fairly complex query that I noticed was running way too slow. I
isolated the problem to one line (@UserID = 0)
For the sake of simplicity I will make the SQL statement a bit smaller than
the one I am using.
THIS WORKS GREAT
CREATE PROCEDURE procTest (@ID int = 0, @UserID int = 0) A... more >>
CRLF
Posted by dwopffl NO[at]SPAM yahoo.com at 8/15/2007 10:08:56 AM
I have a field in my database
150 Summer St#450
It contains a CRLF after St and before #.
I need to extract this data in 2 pieces.
I need to select all the characters before the CRLF and all the
characters after the CRLF. Is there an easy way to do this?
... more >>
Need Urgent Help with query Please
Posted by jsmith at 8/15/2007 10:04:51 AM
I need to create records in a table from already existing records
modifying one one column. However, I need to do this insert if such
record does not exists yet.
Here is the example:
TABLE_A:
id stateID program
-- -------- -----------
1 7 12
2 7 13
3... more >>
OpenRowset bug?
Posted by ydbn at 8/15/2007 9:24:07 AM
I have the following query.
select *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel
8.0;HDR=yes;IMEX=1;DATABASE=E:\Update.xls', 'Select top 1 * from [Sheet1$]')
Sometime it works, sometiem it raises error:
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)"
return... more >>
write a query in Access that needs to run against a SQL Server dat
Posted by Jaison Jose at 8/15/2007 9:18:04 AM
Dear All,
How can we write a query in MS Access that needs to run against a SQL Server
database? And what and all the parameters and connection strings\user
permission that has to set for achieving this?
It vl be highly appretiated if someone can explain it in a step by step
procedure.
... more >>
Move to different server SS 2000 to SS 2005
Posted by Sandy at 8/15/2007 8:34:04 AM
Hello -
I have a Sql Server 2000 production database that has to be moved to Sql
Server 2005 on another production server. The data file is 42 MB and the log
file is 388 MB. I have three issues I am concerned with -
1. Size of the log file - it is set to Autogrow by 10%; unrestricted fi... more >>
SQL Statement to return result one time
Posted by Mark at 8/15/2007 8:30:01 AM
Can anyone assist me with the below SQL statement that I created? The results
return show the information multiple times on seperate lines. I just want it
to return it once so it doesn't create one long list that is the same.
SELECT CollectionID FROM v_FullCollectionMembership WHERE Collect... more >>
Best resource for learning about system tables?
Posted by francis.moore NO[at]SPAM gmail.com at 8/15/2007 7:50:08 AM
Hi,
Can anyone tell me what the best resource is for finding out about the
system tables, what they contain and how to work with them (just
querying them, not modifying them)? Recently I needed to know whether
a stored proc was being used in a database or whether it could be
removed. It took ... more >>
Comparing columns and rows
Posted by Taylor Hellebuyck at 8/15/2007 6:45:37 AM
I have a table that contains ranges of zip codes(ie 00000-00001). I want to be able to check those ranges to make sure that new records dont overlap or equal to existing ranges. Does any one have a suggestion to how I could go about doing this?
EggHeadCafe.com - .NET Developer Portal of Choice ... more >>
determine the repeated numbers
Posted by Dream at 8/15/2007 4:02:14 AM
Hi All
I have a table that contains a list of codes ( Varchar exple :
411253 , 411524 ....)
I would like to determine the repeated codes
Thanks for your help
... more >>
Restore database from backup
Posted by Max at 8/15/2007 12:00:00 AM
Hello,
I backed up the database to a .bak file and would like to recreate it on another computer
that will be used for development purposes. I tried logging into SSMS and right clicking on
the Databases object then selecting Restore and referencing the .bak file. This displays an
error s... more >>
stored procedure select particular date
Posted by SOC at 8/15/2007 12:00:00 AM
This procedure returns no records, can anyone suggest why?
----------------------------------------
CREATE Procedure sp_1
@datetouse datetime
As
SELECT c_1,c_2
FROM tablec
where c_date>=@datetouse and c_date<@datetouse+1
-----------------------------------------
Thanks.
... more >>
Newbie question....SELECT 1 ?
Posted by WhytheQ at 8/15/2007 12:00:00 AM
Just started learning SQL through SQLServer2005 (and MySQL)
What is SELECT section of the following doing when it executes:
USE myDatabase
SELECT 1
FROM myTable
+ why does the result grid appear whilst this query is still
executing?
Any help greatly appreciated
J
reason I as... more >>
Slow query
Posted by Antonin at 8/15/2007 12:00:00 AM
One user runs this query from Access:
SELECT DISTINCT
moneymart.dbo.Invoice.Service_Date, moneymart.dbo.Invoice.Invoice_ID,
moneymart.dbo.Invoice.Number_of_Services,
moneymart.dbo.Invoice.Total_Fee,
moneymart.dbo.MergedChargeAdvice.Consolidated_CMB_code,
moneymart.dbo.MergedChargeAdvic... more >>
How to copy a updated row from table1 to table2 with a trigger
Posted by Marcel Wüthrich at 8/15/2007 12:00:00 AM
Hello,
I have 2 tables : table1 and table2. Everytime a row is updated in table1, a
trigger must copy the updated row from table1 to table2. It's easy to copy
all the records with following trigger :
CREATE TRIGGER UpdateTable1 ON Table1
FOR UPDATE
AS
INSERT INTO Table2
SELECT * FROM Tab... more >>
|