all groups > sql server programming > february 2007 > threads for monday february 5
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
how to restore database in sqlserver 2000
Posted by junior at 2/5/2007 11:10:43 PM
Hello,
I am trying to restore my data base from it's backup. but it gives me
the following error.
"The media set for database 'oil_field' has 2 family members but only
1 are provided. All memebers must be provided. RESTORE DATABASE is
terminating abnormally."
Please help me out.
Thank... more >>
why mulitple primary keys allowed in a table
Posted by loufuki NO[at]SPAM gmail.com at 2/5/2007 10:41:53 PM
in sql 2000, you are allowed to create multiple primary keys on
different column.
I don't understand this.
Can anyone please explain.
... more >>
why mulitple primary keys allowed in a table
Posted by loufuki NO[at]SPAM gmail.com at 2/5/2007 10:41:48 PM
in sql 2000, you are allowed to create multiple primary key on
different column.
I don't understand this.
Can anyone please explain.
... more >>
can we switch user inside a stored procedure?
Posted by loufuki NO[at]SPAM gmail.com at 2/5/2007 10:34:39 PM
Hi,
Because some of the end users only have read only permission, however,
the sp needs to update a table, I am thinking of switch the 'login
account' to execute the command and switch back when it is done.
Is this possible.
Thanks
Lou
... more >>
please suggest some approach to avoid locking
Posted by loufuki NO[at]SPAM gmail.com at 2/5/2007 10:23:03 PM
Hi, assume that I have a table with 10 million records an needed to be
update.
what are your suggestion to avoid locking.
I am thinking of doing a while loop and update a subset, commit and
then move on the next subset.
would this work, what are the options do I have?
Thanks
Fu
... more >>
Back up database to PC client
Posted by Jason Huang at 2/5/2007 10:06:21 PM
Hi,
Is it possible to back up my SQL Server 2000 database to my PC running SQL
Query Analyzer?
If possible, how to do it?
Thanks for help.
Jason
... more >>
easiest question ever.
Posted by Ginger Estherskip at 2/5/2007 5:31:37 PM
Ok, how do I show what permissions a particular role has in SQL 2005 using
SQL Server Management Studio ? In 2000 it was easy, but I can't find out
how to do it in 2005... I feel so stupid asking the question, I couldn't
find the answer by searching google, so I'm stuck making my stupidity pu... more >>
User defined function on sp result set?
Posted by Linn Kubler at 2/5/2007 4:51:33 PM
Hi,
Running SQL Server 2000. I have a stored procedure that returns a result
set. I also have a user defined function that takes parameters. The result
set fields contain the data I want to use as parameters of the function.
I want to run the function against the result set of the store... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Image/Binary
Posted by Ed at 2/5/2007 4:48:00 PM
Hi,
If I want to import files (either .doc or .xls), should I use Image /
Binary as the datatype and what would be the major diff. between the two.
Thanks... more >>
Create Index on #Temp Tables
Posted by ricky at 2/5/2007 4:41:02 PM
Hi
I have a query, which contains multiple #tables, and I was wondering if it
is possible to create indexes on these tables, to speed up querying on these
tables, when joined to other tables?
Kind regards
Ricky
... more >>
OpenQuery and Temp Table Problem
Posted by lucius at 2/5/2007 4:14:46 PM
I have a stored procedure that calls another one with OpenQuery on the
same server. The called SP uses a temporary table. The calling SP gets
this error:
Invalid object name '#TempStuff'.
The calling SP has this code:
Select * From OpenQuery( LocalHost , 'Exec
[TestServer].[dbo].[T... more >>
How to concatenate several rows into one column
Posted by simon at 2/5/2007 4:07:52 PM
Hello, all:
I am new to SQL Server Express and am starting to build queries. I
would like to write a query that concatenates results from several
rows into one column.
For example, I have some assembly and would like to put all the parts
of that assembly in one column:
Example tables:
A... more >>
Detect Linked Server Already Exists?
Posted by lucius at 2/5/2007 4:00:52 PM
What system database/table do I query to check if a Linked Server
already exists?
I have this in my code:
Sp_AddLinkedServer @Server = 'LocalHost', @SrvProduct = '', @Provider
= 'SQLOLEDB', @DataSrc = @@ServerName
But I want to do something like (pesudo code warning)
Select Nam... more >>
dbo role and object ownership
Posted by robin.marshall NO[at]SPAM gmail.com at 2/5/2007 3:14:13 PM
Can anyone answer this quick question:
If I have a sql account with dbo role privilage in SQL2K, are there
any settings which I can set which will cause the objects created by
that account to created as dbo.<object>. I realise the object could
be prefixed with dbo. in the create, however I am... more >>
Service Broker problems
Posted by Mark at 2/5/2007 2:56:00 PM
Hi...
We've got an app that posts an xml message on one end of a queue to Service
Broker and uses a Windows Service to read from the queue on the other end and
process it.
The windows service calls stored procedures to fetch messages from the
queue, parse the xml and do the appropriate a... more >>
Poor performance and statistics
Posted by Corey at 2/5/2007 2:44:02 PM
I have a process that runs throughout the day. For the past month we have
been fighting performance issues with this process. It normally runs for
30-45 seconds but then all of a sudden it will start taking 5 minutes to
complete. The server is idle with no queue waits. One I run Update
S... more >>
find foreign keys pointing to table
Posted by John Grandy at 2/5/2007 2:37:55 PM
How to determine all foreign keys in other tables that point to a given
table ?
... more >>
table modification history
Posted by loufuki NO[at]SPAM gmail.com at 2/5/2007 2:20:15 PM
Hi,
what is the command to see who changed/modified a table/sp last?
any historial modification trail command?
Thansk
... more >>
datetime debug arg
Posted by JB at 2/5/2007 1:15:01 PM
SQLServer 2000, Query Analyzer question. What is the correct format for
initializing a datetime arg in the debug dialog? E.g. dbo.procMyProc
@dtDate smalldatetime .... In the debug dialog the arg is listed as
datetime. I have tried typing in e.g. 2/5/07 without the 's and also
'2/5/0... more >>
SQL 2005 upgrade problem
Posted by jay_wic NO[at]SPAM yahoo.com at 2/5/2007 12:53:25 PM
I am able to perform this query in SQL 2000 but in 2005, any
suggestions?
select * from table_A
where field1+field2 not in
(select field1+field2 from table_B)
... more >>
SQL Server 2005 Export/Import identity flaw
Posted by Arne at 2/5/2007 12:20:02 PM
The Export/Import tool in Management Studio seems unable to migrate an
identity.
Am I doing something wrong or shall a switch back to Sql 2000?
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)... more >>
temporarily allow duplicate keys?
Posted by Steven Spits at 2/5/2007 12:12:32 PM
Hi,
We have a case where there will be temporarly duplicate keys during the
update process. For example, Key "A" becomes "B" and "B" becomes "C". When
"A" is set to "B", we get a duplicate key error because "B" already exists
in the table.
Is there a way to temporarly disable all constra... more >>
The Difference between a Clustered and Non-Clustered Index
Posted by jamminjime NO[at]SPAM gmail.com at 2/5/2007 12:03:48 PM
Hey, everyone.
I have had this question 3 times in the last 4 interviews. I am not a
DBA and try not to do a whole lot of Database Administration/
Architecture. I do feel, however, that this question may be one of
the ones costing me job offers.
Can someone please explain, in layman's ter... more >>
AFTER UPDATE Trigger - Firing even though data is the same
Posted by Brian Kudera at 2/5/2007 11:54:01 AM
From what I read, the after update trigger should only fire if the
before/after values are different.
I have an insert/update trigger that fires no matter if the values have
actually changed or not. How can I prevent this? I have a datetime field that
tracks the last update of the row, and ... more >>
capturing SQL Statements
Posted by Susan Cooper at 2/5/2007 11:15:01 AM
Does anyone know how to capture an entire SQL Statement being executed in
SQL Server, and not just the first 255 characters?
I need to be able to identify which SQL Statements are the poorest
performing so that the application developers can improve them. I've setup
Profiler to trace the... more >>
How to connect to remote SQL Server?
Posted by picoder at 2/5/2007 10:56:10 AM
Hi.
I'm new to client-server based DBMSs. Now I'm reading about connecting
to the server using ADO.NET. Here is the example in C#:
OleDbConnection cn = new OleDbConnection();
cn.ConnectionString =
"Provider=SQLOLEDB.1;"+
"Integrated security=SSP;"+
"Persist Security Info=false... more >>
Searching for "Similar" Records
Posted by creed1 at 2/5/2007 10:51:02 AM
I am working on a process where a user is able to insert new records into a
database table. Before the insert takes place, I need to perform a quick
search through the existing records in the table to find any potential
duplicate records. The only column that can be used to identify potentia... more >>
Stored Procedure Help
Posted by Bryan Hughes at 2/5/2007 10:25:16 AM
Hello,
I have a stored procedure that needs to return a result if the input is 8
ore less and do a different result over 8.
IF @FamilySize < 9
BEGIN
SET @Guideline = (SELECT [WISH_DEV].[WISH_Sys].[fGetPovertyLevel]
(@FamilySize));
SET @FederalPovertyLevel = (SELECT
[... more >>
Multiple Rows INSERT
Posted by Hitesh at 2/5/2007 9:18:45 AM
Hi,
I have a tbl1 with four columns.
RecId, Branch, branchName, Notes
I another tabl, tbl2 with three cols:
CompId, Comp, cFlag, notes
Thrid table tbl3
CompId, Comp, aFlag, Branch, Notes
I am trying to write an INSERT trigger on tbl2 which will SELECT
DISTINCT 'branch' from tbl1
... more >>
Dynamic Queries and Performance
Posted by Spondishy at 2/5/2007 9:16:09 AM
I have a fairly large stored proc thats function is to do searches on
a view. The sp can take various parameters based on the search
criteria and can also be sorted both ascending and descending for each
output column. The results are also paged (first 10, next 10 etc).
The sp was created buil... more >>
Is a UDT the best way to force the format of a date?
Posted by John Heitmuller at 2/5/2007 9:00:33 AM
I have a smalldatetime called MyDate in a table. Anytime a user
accesses MyDate with a select statement. I would like to have MyDate
returned in the format mm/dd/yyyy. I would like the user to not have
to explicitly put CONVERT(CHAR(10),MyDate,101) in every select
statement.
I'm new to SQL... more >>
SYSOBJECTS
Posted by Dele87 at 2/5/2007 8:41:01 AM
Hi there
I have a contact management system on SQL Server 2000. When I double click
on some of tables, I get a message saying the table has been dropped;
however, the "dropped" tables are still listed on Sysobjects. On the other
hand, if I run sp_help on the table names I get a message sa... more >>
AfterUpdate, Me.Dirty. Update fields after one combo item has been selected.
Posted by Xav at 2/5/2007 7:40:47 AM
Hi,
I have a form with a datasheet in a ADP.
In the DS there is a combo box. When the user selects one item of the
combo box I run stored procedure to update other field in this record.
I tried to call the stored procedure the AfterUpdate of the combo but
without any success, I got an error r... more >>
How to use parameters in dataview
Posted by marxi at 2/5/2007 4:58:01 AM
As the questions above mentioned, I would like to generate a dataview
using parameters and I do not know how to do it. warning: the parameters is
not a constant. it is a var value.
for example:
create view dv
as
select * from table
where id = @param
--
marxi... more >>
Comparing Database objects
Posted by Jami at 2/5/2007 3:55:34 AM
Dear All;
I have a Development and Production database and they are a little out
of sink. Does any one know of a way to compare two databases (tables,
fields, sp) and report the differences? Thanks in advance.
*** Sent via Developersdex http://www.developersdex.com ***... more >>
Recursive CTEs loops
Posted by Jean-Nicolas BERGER at 2/5/2007 2:53:40 AM
Hello,
I'm currently checking a strange code that someone gave to me (thanks BG)
But I don't find help in MSDN or others that explains the conditions that
make the number of loops of a CTE be driven by the following SELECT
statement.
Could soemone explain to me how the SQL Engine detects it i... more >>
Extract DayOfWeek 'Mon' 'Tue' from shortdate field
Posted by Manish Sawjiani at 2/5/2007 1:47:00 AM
Dear Experts
I want to extract dayofweek rather than day no using transact sql
select datepart(???.sdate) from tours should yield
mon
mon
wed
tue etc ... please help
Thanks
Manish
--
Three Cheers to Technet for the Help!... more >>
|