all groups > sql server (alternate) > march 2005
Filter by week: 1 2 3 4 5
How to connect using C#
Posted by AHM at 3/31/2005 8:24:04 PM
Hi
I'm trying to connect to a MS SQL Server using ASP.NET / C#. I've
already got some VB code that works but I'm unable to translate it to
working C# code. Can anyone help me out?
Working VB code:
Dim Conn
Conn = CreateObject("ADODB.Connection")
Const ConnectionString = "DSN=dsn... more >>
audit trail triggers
Posted by Zlatko MatiƦ at 3/31/2005 8:10:46 PM
Hello.
I tried to implement audit trail, by making an audit trail table with the
following fileds:
TableName,FieldName,OldValue,NewValue,UpdateDate,type,UserName.
Triggers on each table were set to do the job and everything was fine except
that in the audit trail you couldn't know which ro... more >>
filelistonly vs verifyonly
Posted by Tech Witch at 3/31/2005 7:38:04 PM
Hello all. Does anyone know if a successful completion of a 'restore
filelistonly' command would indicate that a backup file is valid? I've
noticed some of our backup jobs failing during the verify phase of the
maintenenace plan because of network issues, and I'd like a quick way to
check if t... more >>
Transaction MS SQL
Posted by [BuKoX] at 3/31/2005 6:26:55 PM
Hello.
I use ADO components in D4 and connect to MS SQL. I create new
transaction in ADO but an error occures: "You can't run more
transactions in this session". I use isolation level - ReadCommited. I
dont't run any transaction so I don't know what's wrong?
bye...
--
__ ... more >>
Exam 70-229
Posted by Do Park via SQLMonster.com at 3/31/2005 5:48:41 PM
Hello all
I am preparing exam 70-229(Designing and Implementing Databases with
Microsoft SQL Server 2000 Enterprise Edition).
I have some questions.
1. How many questions?
2. How long?
3. What type of questions?
4. Does Microsoft reform questions? ( Microsoft will use different type of
... more >>
ZZZZ New text 1/1 New Text Document.txt (0/1) 18
Posted by Power-Poster NO[at]SPAM power-post.org at 3/31/2005 4:10:41 PM
Wooo hoooo!!!!1... more >>
Join using max value
Posted by ree32 NO[at]SPAM hotmail.com at 3/31/2005 3:46:29 PM
I want to join two tables together but only join the where the column
in table 2 (of type date) is the maximum value. Is this possible?
Note table 1 is the main table it is also joined to other tables too.... more >>
Checksum not working
Posted by ajamrozek at 3/31/2005 10:07:44 AM
I'm developing a stored procedure to run an update based on values
entered into a .Net web form. I want to capture the chceksum of the
row when it is displayed on the form then validate that when the update
is exec'd. Simple enough logic, eh? The problem is when I try to use
the checksum(*) f... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
exec sp_executesql vs. sp_executesql and performance
Posted by elRoyFlynn at 3/31/2005 8:48:18 AM
This is a odd problem where a bad plan was chosen again and again, but
then not.
Using the profiler, I identified an application-issued statement that
performed poorly. It took this form:
exec sp_executesql N'SELECT col1, col2 FROM t1 WHERE (t2= @Parm1)',
N'@Parm1 int', @Parm1 = 8609
t... more >>
Need help in Updating multiple rows
Posted by mlrehberg NO[at]SPAM yahoo.com at 3/31/2005 8:44:54 AM
Hi,
New to writing sql script
I get this error in my sql script
Server: Msg 512, Level 16, State 1, Line 1
Subquery returned more than 1 value. This is not permitted when the
subquery follows =, !=, <, <= , >, >= or when the subquery is used as
an expression.
The statement has been ... more >>
CHECK Constraint to prevent a conditional duplicate
Posted by pdlevine NO[at]SPAM gmail.com at 3/31/2005 8:37:47 AM
Hi,
I need to enforce that a table does not have "duplicates" for a
specific status type in the table.
If the column "STATUS" = 2, then there can not be more than one row
with a specific "ID" column.
I can not use a unique key constraint because duplicate values for this
combo of columns... more >>
Database definitions
Posted by teser3 NO[at]SPAM hotmail.com at 3/31/2005 8:09:44 AM
I am going to start a database and need to know the difference between
Data Modeling, Schema and Database design?
I always thought of Data Modeling and schema as defining relationships
and primary and secondary key?
What is mean when someone designs an E-R diagram and a Data Flow
Diagram?... more >>
SQL Enterprise Manager and Query Analyzer displaying different Row Counts
Posted by jcabc NO[at]SPAM aol.com at 3/31/2005 7:07:17 AM
The row counts I am getting from SQL Enterprise Manager and Query
Analyzer are different. When I double click a table in Enterprise
Manager it gives me a row count of say 1000. However, when I select *
from that same table in Query Analyzer it returns 1028 rows. Anyone
know why or better yet,... more >>
urgent
Posted by kalikoi NO[at]SPAM gmail.com at 3/31/2005 6:30:22 AM
can any one give me a stored procedure which on execution creates an
excel file in one of my drives(like c:\temp.xls)that contains records
from a table selected which should be the argument of the stored
procedure.... more >>
Oledb stored procedure rowset binding
Posted by gigisoave NO[at]SPAM libero.it at 3/31/2005 1:43:56 AM
I have a strange problem with an OleDB call to a stored procedure that
returns a rowset.
Only the first time I execute the query, after I restart SqlServer, my
program crashes because
the rowset is empty. All next calls (after restarting my program, of
course) run successfully.
The context i... more >>
Newbie - What's wrong with following?
Posted by toedipper at 3/31/2005 12:04:27 AM
Hi,
This simple code using the Northwind db and SQL 2000...when I have the 2nd
from botton line commented out as I do now it works well and give me a
summary of the orders and totals from the [order details] table, nothing
special there.
However, if I uncomment the 'where ordervalue > 50... more >>
GROUP By clause or DISTINCT clause
Posted by Jacek at 3/30/2005 9:42:33 PM
Hi, can anyone shed some light on this issue?
SELECT Status from lupStatus
with a normal query it returns the correct recordcount
SELECT Status from lupStatus GROUP BY Status
but with a GROUP By clause or DISTINCT clause it return the recordcount
= -1
... more >>
Finding jobs that won't run due to Daylight Savings Time?
Posted by M Bourgon at 3/30/2005 3:01:11 PM
Since this weekend is Daylight Savings, we want to make sure of any
jobs that won't run due to the "missing hour".
I have written a small query against sysjobschedules that tells me
which ones have a schedule that runs between 2 and 3. However, it
doesn't include any jobs that run every X min... more >>
Specific Book Recommendation
Posted by python1 at 3/30/2005 2:38:29 PM
I would like to locate a book that focuses on MSSQL administration from
the command line. My background is in Informix, and I am used to doing
things from the prompt.
Any recommendations?... more >>
Question on using patindex
Posted by SQL_developer at 3/30/2005 1:40:24 PM
Hello,
I am trying to update a column in a table with an 8 digit string.
The 8 digit number is obtained from another column which is a comments
field.
e.g.
Comments Field :
1) RD-V0216970 RQST NON SMKING KING Unknown # : 22338921
2) Received verbal authorization Authorization # 040345... more >>
Server not using all available memory.
Posted by Ray at 3/30/2005 1:35:05 PM
I have a SQL Server 2000 (EE) machine dedicated to running only SQL
Server that is not using all of the memoery on the machine. I have read
and tried setting all of the memory setting available in the BOL with
no luck. The database is about 10 Gb in Size. I have four 2.7 Xeon MP's
16Gb of ram. T... more >>
Grouping columns
Posted by hartley_aaron NO[at]SPAM hotmail.com at 3/30/2005 1:18:00 PM
Hi,
I was trying to retrieve some data in such a way that it 2 columns will
be merged into one, with a column in between. I am trying to do
something like this:
SELECT LastName + ", " + FirstName AS Name
FROM EmployeeTBL
ORDER BY LastName
But SQL Server does not like this s... more >>
Importing Access databases into SQL Server
Posted by boblotz2001 NO[at]SPAM yahoo.com at 3/30/2005 1:16:11 PM
Hi there,
I have a situation where an application needs to import data from
number of access mdb files on a daily bases. The file names change
every day. The data import is very straight forward:
insert into sql_table select * from acess_table
There are up to 8 tables in each access fil... more >>
What is Cardinality
Posted by Rizyak at 3/30/2005 12:21:40 PM
-----Cross posted on comp.databases.ms-sqlserver and
microsoft.public.sqlserver.programming-----
Can someone please explain cardinality to me? I am having a problem with an
insert from a webpage.
When a user adds a venue with an event I need both tables to populate.
Currently only the ev... more >>
'Suspect' DB won't open - OS error 32- Help!
Posted by corey_bunch NO[at]SPAM yahoo.com at 3/30/2005 12:08:39 PM
Help! One of my main databases has been marked as suspect - the
initial problem is that my disk had no space. So I moved some files,
made some space, stopped & restarted the service, and now I get this
error in the errorlogs. There can't be anything else using the
database - I restarted the m... more >>
Inserts gradually slow down
Posted by andrewbb NO[at]SPAM gmail.com at 3/30/2005 12:00:17 PM
I'm inserting 2 million+ records from a C# routine which starts out
very fast and gradually slows down. Each insert is through a stored
procedure with no transactions involved.
If I stop and restart the process it immediately speeds up and then
gradually slows down again. But closing and re-... more >>
Need help with complex(?) querie
Posted by Patric at 3/30/2005 11:38:12 AM
Hi
I'm having some problem getting the following result.
I have 2 tables
Drivers
--------
DriverID int (PK)
DriverName varchar(50)
Runs
-------
RunID int (PK)
DriverID int (FK)
Speed float
ET float
Example data:
Drivers:
DriverID DriverName
-------------------
1 N... more >>
SQL Union with ORDER BY
Posted by handaman at 3/30/2005 11:29:19 AM
I am having problems retrieving some data from a table,
Tablename = "Magazine"
Columns
MagazineID MagazineName
1
2 Times
3 People
4 National Geographic
5 US
6 Sports Illustrated
I am trying to bind a dropdownlist in... more >>
Restore Production database to Development
Posted by Terri at 3/30/2005 11:22:23 AM
I have a production database with a backup job that creates files with the
naming convention dbname_db_200503291800.bak. I want to schedule a restore
job that will retire yesterdays backup. How can I write my restore statement
so that it will specify the backup file with yesterdays date.
Thank... more >>
isqlw.exe
Posted by nzanella NO[at]SPAM cs.mun.ca at 3/30/2005 10:42:11 AM
Hello,
I notice that the name of the Query Analyzer program (formerly
known as ISQL/W) is still isqlw.exe in SQL Server 2000. I am
curious as to where the name ISQL/W came from.
Feedback welcome,
Best Regards,
Neil
... more >>
Duplicate Reference Numbers using MAX()+1
Posted by JohnSouth at 3/30/2005 9:49:54 AM
Hi
Within a stored procedure I'm getting the next value of a reference
number using (simplified):
BEGIN TRANSACTION
@next_ref=select max(ref) from table
insert into table (ref) values (@next_ref+1)
create related records in other tables.
COMMIT TRANSACTION
I'm getting duplicate val... more >>
sql charindex split string
Posted by willem1968 NO[at]SPAM hotmail.com at 3/30/2005 8:43:56 AM
Hello
I am quite hopeless and of course a newbe.
The situation: Sql2k / query
I would like it ot break down the following string:
2004 Inventory:Ex.Plant Farm1:1st Cut:Premium:0094
Whereby:
Year = '2004 Inventory'
plant= 'Ex.Plant Farm1'
cut = '1st Cut'
grade = 'Premium'
lot# = ... more >>
Determine Quarter End and Beginning Dates
Posted by Matt at 3/30/2005 7:27:20 AM
Hello,
I have a query that I would like to schedule in DTS. The criteria of
this query checks for records in the table that are within the current
quarter. Here is what I have.
WHERE submit_date BETWEEN '01/01/2005' AND '03/31/2005'
I would like to dynamically generate the Quarter End and... more >>
owner data objects
Posted by origma NO[at]SPAM edpsistem.it at 3/30/2005 6:58:36 AM
I've a problem.
In my MSSql db I've some tables named username.mytable and only one
store procedure named dbo.sp;
CREATE TABLE [pippo].[mytable] (
[year] [int] NOT NULL ,
[month] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [pluto].[mytable] (
[year] [int] NOT NULL ,
[month... more >>
Transaction log shrinking... weird behavior?!?!?!?
Posted by jeffreyv NO[at]SPAM globetrotter.net at 3/30/2005 6:15:22 AM
Hi!
I'm studying to have my MCSE 70-228 certification and I'm trying some
things with backing up transaction logs and shrinking it.
Here's what I do:
There is no activity in the database by the way.
I have a transaction log of 1792 kb...
I do the following command:
BACKUP LOG Test... more >>
SQL Server: command line support
Posted by nzanella NO[at]SPAM cs.mun.ca at 3/30/2005 5:06:43 AM
Hello,
I would like to know whether it is possible to execute DTS
(Data Transformation Services) packages created from within
the EM (Enterprise Manager) user interface, from the command
line. That is, is it possible to execute a command at the DOS
prompt which will execute, and optionally ... more >>
Connecting to SQL Server 2000 on another subnet
Posted by Richard W Collens at 3/30/2005 2:58:16 AM
Hi Folks,
I'm very new to SQL Server. I have a home network. My primary connection
to the internet is using "Gateway 1" a linksys router, of which, my server
is a LAN node on that router. I have another LAN node connecting to the WAN
node of the "Gateway 2" a wireless USR router to use w... more >>
Count consecutive numbers
Posted by ChrisD at 3/30/2005 1:27:20 AM
I'm trying extract a count of consecutive numbers, or "unbroken" years in
this case, at any particular given time.
For example (simplified):
CREATE TABLE #Customers
(
CustNo INT,
YearNo INT,
IsCust CHAR(1)
)
INSERT INTO #Customers (custno, yearno, isCust) VALUES (999, 2006, 'Y')
INS... more >>
SQL DTS package - System.Runtime.InteropServices.COMException
Posted by yootaeho NO[at]SPAM yahoo.com at 3/29/2005 11:53:15 PM
Hi all,
We have developed a small windows-based application which utilises DTS
package.
And we distributed to our content people who don't have sql server
installed. But they have installed Microsoft Data Access Components
(MDAC) 2.8 on their machine. They can access our database ok but when
... more >>
More on mysterious data loss in mssql2k - a possible solution?
Posted by M Wells at 3/29/2005 4:59:38 PM
Hi All,
Further to my previous long-winded question about a situation in which
we appear to be mysteriously losing data from our mssql2k server.
We discovered an update statement, in the stored procedure we believe
is at fault, after which no error check was being performed.
Under certain... more >>
read only database performance question
Posted by Bruce Hendry at 3/29/2005 4:57:02 PM
In a nutshell, I have a stored proc that takes appx 15 minutes when it uses
a read-only database, and about 2 minutes when the database is not
read-only.
Details:
SQL Server 7
The stored proc exists on a writable database on the same server. It stuffs
a subset of about 20000 rows int... more >>
Front-end website search using Full-Text
Posted by jtreuting NO[at]SPAM gmail.com at 3/29/2005 4:10:09 PM
I am building a front-end search on a website to serach through the
contents of a full-text enabled databsae. I have everything set-up and
working using FREETEXTTABLE.
Here is what I want to do. When a user types in a search phrase that
has a couple words in quotes, I want it to do an AND fo... more >>
Dynamic Column amount query
Posted by Leo Muller at 3/29/2005 3:44:29 PM
I want to write a query that will give me a dynamic amount of columns back.
What I want to do, I want to create a calendar application, in which for
each employee, I want to show if he is in the office or not.
this should look like:
ID, Name, 1,2,3,4,5,6,7,8
88,Leo,0,0,1,1,1,0,0,1
The amo... more >>
local data
Posted by Jer at 3/29/2005 2:46:43 PM
I am implementing an MSDE database and I would like to keep some data
(like user preferences) in the Access project so that I can filter data
for each user based on their selected preferences. In Access I just
kept user preferences in the application database on each workstation
and used querie... more >>
SQL Server 2000 and Windows Server 2003
Posted by df at 3/29/2005 2:12:30 PM
I have several database on a Windows Server 2003. I re-registered this SQL
server, which is local, and after that I cannot see any of the databases in
the Enterprise Manager. The databases still work, since my applications work
fine. I have no clue how can I make these databases visible in Enterp... more >>
newbie: processing records sequentially
Posted by moco at 3/29/2005 12:29:40 PM
Hi to all,
I'm a newbie to T-SQL but not to programming. What I want to do is
process every record in a table, and depending on the values in the
record itself, either copy the record to another table or update a
third table, and the delete the original record. Basically, it's a data
prepar... more >>
Which is better? Int or smalldatetime(MSSQL)
Posted by Bostonasian at 3/29/2005 11:33:25 AM
I have a table that contains transactional data. Such as site view by
whom, when, which template, etc, etc...
Everytime when I pulled the report, hh:mm:ss never matters. Only
breakdown by dates, not time.
Having read some chapters of Ralph Kimball's book, I am inspired to
build "date" table wit... more >>
Many databases vs. 1 database
Posted by mike NO[at]SPAM rumblegroup.com at 3/29/2005 11:24:34 AM
Hi,
I am trying to determine what the overhead is per database in SQL
Server 2000 Standard. I have the option to put several customers in one
database, or give each customer their own database. I would like to put
each customer in their own database to simplify maintenance and
strengthen secu... more >>
Can someone explain this behaviour?
Posted by Igor Raytsin at 3/29/2005 10:26:41 AM
Hello All,
The following script is reproducing the problem assuming you have
Northwind database on the server.
Please note it gives you the error message on line 12.
USE tempdb
GO
sp_addlinkedserver 'Test17'
GO
sp_setnetname 'Test17', @@SERVERNAME
GO
IF EXISTS (SELECT 1 FROM db... more >>
Restore database fails because database is in use.
Posted by jbmccluskey NO[at]SPAM satcountry.com at 3/29/2005 9:30:55 AM
I'm a newbie so please be gentle.
In attempting to run a restore I get the following error message:
"Exclusive access could not be obtained because the database is in
use." However, it doesn't appear that there are any connections to the
database. At the suggestion of another thread, I ran s... more >>
|