all groups > sql server (alternate) > march 2006 > threads for march 22 - 28, 2006
Filter by week: 1 2 3 4 5
Update Table
Posted by Nothing at 3/28/2006 2:50:33 PM
I have a field, Y, in table A that I need to update from table B,
matching on comman field X in both tables.
Table A has 10K+ records with field X in it (Field X multipul times).
Table B has only disctinct records in it based field X. Table B also has
a colume Y that I need to copy to table A'... more >>
Stripping input mask from phone numbers
Posted by ILCSP NO[at]SPAM NETZERO.NET at 3/28/2006 1:55:42 PM
Hello, I have this Access 2K query that I need to re-create in MS SQL
Server 2000, so I'm using the Query Analyzer to test it.
One of the Access fields stores the home phone number. In the Access
query, if the phone number is null, it fills it up with zeroes
"000000000." If the phone has an i... more >>
Cursor looping versus set-based queries
Posted by JayCallas NO[at]SPAM hotmail.com at 3/28/2006 12:06:31 PM
I know this question has been asked. And the usual answer is don't use
cursors or any other looping method. Instead, try to find a solution
that uses set-based queries.
But this brings up several questions / senarios:
* I created several stored procedures that take parameters and inserts
th... more >>
Odd query plan for view
Posted by JayCallas NO[at]SPAM hotmail.com at 3/28/2006 10:07:33 AM
I have a SQL 2000 table containing 2 million rows of Trade data. Here
are some of the columns:
[TradeId] INT IDENTITY(1,1) -- PK, non-clustered
[LoadDate] DATETIME -- clustered index
[TradeDate] DATETIME -- non-clustered index
[Symbol] VARCHAR(10)
[Accoun... more >>
Updating Linked Records Across DB's
Posted by johnrou NO[at]SPAM ci.green-bay.wi.us at 3/28/2006 8:39:23 AM
Here's a problem that I can't find anyone else has run into. I'm using
Access and SQL Server, but the theory would be the same for any db.
I have a large number of tables that contain linked records
(intersection tables mostly). In the interest of space, I'll
illustrate an example:
tblS... more >>
Select first n rows of table
Posted by Andrew Lias at 3/28/2006 7:51:09 AM
Let us say that I have a table with two sets of values as such:
Item Extension
--- ----
100023 1
100025 1
100025 2
100028 1
100029 1
100029 2
100029 3
[...]
Note that a given item number can appear multiple times if it has more
than one extension number.
I w... more >>
Sql server report
Posted by Daniel at 3/28/2006 7:32:24 AM
Does SQL server have any build in generated report function ? or like
pivot tables for analysing data ? Pls advise.
Rgds
Daniel
... more >>
Database poster
Posted by Beeker at 3/28/2006 3:32:40 AM
Does anyone know where to get posters for the
database/objects/infrastructure for MS SQL 2005?
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Management Studio Express
Posted by Maury at 3/28/2006 12:00:00 AM
Hello,
I downloaded and installed
SQL Server 2005 Express
and Management Studio Express CTP,
but I noticed that there are several limitation
in MSEE: for example I can't create a new
database, is this true or I need some other tool?
Thanks
M.A.... more >>
SQL Server 2005: Migrate DTS to Where?
Posted by Peter Nurse at 3/27/2006 11:22:31 PM
I have right clicked on my DTS package and selected Migrate... I
assumed this is a good idea for future upgradeability (?) The process
worked without error but I have no idea where the resulting migrated
package can be found. The DTS package itself (apparently) remains
unchanged.
If your an... more >>
How to fire a trigger without changing table data
Posted by John Smith at 3/27/2006 8:55:19 PM
I have tables that I want to fire either an update or insert trigger on.
I could write a script containing a long list of inserts but I'm looking for
something simpler. Would isql work? Any special conditions to get it to
work?
I've tried tricks like 'update x set col = col' or 'update x s... more >>
Row Numbers for a View
Posted by Andrew Lias at 3/27/2006 4:32:09 PM
I've been given a task that I believe is, basically, impossible, but
I'd like to see if there's a way to do it.
What my boss wants me to do is to create a view, in SQL Server 2000,
that will provide not only a row number field of some sort, but that
will produce sequential ordering for arbitr... more >>
ranged datetime predicates & cardinality estimates
Posted by scott.swank NO[at]SPAM gmail.com at 3/27/2006 2:16:48 PM
Hello all. I'm running SQL Server 2000 and I'm trying to get a very
few, recent rows of data from a table based on an indexed datetime
column. Here's my predicate:
where order_date > dateadd(hour, -1, getdate())
i.e. everything more recent than one hour ago. This corresponds to the
3 or ... more >>
Order by in a INSERT INTO..SELECT
Posted by pb648174 at 3/27/2006 11:24:43 AM
I have the following basic statements being executed:
Create a temp table, #TempPaging
Insert Into #TempPaging (Col1, Col2)
Select Col1, Col2 From SomeOtherTable Order By Col2, Col1
Select * from #TempPaging
I can't provide a reproduceable scenario right now without making this
into a ... more >>
Assigning group numbers for millions of data
Posted by jacob.dba NO[at]SPAM gmail.com at 3/27/2006 9:58:55 AM
I have a table with first name, last name, SSN(social security number)
and other columns.
I want to assign group number according to this business logic.
1. Records with equal SSN and (similar first name or last name) belong
to the same group.
John Smith 1234
Smith John 1234
... more >>
Where to write XQuery statements?
Posted by Shilpa at 3/27/2006 3:50:00 AM
Where to write XQuery statements?
... more >>
I need help, please
Posted by Newsgroup at 3/27/2006 12:00:00 AM
I have a problem with my sql server.
I use a lot of Request.QueryString("Index1")
But the Request.QueryString is always the same.
I use in If-Loops.
The server send me the follow message:
Response Buffer Limit Exceeded
Execution of the ASP page caused the Response Buffer to exceed its
co... more >>
SQL Server 2005: Collation Conflict Error when selecting Database Properties
Posted by Peter Nurse at 3/26/2006 4:58:46 PM
I have just upgraded to SQL Server 2005 from SQL Server 2000.
In Microsoft SQL Server Management Studio, when I click on database
properties, I receive the following error:-
Cannot resolve the collation conflict between
"Latin1_General_CI_AS"
and "SQL_Latin1_General_CP1_CI_AS" in th... more >>
LDAP authentication for Yellowfin on SQLserver
Posted by duncan beaumont at 3/26/2006 4:42:35 AM
Hi,
- SQLserver 2000
- Yellowfin 2.4
- Windows 2003 server
I have been asked to investigate seting up LDAP authentication to
access our
Yellowfin reporting.
If anyone has experience in setting this up? Your help would be
appreciated.
Tips and tricks .. ??
Thanks
Duncan Beaumon... more >>
Multiple Foreign Keys on Same Table
Posted by FreeToGolfAndSki at 3/25/2006 7:41:59 AM
Hi,
I have an Orders Table that has Employee1 and Employee2 (one is the
sales rep the other is the telemarketing rep) Both of these fields
need to cascade update against the Employees table. I can't seem to
create the desired relationship in a Diagram and I'm not sure how best
to set this u... more >>
Multiple Foreign Keys on Same Table
Posted by FreeToGolfAndSki at 3/25/2006 7:41:49 AM
Hi,
I have an Orders Table that has Employee1 and Employee2 (one is the
sales rep the other is the telemarketing rep) Both of these fields
need to cascade update against the Employees table. I can't seem to
create the desired relationship in a Diagram and I'm not sure how best
to set this u... more >>
Query/View: The 2 newest periods for each indicator
Posted by Ryan Dahl at 3/24/2006 11:08:18 PM
Hi,
I'm working on a simple performance-program, where I need to extract
information from the 2 newest periods for every performance-indicator
- And from there calculate a trend between these results.
The problem is, that I can't find a simple way to extract the 2 latest
results.
The Tab... more >>
Copying encrypted stored procedures.
Posted by nickwilson.nick NO[at]SPAM gmail.com at 3/24/2006 1:44:50 PM
I have several stored procedures, created in a development environment,
that I need to move to a 'QA' environment, and then in turn, to various
production environments.
When I move these stored procedures, I would like to encrypt them,
using the 'WITH ENCRYPTION' clause.
My question is, how d... more >>
French characters are not imported properly with bcp
Posted by Wael at 3/24/2006 10:30:10 AM
Hi
I have a script that uses bcp to import data from an ascii text file
into SQL tables. The french characters are not copied properly. They
are converted to letters of the alphabet. I tried to change all the
fields to nvarchar instead of varchar and nchar instead of char, but I
got Greek chara... more >>
Accessing Oracle Tables From Within SQL Server 2000
Posted by Mark D Powell at 3/24/2006 9:05:08 AM
We are running SQL Server 2000 SP3. We have linked servers in use that
we use to access Oracle tables.
Recently the claim has been made that you can access Oracle tables from
within SQL Server without using a Linked Server. I searched Books
Online using keywords: linked, remote, and Oracle a... more >>
Licensing Question
Posted by jaustin NO[at]SPAM nautalex.com at 3/24/2006 7:27:46 AM
We are about to build web application that connects to a MS SQL
database. We are planning on building the application to connect to
the database through one user account, say "webuser" that all
visitors to the site will use. For example let's say the site is an
online store (for simplicity) an... more >>
SQL Server 2005 install - no Management Server
Posted by traceable1 at 3/24/2006 6:54:56 AM
I installed SQL Server Enterprise 64-bit. The installation seemed to
go fine, except the only thing listed under "MicroSoft SQL Server 2005"
is "Configuration Tools" in the startup menu.
I have no Management Tools.
Visual Studio 2005 is also installed on the box, and I read that
because ... more >>
Grant Win Acct Permission
Posted by wackyphill NO[at]SPAM yahoo.com at 3/24/2006 4:51:37 AM
I'd like to grant a WIndows account permission to connect to a db and
exec stored procedures. But am having trouble.
I want this type of effect but can't get the syntax correct:
USE MyDB
GO
CREATE USER 127.0.0.1\ASPNET --ASPNET Account for current machine
GO
GRANT EXECUTE ON AllStored... more >>
Help selecting an alias
Posted by Pumkin at 3/24/2006 4:20:49 AM
Hello guys, I need help in something as I don't know if it is possible
what I want.
I have a select like this...
SELECT Cod1 as SQL, Cod2 as Oracle FROM table
and I need to sort by alias SQL or Oracle as the select is composed
dinamically so it could be either Cod1 as SQL or Cod2 as SQL and... more >>
generation of sql for an alter column etc
Posted by Jeff Kish at 3/24/2006 12:00:00 AM
Hi.
I have a database I need to supply something (I'm assuming a t-sql script..
maybe something else is better) to update customer tables with.
The operations include mostly changing varchar lengths, though a couple of
columns were renamed.
I'd like to maybe figure out how to get Enterpris... more >>
Optimising queries
Posted by Chris Weston at 3/23/2006 7:11:35 PM
Hi.
Maybe I'm just being dim, but I'm struggling to get my head around
optimising a query with regard to indexes. If I make a select query, such
as a pseudo-example 'select * from bigtable where foo='bar' and
(barney>rubble and fred<flintoff)', and the table is indexed on 'foo', how
could I ... more >>
Help selecting the proper child record
Posted by CK at 3/23/2006 6:46:17 PM
Good Morning,
I have a person table with personID. I have a personRate table with
personID, rateID, and effectiveDate.
I need to select fields from personRate, but I want the fields from the
proper record.
I need the one child record that has the most current date of the largest
rateID.
... more >>
help with group by statement
Posted by jerball at 3/23/2006 2:43:53 PM
A client wants to keep track of the number of searches for keywords in
a date range. So, I'm storing each occurance of a search in a table.
The columns are:
PK: id
search_string
search_date
I'm trying to wrap my head around how I would select the number of
occurances for each string, di... more >>
bug - insert miliseconds
Posted by Dave at 3/23/2006 2:22:40 PM
I noticed that my tables are not storing the milisecond values that I
am inserting. Is this a bug? If not, can someone please explain what
is going or or point me to a resource so I can research it further.
create table #t (col1 int identity,col2 datetime)
insert into #t (col2)
SELECT '2... more >>
Website navigation hierarchy with SQL Server 2005
Posted by Brian at 3/23/2006 2:20:00 PM
Hi
I'm trying to convert some verbose SQL Server 2000 T-SQL code that uses
lots temp tables and the like into a SQL Server 2005 only version,
possibly using CTE.
What I want to achieve is a menu like that on
http://www.cancerline.com/cancerlinehcp/9898_9801_6_3_3.aspx
Notice how you have... more >>
connecting in a script to another db
Posted by Jeff Kish at 3/23/2006 2:05:14 PM
hi.
I've tried to use the exec sql connect to ... in query analyzer, but could not
get it to parse.
Can someone show me how in a script, say the middle, I can connect to another
database and execute the remaining script lines there.
This way I can have a script update two separate db's ... more >>
slow insert, logical fragmentation
Posted by Dave at 3/23/2006 9:50:11 AM
We had a table that had logical fragmentation of 50%. After rebuilding
(with default fillfactor 0) I noticed that inserts are much faster. If
my page density is 100% wouldn't I get more page splits? I know I am
missing something fundamental here. Could someone get me back on
track?
Table ... more >>
Performance Enhancements with Service Pack 4?
Posted by imani_technology_spam NO[at]SPAM yahoo.com at 3/23/2006 8:56:02 AM
We are running SQL Server 2000 in a 32-bit environment. Are there any
performance enhancements included in the new Service Pack 4? If so,
how do those enhancements compare to SQL Server 2005?
... more >>
Select 'Current LSN' and 'Transaction ID' from ::fn_dblog
Posted by Doug at 3/23/2006 7:34:50 AM
Gurus,
How do I choose multi-name 'columns' like "Current LSN" or "Transaction
ID" from ::fn_dblog?
I CAN select single 'column' names like 'Operation' and 'Context'.
I do NOT want all 'columns' returned:
- I don't want Select (*) from ::fn_dblog
Doug
... more >>
Join returns more than one row, Post code regular expressions
Posted by cheesey_toastie at 3/23/2006 4:09:12 AM
Hi,
I trying to write a select statement that will return each of my sales
men a region code based on a table of post codes using wildcards... eg.
MK1 1AA would be matched in the region code table to MK1%
SELECT dn.DEALER_CODE, dn.NAME AS DNAME, rc.REGION_ID,
rc.POST_CODE, dn.POSTAL_CO... more >>
Update the salary of each manager to be double the average salary of the employees he/she manages
Posted by satish at 3/23/2006 2:07:47 AM
create table employee(empid int,empname varchar(20),managerid int not
null, sal int)
insert into employee values(1,'ranga',22,5000)
insert into employee values(2,'satish',22,8000)
insert into employee values(3,'sunil',11,4500)
insert into employee values(4,'sridhar',22,2000)
insert into... more >>
Connecting to another SQL Server
Posted by Sun G at 3/23/2006 12:00:00 AM
Hi,
We are using two databases Live and Contingency. Everyday Backup is
taken and restored the same on Contingency Server. Cotingency Server act
as Live when Live server goes down.
I need to Connect to Contingency Server from Live Server through my
Stored Procedure to Stop/Delete particular... more >>
SQL Server 2005: TRIGGER AFTER INSERT
Posted by R.A.M. at 3/22/2006 7:54:34 PM
Hello,
I am learning SQL Server 2005.
I need to create a trigger which increments number of book's
publications:
CREATE TRIGGER InsertPublication
ON Publications
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Num smallint
SET @Num = SELECT NumPublications FROM Books WHERE ISB... more >>
Maximum number of databases used for each query in 2005?
Posted by Michael.Suarez NO[at]SPAM gmail.com at 3/22/2006 5:59:35 AM
In MS Sql Server 2000, if you run a stored procedure that query's more
than 8 databases, you get this error gets raised:
Maximum number of databases used for each query has been exceeded. The
maximum allowed is 8.
In 2005, does this maximum number still exist? if so, is it still 8, or
has t... more >>
Update n rows
Posted by Khan at 3/22/2006 5:55:26 AM
Hi,
I'm using table it has 100 rows, how can i update 10 or 15 rows at the
same time with single query. In real case, if user enters "5" in
textbox it means that the "5" rows will be updated.
In SAS i was using 'outobs' {outobs = n} which means n rows will be
affected.
Thanx.
... more >>
Monitoring SQL Server transactions
Posted by progrAMMAR at 3/22/2006 5:51:49 AM
Hi,
I am new to SQL Server Administraion, and straight away there
occured a case in which some users modified the database and I have to
track 'em out something this :-
A table was modified on 17 - 03 -2006 and now I want to see what
queries occured on that day how can I do that! I hav... more >>
How do I change the default collation string of an installation
Posted by David Greenberg at 3/22/2006 12:00:00 AM
Hi
When we installed SqlServer2000 we left the default collation name
(Sql_Latin1_General_CPI_CI_AS).
The user defined databases we created afterwards were defined with a
different collation name in order to be able to accept the character set
we use, Hebrew.
We are looking into switching D... more >>
open MDF file without MSDE
Posted by Pietro at 3/22/2006 12:00:00 AM
Hello,
I'm trying to access .mdf file (a sql server database) without having
SQL Server installed on the machine (neither MSDE).
It can be done from any programming language (like Java or C#)?
Is there anyone who knows how can I do it?
Or does a native library that can access the .mdf file exis... more >>
|