all groups > sql server programming > february 2007 > threads for thursday february 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
Hw 2 get Schema information using DTS
Posted by Dutt at 2/22/2007 11:33:56 PM
Hi Friends,
Cud anybody suggest me how to get Schema information using DTS?
Thanks,
Dutt
... more >>
How to check for existence of a record?
Posted by bob at 2/22/2007 10:50:04 PM
Hi,
Could someone please tell me the most efficient way to check for existence
of a record? I'd like to find out if there is one or more records in a
table matching certain criteria. I think I could do it with COUNT(*) or
SET ROW COUNT / SELECT combination. Is there a more efficient wa... more >>
resequence int column order - noobie
Posted by jobs at 2/22/2007 9:16:59 PM
To allow me to shuffle business order of rows via my web page, I have
column with row sequence. In some cases, like after deletes and
reorganizing, I want to resequence those numbers replacing gaps and
dups with new numbers.
for this example, say my table looks like this:
CREATE TABLE [dbo]... more >>
delete duplicate record in table
Posted by vipin at 2/22/2007 8:11:01 PM
hi,
i want to delete all the duplicate record in table
Pls give me query
... more >>
output parameter issue...
Posted by Brad Pears at 2/22/2007 5:41:35 PM
I am using SQL Server 2000.
I have a stored procedure where I want to return a value as an output
parameter from a select clause. I know there will only be one record
returned by the select statement.
The code I am trying is as follows...
select @Filename = select filename from {tablena... more >>
Invalid Subquery does not cause error (Bug?)
Posted by RobertP at 2/22/2007 3:45:58 PM
If I execute a statement with an invalid statement as a subquery, that
portion of the WHERE clause is ignored. Does anyone else have this
problem?
Example:
The following should delete only specific records in TABLE1 based on
records in TABLE2.
DELETE
FROM Table1
WHERE ID IN (SELECT ID ... more >>
SQL Server 2005 registry
Posted by Peter at 2/22/2007 3:14:13 PM
I find the following registry and wonder whether my understanding is correct:
Registry for SQL Server 2005 Default Instance (Database Engine and OLAP):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90
This seems to be registry for non-instance specific data.
HKEY_LOCAL_MACHINE... more >>
No Security Account Delegation
Posted by Nick nkw at 2/22/2007 2:38:34 PM
I don't have Security Account Delegation for two SQL server so I cannot
create a linked server. Any other ways to select tables from server A
and insert into server B? (Besides SSIS, DTS, BCP)... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Output Parameter(s): = <NULL>
Posted by bobbyolsen67 NO[at]SPAM gmail.com at 2/22/2007 1:56:58 PM
I've attempted to use the procedure below to return an output value.
When testing in Query Analyzer, the value is output to the Grids pane
but the Messages pane states - Output Parameter(s): @@DCValue = <NULL>
How can this be corrected?
CREATE PROCEDURE dbo.Test
@ss_filename_path varchar(... more >>
Indexes taking up huge amounts of space on SQL Server 2000
Posted by MartyNg at 2/22/2007 1:54:22 PM
I was just running some analysis tools on a SQL Server box, and it
showed several tables with tons of space being used for indexing, way
more than the data! Although I'm no SQL expert, I feel that I've got
the indexes created correctly. Table "2" below only has 2 indexes, but
look at the size! W... more >>
Removing blanks in sequential number of a field
Posted by Kirk at 2/22/2007 1:52:55 PM
I have a table where one field is called "ListNumber" (this is NOT a
primary key or unique record ID). This field determines the order in
which to display these records. Typically, as records are added the
"ListNumber" field will be populated with values like "1", "2", "3",
"4", etc. However,... more >>
Very Simple Question (";")
Posted by Claudia at 2/22/2007 1:50:01 PM
Been trying to search BOL.
Regarding placement of the ";":
Some samples use the ";" every time.
What is the rule for placement?
I have a general idea the ";" has to do with paroperly parsing each
statement???
Two different examples in BOL, but don't understand "when" and "how" the ";"
sh... more >>
How send changes from test database to production?
Posted by Ronald S. Cook at 2/22/2007 1:48:42 PM
I have a production database and a test database.
The test database has updated schema elements and I would like push those
out to production.
Is there some way I can pull up both databases and some tool (maybe VS2005
for Database Pros?) compare the two and give me a script that I would ne... more >>
Calculate time difference
Posted by Mark Goldin at 2/22/2007 1:17:00 PM
Let's say I have a process that starts at 3:30 pm and ends at 6:15 next
morning.
How do I calculate a time of that process?
Thanks
... more >>
How to access data table within data set to add new row
Posted by JT at 2/22/2007 12:04:10 PM
I have an SQL database with one table in it. I want to load the table into
a DataSet, add new records to the DataSet, then commit the changes back to
the database.
Using C#.NET, the following loads the DataSet and fills it:
string SelectString = "SELECT * FROM dbo.Trad... more >>
Update Data And Select It
Posted by Derek Hart at 2/22/2007 11:53:02 AM
Is there any way to write a stored procedure that can update data, but then
do a select statement in the same procedure that selects the data that was
just updated. Can I use transactions to do this. I want to make sure that
the data is updated, and returned to the .Net program. If another us... more >>
Sql server 2005 database mirroring restore question
Posted by kulkarni.ninad NO[at]SPAM gmail.com at 2/22/2007 11:38:09 AM
Basically, the mirror database is in a norecovery mode, so its not
accessible and not readable now what will happens if i specify standby
mode instead of norecovery mode for mirror database?
Also if i can't specify standby mode then is there any way to bring
the database to read only mode?
... more >>
Return Columns along with MAX Value
Posted by vlow79 NO[at]SPAM gmail.com at 2/22/2007 11:04:18 AM
Hi all,
This is my situation
SalesReceiptId, ItemCode, ItemPrice, QuantitySold
1, AAA, 10.24, 5
1, BBB, 13.89, 6
1, CCC, 12.09, 7
1, DDD, 19.98, 2
1, EEE, 34.89, 1
2, BBB, 14.23, 63
2, CCC, 11.09, 7
3, DDD, 78.98, 2
3, EEE, 99.10, 44
I want to find out which Item in all Sales Rece... more >>
Daylight Savings Time for SQL Server?
Posted by J at 2/22/2007 10:38:26 AM
Hello. Our SQL Server 2000 database is running on Windows 2000 Server and
was wondering if anyone knew if the new Daylight Savings Time rule will
affect any date functions in sql server like in the stored procedures?
Thanks in advance.
J
... more >>
DBCC INDEXDEFRAG and DBCC DBREINDEX
Posted by Jodie at 2/22/2007 9:57:32 AM
Hi All,
What is different between DBCC INDEXDEFRAG and DBCC DBREINDEX and
when we should run the DBCC INDEXDEFRAG and when you should
run DBCC INDEXDEFRAG. I knew DBCC INDEXDEFRAG is online operation
but not DBCC DBREINDEX. So what we should do here when
we need to run these commands.
Thanks,
... more >>
Linked Server Query in SQL Server 2005
Posted by Ryan at 2/22/2007 9:25:17 AM
How do I fix the following query running on SQL Server 2005 (Column2 is
defined as NCLOB in Oracle)?
select * from openquery(TheLinkedServer, 'SELECT Column1, Column2, Column3
from Category');
Executing the query above generates the following error:
OLE DB provider "MSDAORA" for linked ... more >>
SQL Server 2000 Cursors
Posted by Paul at 2/22/2007 9:01:31 AM
So I create a cursor in SQL Server 2000.
I loop through it successfully.
Then I want to loop through again.
What SQL command do I use to get to the start of the cursor again after
looping through it once?
TIA.... more >>
Rounding Issue with Money Multiplied by Real (Percent)
Posted by Scudder at 2/22/2007 8:48:12 AM
I have a database app where a frequent need arises to take a percentage of a
stored monetary value. We have always had rounding issues and I now believe
it is due to the way the data types are stored in SQL Server and how we are
using them to calculate percentages. The monetary values are st... more >>
Custom data types
Posted by obelix via SQLMonster.com at 2/22/2007 7:40:08 AM
I want to convert 9184772 to 9,184,772
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200702/1
... more >>
windows services for Unix - bulk insert from nfs mount
Posted by jobs at 2/22/2007 6:42:41 AM
I can see the mount from windows explorer as on the server as the
user that starts SQL services.
However, when I try to load or access the file from sql server I get
the below errors.
DECLARE @READOUT VARCHAR(2000)
BULK INSERT datain
--BULK INSERT FILEIN
FROM '\\xx.xxx.xx.xxx\xx\xxxi\... more >>
Large data sets for pubs, or Northwind
Posted by JayKon at 2/22/2007 5:43:43 AM
I'm looking for a very large data set for the pubs, or Northwind database.... more >>
best datatype for a percent field
Posted by archuleta37 at 2/22/2007 5:34:38 AM
In terms of best practices, what is the best datatype to use for a field that
holds a percent, as with a sales commision percentage? I have three field
that I'm working on and would like to set them up according to best practices:
payment - > smallmoney
commission_rate -> decimal(???), numer... more >>
SQL stored procedure
Posted by Krishnakanth at 2/22/2007 5:25:13 AM
CASE budgetcategory
WHEN 'ECP' THEN 1
WHEN 'CAP' THEN 2
ELSE 3
END as SortVal1
CASE ProjectType
WHEN 'PROJ' THEN 1
WHEN 'IDF' THEN 2
WHEN 'CLNUP' THEN 3
WHEN 'REBL' THEN 4
WHEN 'R&R' THEN 5
WHEN 'RTDP' THEN 6
WHEN 'CAP' THEN 7
ELSE 8
END as SortVal2
... more >>
SQL Stored procedure
Posted by Krishnakanth at 2/22/2007 5:24:00 AM
CASE budgetcategory
WHEN 'ECP' THEN 1
WHEN 'CAP' THEN 2
ELSE 3
END as SortVal1
CASE ProjectType
WHEN 'PROJ' THEN 1
WHEN 'IDF' THEN 2
WHEN 'CLNUP' THEN 3
WHEN 'REBL' THEN 4
WHEN 'R&R' THEN 5
WHEN 'RTDP' THEN 6
WHEN 'CAP' THEN 7
ELSE 8
END as SortVal2
... more >>
all combinations of an input string..
Posted by Senthil at 2/22/2007 5:04:49 AM
Hi all.
given an input string of any lenght the output should be all
possible combinations of the input.
Eg : Input is GOD
then the output should be GOD, GDO, OGD, ODG, DGO, DOG.
Can anyone help me with this?
Thanks
Senthil
... more >>
Update Trigger
Posted by JMH at 2/22/2007 4:14:07 AM
Can anyone explain to me how to retrieve the value of a field BEFORE I update
it?
I've seen a few examples on the net that look like "REFERENCES o AS old" but
these just don't seem to work in 2005.
... more >>
query on log shipping
Posted by prince at 2/22/2007 3:03:00 AM
Hi all,
I have one doubt, in log shipping feature when backup job copies log files
from Primary server is that logs will get truncated? or not?
if I do a copy only backup of log files on the primary server will I be
getting full logs without affecting log shipping?
thanks and regards
pr... more >>
Datetime extraction
Posted by ciupaz at 2/22/2007 2:00:52 AM
Hi all,
with a table with this structure:
CREATE TABLE A(
ID varchar(5) NOT NULL,
DataMovimento datetime NULL,
Numero int NULL,
Prezzo money NULL
)
and this example values:
Insert into A VALUES ('A0','20070222',12,2)
Insert into A VALUES ('A1','20070220',0,10)
Insert into A VALU... more >>
SQL 2005 system database backups
Posted by NH at 2/22/2007 1:46:03 AM
Hi,
I am backing up the system databases (master, msdb, model). But whats best
practive regarding shrinking the system databases, updating statistics,
rebuilding and re-organizing indexes etc
As part of the database maintenance plans should I do the above for system
databases too?
tha... more >>
difference between 'declare @var' and '@var' in stored procedure
Posted by Bob at 2/22/2007 12:02:12 AM
Hi,
what's the difference in a stored procedure between:
create procedure name
(
@var int
....
)
and
declare @var int
Thanks
Bob
... more >>
SQL query against multiple databases
Posted by Steffen Meier at 2/22/2007 12:00:00 AM
Hi,
I need to write a query that could run against multiple databases.
I have a couple of databases named LOG_001, LOG_002....LOG_010
The structure\tables of all databases is identical.
A simple query would look like this:
SELECT *
FROM LOG_001.dbo.WebProxyLog
WHERE LO... more >>
Arithmetic overflow error converting expression to data type datetime
Posted by Andy Fish at 2/22/2007 12:00:00 AM
Hello,
a user of my C# asp.net 1.1 application running against SQL server 2000
managed to generate this exception:
System.Data.SqlClient.SqlException: Arithmetic overflow error converting
expression to data type datetime.
at System.Data.SqlClient.SqlDataReader.Read()
the SQL it was ... more >>
|