all groups > sql server programming > december 2006 > threads for friday december 15
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
sys.key_constraints question
Posted by coosa at 12/15/2006 11:30:05 PM
Dear all,
I'm using SQL Server 2005 and would like to generate a script that
would display for me the column names that are primary keys;
For this target i checked the system views and found the view
sys.key_constraints which display all primary key constraints including
the constraint name, ob... more >>
Is It a BUG in SQL SERVER??
Posted by Mukut at 12/15/2006 10:55:25 PM
Hi All,
The following case is true both in SQL SERVER2000 and SQLSERVER2005.
Have a table TA. Columns are say COLA1,COLA2,COLA3......
TB is a different table.Columns are say COLB1,COLB2.....
Write a query:
select COLA1 from TB
-- This generates an error " Invalid Column Name 'COLA1'.
... more >>
Torn Page detected
Posted by gordon_gao NO[at]SPAM och.ca at 12/15/2006 8:34:43 PM
Trying to go to the bottom of a table using Enterprise Manager, at
record 369120 the following message showed up:
"[Microsoft][ODBC SQL Server Driver][SQL Server]I/O error (torn page]
detected during read at offset 0x0000026a400000 in file
'G:\...\data\ABC_Data.MDF'."
I can't restore the data... more >>
HOw to see cached query plan
Posted by SqlBeginner at 12/15/2006 8:11:00 PM
I read the difference between sp_executesql and Exec() in www.sommarskog.se
site. The point which I didn't understand is how to see the cached query plan
OR how visually we can realize the sp_executesql is better than Exec()?
They talk abt parameterised queries. How to see what parameterised ... more >>
8086 Row Size limitation on UNICODE Databases
Posted by Suresh Balasubramaniam at 12/15/2006 6:04:00 PM
How do we work around rowsize limitations in UNICODE database? I am using SQL
Server 2000 SP3. We need to keep the database as UNICODE. I am looking to see
if there is some settings that I can turn on to negate this behaviour.... more >>
Shrinking a database and logs in SQL 7/2000
Posted by David Lozzi at 12/15/2006 4:05:13 PM
Howdy,
I have one customer on SQL 7 and the rest on SQL 2000. How does one go about
shrinking a database and its logs? I have a database that is taking up 6GB
with 1.2GB free space and its logs are taking up 4.5GB with 4GB free space.
That's a lot of space. How do I get that space back???
... more >>
MSDTC ??
Posted by italic at 12/15/2006 3:33:47 PM
This is very interesting error.
To get the error;
-- Create new database, db1
-- run this query to create a table, create table test(testid int)
-- Create new linked server for db1
-- Create another database, db2
-- Run these queries to create one temp table and one sp,
creat... more >>
Getting subtotals to show on the same row
Posted by G B at 12/15/2006 2:39:34 PM
I am sorry if people have solved this kind of problem before, I wasn't
able to find a quick solution to it other than have a subquery to do the
work.
Currently my data looks like this:
provider_number provider_name site_location
stat_count routine_count
---------... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Delete data from all tables in a database.
Posted by Sam at 12/15/2006 2:04:57 PM
Could someone guide me as to how I can delete data from multiple tables
in a database.
Basically I have a Database which has 500 tables and I need to delete
data from all 500 tables
I dont want to type in delete from 'each table' 500 times.
Would some one be able to help me with a script ... more >>
record mismatch, possible missing filter?
Posted by D at 12/15/2006 1:10:59 PM
So I have a pretty extensive query that I run, which calls on several
subqueries. The main query displays more records than what it should.
I'm trying to include only 1 value '11' which can only reside in one of
20 columns RPTCTR01 - RPTCTR20. Then...I basically want any records
that match the i... more >>
Using varchar in Stored Procedure
Posted by Viji at 12/15/2006 12:46:31 PM
We have a stored procedure which dynamically creates a view. The variable
which stores the Query is a varchar but due to the limitation on the size if
the query is bigger than 8K we have an issue. Is there any other data type
we can use or is there some other way we could do this? Below is how... more >>
How to do this?
Posted by Chris Botha at 12/15/2006 12:45:18 PM
I have a table, let's say it has 2 columns, Some_ID and LineNumber and
has the following values:
Some_ID LineNumber
1 0
1 0
2 0
2 0
2 0
I want to do an update, so the LineNumbers will be sequential per Some_... more >>
Msg 1049, Level 15, State 1, Procedure
Posted by pmilana NO[at]SPAM optonline.net at 12/15/2006 12:36:12 PM
I was trying to create a function that used a cursor and was getting
this error. Turns out that since I was borrowing code from a function
written in SQL 2000, it did not like the fact that I used INSENSITIVE.
Once I removed this albeit old key word, the function compiled
successfully.
DECL... more >>
simple trigger question
Posted by Graham.Handler NO[at]SPAM gmail.com at 12/15/2006 12:15:17 PM
I am trying to create a trigger to capture rows that have been deleted
out of a table and who deleted the rows. I have been successfull in
capturing rows that have been deleted but I am unable to capture who
has deleted the row. For example if you are not the person who created
the record the ... more >>
simple trigger question
Posted by Graham.Handler NO[at]SPAM gmail.com at 12/15/2006 12:15:00 PM
I am trying to create a trigger to capture rows that have been deleted
out of a table and who deleted the rows. I have been successfull in
capturing rows that have been deleted but I am unable to capture who
has deleted the row. For example if you are not the person who created
the record the ... more >>
Local variable error in query
Posted by larclap NO[at]SPAM yahoo.com at 12/15/2006 11:43:40 AM
I cannot understand the error from the following:
DECLARE @pfx varchar(100)
SET @pfx='[pow_old].mailhouse.dbo'
SELECT @pfx
INSERT INTO [MailHouse2].[dbo].ClientUseCode
(ClientID, CountyFips, UseCode)
select 1 as ClientID, u.countyfipsid as CountyFips, u.usecodeid as
UseCode
... more >>
SQL Education:
Posted by sid at 12/15/2006 11:41:58 AM
I was registered in a class with Learing Tree for SQL Admin "531", but
they called and stated that they did not have enough people enrolled to
hold the class and would reschedule us in the next class (3 months
away).
I was able to find another class tought at the same time by a company
name... more >>
SSIS Script Task passing in Variables?
Posted by jobs at 12/15/2006 11:14:19 AM
Perhaps somebody in this news group knows.
In SSIS
I have a foreach container thats got an filename enumeration collection
of files in a
directory stored in a variable I call FileName.
Inside the foreach container, I have script task (vb.net) that I want
to pass that
FileName variable t... more >>
How to know if app role is in effect
Posted by Jeremy at 12/15/2006 11:06:36 AM
We have an app that uses app role security. (user authenticates, if
successful, app role is asserted). Since conversion to sql 2k5 from 2k,
execution of a particular stored proc seems dependant on the user's
permissions, not the app role's permissions. ie, log in as a user with full
permi... more >>
IF statement based on time of day
Posted by Terri at 12/15/2006 10:27:43 AM
I want to run job over a period of time that essentially polls for a file
and imports it if it exists. Let's say I run the job between 3:30 PM and
4:30 PM every 10 minutes.
If the job runs and it's after 4:25 PM I want the job to take a different
action. How do I check the time in an if statem... more >>
Time during certain period
Posted by Stijn Verrept at 12/15/2006 10:22:38 AM
Hi everyone,
I have the following table:
create table Planning (ID int not null, BeginTime smalldatetime not
null, EndTime smalldatetime not null, Type TinyInt not null)
Now I also have 2 values representing a period: @Start and @End both
smalldatetime.
When the period is found withi... more >>
EXCEPTION_ACCESS_VIOLATION error on Insert/Update trigger
Posted by Fayven Wren at 12/15/2006 8:31:26 AM
When ever I use one of my standard Insert/Update triggers in a table
(see below), I can not make updates to the table via Enterprise
Manager. I can update the table via Query Analyzer, VB, MS Access.
Actually, it is not all the time.
I currently have two databases, I can modify tables with th... more >>
sample decimal data as closest value to integer
Posted by bevanward NO[at]SPAM gmail.com at 12/15/2006 5:04:44 AM
Hi All
I have a number series that increase by a set amount between 0.0150 and
and 0.1000 and would like to sample this series to extract the closest
number to an integer value. So for example all values closest to a
multiple of 10. The number series has the field format numeric(9,4).
The d... more >>
Complex Counting
Posted by Patrick at 12/15/2006 4:01:01 AM
I have a table as follows, which shows the amounts of tickets sole by
different sales rep and their department. A ticket can be sold jointly by
more than 1 sales rep
ticketID,salesRepID,SalesDept
18922115,829,QW9
18922115,821,QW9
18922115,712,QE9
18922116,712,QE9
18922116,615,S71
Where... more >>
convert minutes to days,hours and minutes
Posted by vanitha at 12/15/2006 12:35:01 AM
hi,
hw to convert minutes to days,hours and minutes
thank you
vanitha... more >>
select newest record
Posted by luna at 12/15/2006 12:00:00 AM
ok my question wasnt worded great yesterday,
what im trying to do is pull latest appointment from a database
so if we had
ID,Appointment,Name,date
1,Consumer1,REP1,10/12/2006
2,Consumer1,REP1,14/12/2006
3,Consumer1,REP1,13/12/2006
4,Consumer2,REP2,15/12/2006
5,Consumer3,REP3,10/12/20... more >>
Connection Dialog appears on each query execution
Posted by Navaneetha Krishnan G at 12/15/2006 12:00:00 AM
Hi people,
Im facing problem like when i each time opening the query, the connection
dialog asks me the credentials everytime. Is there any option to supress it.
Please help me in finding solutions.
Regards,
NavKrish
... more >>
Performance hit with SP in different database to data?
Posted by Graham Morris at 12/15/2006 12:00:00 AM
For some time we have been loading our SPs into their own SP database. The
SPs operate on data in a different database. This works OK and has
advantages for us: to update the software we change the SP database, and
when the data is backed up we don't save all the SPs as well. Both
databas... more >>
DTS .BAS file
Posted by ricky at 12/15/2006 12:00:00 AM
Hi
I have saved a DTS package as a .BAS file made some small amendments to the
ordering of Tasks, is it possible to import this back in Enterprise manager?
Kind Regards
Ricky
... more >>
reocord replicated in views
Posted by Giacomo at 12/15/2006 12:00:00 AM
Hi to all,
with the following query
select V.CodiceGruppo, V.ContoGestionale, V.SottoContoGestionale
from vConsuntivazioneMensileOreGruppoCdC V
where V.ANNO =3D 2006 AND
V.ContoGestionale like '%100%'
order by V.CodiceGruppo, V.ContoGestionale, V.SottoContoGestionale
I've the re... more >>
Distributed TRAN
Posted by italic at 12/15/2006 12:00:00 AM
Hi All,
I have a problem.
We have two databases on same server and we are fetching database from one
and inserting another one. To do that, we are connecting to second database
via linked server.
In stored prodecure, we are following these steps,
--Select data from linked server, ins... more >>
update by using trigger or in code
Posted by Jason Huang at 12/15/2006 12:00:00 AM
Hi,
I have a table TableFather, and other table TableA, TableB, ..., TableH.
All those tables have a field name Status.
The only situation that the Status in TableMother will be Pass is all
TableA, ..., TalbleH's Status are Pass, if any Status in TableA ... TableH
is Fail, then the Status i... more >>
Writing update to a logging table
Posted by Jason Huang at 12/15/2006 12:00:00 AM
Hi,
In my SQL Server 2000, I would like to write a stored procedure for a
particular table TableZ which has 50 columns, and the stored procedure will
check if a column in a row is changed, and write down that change to
another table TableLog,
if we have 3 columns changed, the I insert the 3... more >>
|