all groups > sql server programming > march 2007 > threads for thursday march 22
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
Getting rows in TempTable After QueryBatch
Posted by Sugandh Jain at 3/22/2007 10:16:36 PM
Hi,
I have a number of insert queries running in a batch on a single table.
This query batch is passed to the stored procedure as a dynamic sql.
I want to have all the rows that are inserted in this batch in a separate
temp table with the same table structure as the parent table.
how to ... more >>
Inserting only non existing rows
Posted by Ant at 3/22/2007 10:02:00 PM
Hi,
I have two tables residing in seperate DB's. I need to copy rows from one to
the other but only rows that don't exist in the first table. It has a
composite pk & must only pull certain table Ids'
This is what I'm doing below:
select * from DB1.dbo.Table1 db1
where Name = 'SomeNa... more >>
Another trigger issue
Posted by Andre at 3/22/2007 8:23:02 PM
I have 2 triggers which are listed below.
CREATE TRIGGER tester ON [dbo].[ENRLLMNT]
FOR INSERT, UPDATE
AS
update enrllmnt
set cntusrdateprocess = b.editdate
from inserted a inner join enrllmnt b on a.dwdocid = b.dwdocid
where convert(char(10), b.cntusrdateprocess,101) > convert(char(10),
... more >>
MAXDOP Recommendation
Posted by tcs at 3/22/2007 7:57:00 PM
I am wondering if anyone can suggest a MAXDOP setting. I have a 64bit 8 CPU
server that will be under heavy load. It will have BCP running constantly
against it putting millions and millions of rows in it per day. The larger
tables will be partitioned by time. Users will also be querying a... more >>
Dynamic SQL Query
Posted by Cylix at 3/22/2007 7:22:21 PM
I am going to update a list of records accroding a Unique ID,
like
Update TBL SET thedate=GETDATE() WHERE TBL_ID IN ('1', '3', '4' ....)
The ID List may be very long ...
But for a stored procedure, VARCHAR(8000) seems the longest string I
can declare.
Any datatype I can define for more than ... more >>
Restore in use database
Posted by MV at 3/22/2007 5:39:35 PM
Hi, I have to restore daily databases that are still in use, I can drop
connection without problem but I'm searching a way to scripting this step,
is there a way to drop connection, restore db via TSQL Script ? Thanks
... more >>
Manage multi SQL Server
Posted by Frank at 3/22/2007 5:35:03 PM
This is my new expereince to manage SQL Server n WAN.
What are some of the factors that I have to consider if I have to support a
multi SQL server environment on a Wide Area Network.
any advice?... more >>
GROUP BY performance issue
Posted by Tom at 3/22/2007 5:25:07 PM
I've got a table called Lists , which has a record of each list item and
each publication.
As you can see there are 2 left joins ,in case there are records in either
of these which are required in the search results to populate fields
The results are grouped by all fields selected so that ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Deadlock on sql server
Posted by Roy Goldhammer at 3/22/2007 4:56:20 PM
Hello there
I've run very complex query on sql server, and in some of the huge tables
there aren't any indexes, including primary key.
This cause failure of my query on error: Process 81 become deaclock
How missing of indexes could cause deadlock?
... more >>
Showing who has a table locked
Posted by theredmiata NO[at]SPAM hotmail.com at 3/22/2007 4:03:51 PM
All,
I've been playing around with various forms of the sp_who2 script
which shows quite a bit of current SQL activity. What I am now looking
to accomplish is to show given a table name, who has this table locked
and who is waiting to lock this table?
Any help would be appreciated...
Ian... more >>
Non-Equi Joins
Posted by Justin Ryan Grenier at 3/22/2007 3:45:20 PM
I am taking Microsoft Course 4329 on Joining Data from Multiple Tables in
SQL Server 2005, and I am stumped in the Lab, Task 2, Step 3.
How can I rewrite the following SQL Statement to produce the same results by
using a non-equality operator in the join?
use adventureworks
select firstna... more >>
TRIGGER
Posted by CipherTeKST at 3/22/2007 2:56:11 PM
I am trying to create a trigger that will update a second column once a first
column is updated in the same row. For example I have a table with several
columns, I need for the trigger to check column1 to see if the integer has
reached 100 if so then update column2 in the same record. What I h... more >>
Error converting data type nvarchar to float
Posted by Bill Gower at 3/22/2007 2:49:20 PM
When I run this sql statement I get the above error. If I change the 'not
in' to an 'in', it works fine. If I run against each table separately it
works fine. Why can't I cast the nvarchar to a float and use the 'not in'?
I want to find all the records in the first table not in the second t... more >>
NEED HELP IN CODE: NOT A VALID IDENTIFIER (openrowset)
Posted by Claudia at 3/22/2007 1:57:05 PM
This is my original OPEN ROWSET into temp database (works good):
SELECT MyDerivedTable.*
INTO tempdb.dbo.MyTable
FROM OPENROWSET('MSDASQL', 'Driver={Microsoft Text Driver (*.txt;
*.csv)}; DefaultDir=C:\company folders\CorporateUpload;',
'select... more >>
troubleshooting
Posted by FARRUKH at 3/22/2007 1:55:35 PM
This is my new expereince to manage SQL Server n WAN.
What are some of the factors that I have to consider if Ihave to support a
multi SQL server environment on a Wide Area Network.
any advice?
... more >>
Complicated Union/Subquery Join?
Posted by jimjawn NO[at]SPAM gmail.com at 3/22/2007 1:49:20 PM
Or hopefully not that complicated.
Today Tomorrow Friday
Who Where Act Goal Act Goal Act Goal
Abbot Dunwitty 24 35 24 35 24 35
Bobb Rockdale 12 30 12 30
Clement Norcross 22 40 22 40
Frank Compton 23 25 23 25 23 25
Geoff Rodeo 36 0 36 0 36 0
Sandy Cartersville 23 35 23 35
Shel... more >>
Deadlock
Posted by Frank at 3/22/2007 1:29:16 PM
How would we find deadlock? What can we do to address it? is there any script
thanks... more >>
how to find permissions on objects using T-SQL
Posted by Eric Bragas at 3/22/2007 1:25:03 PM
Hi everybody,
I have limited access to the objects in a database: some read-only
access to tables, some not even read-only access, etc. Is there a
procedure or statement I can run that will return all object
permissions for a specific login?
Thanks,
Eric
... more >>
Cursor
Posted by FARRUKH at 3/22/2007 1:19:28 PM
wht are the advantages of using cursor and disadvantages? is there any
alternatives
thanks... more >>
get totals from query
Posted by John at 3/22/2007 1:01:58 PM
I have a select statement as such
select year, month, SUM(cost) as tCost from tblCost
group by year, month
I want to get a total for each month then get a grand total. How can I
create the SQL to get the grand total of the tCost column and add the word
total in there?
so i want my outp... more >>
Capturing recordset
Posted by Gilgamesh at 3/22/2007 12:30:11 PM
I've got a stored procedure which returns a recordset. I need to call this
stored procedure from inside another stored procedure and then capture the
recordset returned by the first procedure. I need to then parse the
recordset and retrun one of the columns.
How do I do that?
Thanks,
Gilg... more >>
change db name at runtime?
Posted by Test Test at 3/22/2007 12:29:37 PM
I've this update sql statement which I want to run on 6 different dbs.
All dbs reside on the same server. Is there a way I can change the db
name at runtime? what I want is when I run the update on 1st db, it
should be connecting to next db upon the completion of 1st and then
connect to 3rd db (... more >>
extract just time from datetime field
Posted by Adam Clark at 3/22/2007 11:30:36 AM
I need to run a query that looks at only the time (hh:mm) of a date time
field. Is there a way to do this? short of using Datepart?
thanks
Adam
... more >>
is null plus is not null doesn't equal count
Posted by Charles at 3/22/2007 10:40:06 AM
I've a table with a very large number of rows. The [Version] column is
a bigint that is nullable. Here's the results of some queries:
select count(*) from Events
3214670
select count(*) from Events where Version is null
3105991
select count(*) from Events where Version is not nul... more >>
What Owning Object called the trigger?
Posted by Rick Toner at 3/22/2007 10:21:03 AM
Is there any way to find out what object fired a trigger? I need to know if
it was another trigger or a stored procedure.
Thanks
--
Rick Toner... more >>
Debugging SQL code
Posted by Mark Goldin at 3/22/2007 9:53:36 AM
How can I setup debugging for SQL 2005 SQL coding?
Thanks
... more >>
two column PK and IN
Posted by erikv at 3/22/2007 9:17:11 AM
Two simple tables with a two column PK:
CREATE TABLE [dbo].[auxData](
[id] [int] NOT NULL,
[group] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[auxData] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_auxData] PRIMARY KEY CLUSTERED
(
[id] ASC,
... more >>
Wholesale latest brand name shoes, T-Shirt, Hats, Handbags,Jeans
Posted by kewenlong at 3/22/2007 7:37:53 AM
Please kindly visit our website:[url]http://www.shoesmonger.com.[/url]
You will have some unexpect harvest.
--
kewenlong
------------------------------------------------------------------------
Posted via http://www.codecomments.com
-----------------------------------------------------... more >>
Remove non alphabet characters from a column
Posted by Krishna at 3/22/2007 7:37:00 AM
I have a column with data which have alphanumeric and some special
characters. How do I remove all the characters which are not alphabets [a-z]
or [A-Z]... more >>
Fill Factor?!?
Posted by Derekman at 3/22/2007 7:34:13 AM
After much research I am still stumped as to exactly how decreasing the fill
factor for an OLTP database would reduce page splits. If I were to cut the
fill factor from 100% to 50% this would allow half the original space that I
had before, thereby doubling the page splits.
Any help woul... more >>
Debug SQL Script
Posted by Jay at 3/22/2007 7:10:06 AM
Can someone please tell me if you can debug an sql script and if so where is
the debuging tool bar
If you can't - can you tell me how to print the value of a variable as it
goes through a loop ... more >>
subqueries - general link/tutorial for syntax etc..
Posted by CharlesA at 3/22/2007 6:58:20 AM
Hi folks,
I'm using sql server 2005 standard edition but this isn't highly pertinent
except to say that it's Transact-SQL that I'm interested in
I'm fine with SQL in general but my weakness is subqueries (correlated or
otherwise) there seems to be an almost bewildering array of ways of deplo... more >>
Dynamic query execution.
Posted by Archana at 3/22/2007 6:42:05 AM
Hi all,
I want to build one update query dynamically.
Length of my update query is more than 8000 character. What should i
do to execute this query.
Because using exec i am getting error.
Any help will be truely appreciated.
... more >>
Importing into SQL Server 2005 from CSV
Posted by becka at 3/22/2007 3:25:35 AM
I have 10 csv excel files that need to be imported into an SQL database. Each
csv file contains around 10,000 records of data. I need all the csv files to
be in the same table. I cannot merge all the excel files together as excel
cuts off after 64,000 ish records.
How do i go about importi... more >>
Accounting Tree
Posted by Jess L. at 3/22/2007 1:39:38 AM
Hi;
I have a database holding accounts tree, where the tables look like this:
==Table #1==
RootAccounts = (RootAccount, AccountName, Description,....) [RootAccount=PK]
1001 Fixed Assets bla bla ....
1002 Moveable Ass... more >>
Last Date time
Posted by Rupesh Mondal at 3/22/2007 12:46:00 AM
Dear Friends
I am using sql 2000, i want to know the date time of the last record
inserted in the table.The table doesnt have a seperate column for
datetime.Please reply me as early as possible.
Rupesh Mondal ... more >>
SQL 2000 and SQL 2005
Posted by meo at 3/22/2007 12:00:00 AM
Can I install SQL 200 and SQL 2005 in the same machine?
I need to install on Windows XP to test to develop program
... more >>
Problem with executing procedure on 2005(SP1) with connection to 2000 (SP4)!!!
Posted by mladjo at 3/22/2007 12:00:00 AM
Hi.
We have this situation:
1. A procedure on SQL 2005 (SP1) run against SQL 2000 (SP3) ---> it
works fine
2. We installed SP4 on SQL 2000 and there is following problem:
procedure continue working for unlimited amount of time and when I try to
stop execution I wait some amount of... more >>
xml into mssql2000
Posted by AJA at 3/22/2007 12:00:00 AM
Hello
I watchet some posts but did not find answer to my question : how to
import data from xml into mssql 2000 using t-sql?
i tried:
USE Northwind
if(object_id('dbo.test_xml') is not null)
drop table dbo.test_xml
go
create table dbo.test_xml (Id int identity(1,1), col1 text)
... more >>
|