all groups > sql server (alternate) > august 2007
Filter by week: 1 2 3 4 5
Apparent DB engine bug in SQL Server 2005
Posted by Dimitri Furman at 8/31/2007 11:03:27 PM
SQL Server 2005 SP2 (build 3054)
Consider the following scenario:
- A complex multi-statement table valued function is created. Let's call
it dbo.tfFunc(@Param1, @Param2)
- A SELECT statement is executed, that calls the above function twice,
each time with a different set of parameters. I... more >>
problem with subselect
Posted by Bart op de grote markt at 8/31/2007 6:58:08 AM
Hello,
I have a problem with a subselect I use in a stored procedure:
UPDATE #TEMP_TABLE
SET P_ID_1=(SELECT top 1 b.P_ID_1 from #TEMP_TABLE b where
b.ID=PARENT_ID),
P_ID_2=PARENT_ID,
P_ID_3=ID
WHERE PARENT_ID IN (SELECT P_ID_2
FROM #TEMP_TABLE b)
So ... more >>
Migrating Database changes to Production
Posted by RichardLamont at 8/31/2007 12:10:07 AM
We often have to migrate changes to sql server 2000 databases from
development to production. Normally we dump the sql from Enterprise Manager
for production and development and do a diff (using CSDiff - downloadable for
free).
From the diff information we create some scripts to add new tables... more >>
Any limitations on EndPoint Creation par instance
Posted by SQLMan_25 at 8/30/2007 7:26:19 PM
Hi All,
I am trying to create multiple endpoints for mutiple database that has
service broker enabled. It allows me to create only one endpoint for
service broker then i get the following error:
Msg 7862, Level 16, State 1, Line 1
An endpoint of the requested type already exists. Only one en... more >>
forming a string with dateparts
Posted by rgintexas at 8/30/2007 8:31:57 AM
I want to create a string using the week number and year of a date.
For instance, if i have a date of 1/3/2007, which would be week 1 of
2007, i want to create a string that says 'Wk1-200707'.
i know it's basically 'WK' + CAST(DATEPART(WK,'1/3/2007') AS VARCHAR)
+ '-' +CAST(DATEPART(YEAR,'1/3/2... more >>
Help Needed For Date field (Age) Calculation In SQl query
Posted by Dinesh at 8/30/2007 3:18:34 AM
Hi experts,
I am working on SQL server 2005 reporting services and i am getting a
problem in writting a query.
Situation is given below.
There is one table in database Named Child
Now i have to find the All childrens whoes Age is 13 years Base on
Some given parameter.
If User select... more >>
sql server 2008
Posted by rcamarda at 8/28/2007 6:31:47 AM
I just downloaded the SQL Server 2008 CTP. Anyone here check it out
yet? Thoughts?
... more >>
copy users on server to another - SQL 2005 SP2
Posted by rcamarda at 8/27/2007 9:20:22 AM
I've built a development server for my SQL 2005 production
environment. I've restore the databases from a backup, and I want to
copy the users from my production to development machine.
How can I do this?
TIA
Rob
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
restoring msdb from a network tape backup
Posted by at 8/24/2007 8:11:05 PM
I have inherited a SQLS erver 2000 instance where the client never
implemented a backup startegy for the "master" and "msdb" databases.
MSDB is now showing errors and my only option for a restore is from a
tape backup of the server.
Any thoughts..
... more >>
Subqueries and Aggregate Functions
Posted by Paul at 8/24/2007 6:26:22 PM
Hello All,
I am having trouble coming up with the correct SQL to accomplish a
task. Most of the SQL I use is quite simple and I rarely have to
resort to subqueries so I don't have a lot of experience with them.
The following SQL gives me the result set that I want.
SELECT
ent.colDate,
... more >>
Trying to join three tables
Posted by JJ297 at 8/24/2007 9:30:06 AM
Having problems joining three tables. I only want the Title field but
need them to give me the correct data.
Here are my three tables and their fields.
1. Titles
TitleID
Title
[description]
2. Classifications
ClassificationID
[Description]
3. Titlec... more >>
Restore sql server express bak file as different db?
Posted by nano at 8/24/2007 8:55:37 AM
I have a bak file of a sql server express database from another server,
and I'd like to restore it to my dev box as a different database. Does
anyone know how to do this?... more >>
how can i send mail by using sql server
Posted by sachin shah at 8/23/2007 11:47:59 PM
hi all
my query is how can i send mail by using sql server, i think by unsing
xp_sendmail store procedure we can do this but my problem is what
paramater to be pass to this store procedure if i want to send mail
from my local machine to another user, bcos i am geeting this error
msg in query ... more >>
Convert INT YYYYMMDD to date mm/dd/yyyy
Posted by rdraider at 8/23/2007 10:41:56 PM
I can't seem to find a way to convert an INT type in the form of YYYYMMDD to
an actual date form of mm/dd/yyyy
Can anyone pointt me in the right direction?
Thanks
... more >>
Convert CHAR YYYYMMDD to mm/dd/yyyy
Posted by rdraider at 8/23/2007 10:30:27 PM
I can't seem to find a method of converting a CHAR(8) column in the form of
YYYYMMDD to an actual date such as mm/dd/yyyy
Can anyone point me in the right direction?
Thanks
... more >>
help with while loops
Posted by lhiregoudar NO[at]SPAM hotmail.com at 8/23/2007 1:58:14 PM
hi,
I am trying to
1)get all the names of a table that match another table
2)while count=0, then I want to insert into another table 'group'
after getting its key.
I am totally lost, can somebody point me in the right direction.
how do I get the individual name so that I can insert into th... more >>
Dynamic Columns
Posted by aCe at 8/23/2007 8:49:59 AM
Hi all,
these are my tables :
CREATE TABLE [dbo].[mh1](
[mh1id] [int] IDENTITY(1,1) NOT NULL,
[mh1init] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[mh1name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[seq] [smallint] NOT NULL,
[date_created] [datet... more >>
Dynamic Columns
Posted by aCe at 8/23/2007 8:29:34 AM
Hi all again,
I need an output like :
|----|----|----|---|------|
|row1|row2|row3|...|row(n)|
|----|----|----|---|------|
is possible to create output like that, without querying manually
cause too many dynamic columns in my application.
sorry if my question a bit weird cause i'm a newbie i... more >>
Restore LDF file after restoring backups in SQL Server 2005?
Posted by l0b0 at 8/22/2007 8:34:28 AM
I'm working on a restore procedure for the case where all MDF files
are missing, but the LDF files are all intact. A full backup is done
every 24 hours, and a log backup is done every 3 hours. After
restoring the last full + log backups, is it at all possible to use
the LDF files to recover data... more >>
Run all .sql files (scripts) in project (SQL Server 2005 SP2)
Posted by downwitch at 8/22/2007 8:24:49 AM
Hello,
I've run as many keyword combinations searching for this as I can
think of, but cannot find a simple answer.
The situation: I have a database that is mid-conversion/redevelopment.
I frequently rebuild my dev copy from the production version, which
requires a bunch of DDL script, and ... more >>
SQL sever 2005 express move windowns authentication choice to mixed authentication
Posted by Fonseca at 8/22/2007 3:33:00 AM
I folks.
I Have installed sql server 2005 express and choosed windows
authentication on instalation, but i make a mistake and now i need
mixed authentication, how can i modify this whithout uninstall and
install again the application?
thanks for the help.
... more >>
Accessing one db by two sql server installations (eg. native vs vmware)
Posted by HP at 8/21/2007 11:58:52 PM
Hi there
As many people nowadays, I have 2 XP installations on my laptop - one
running natively and one in vmware box running on ubuntu (situation
even more common with osx on intelmacs).
Since I would like to be able to work on same development projects in
both these environments, dependin... more >>
Need to find instances of duplicates within a column; joining 2 tables.
Posted by aknoch NO[at]SPAM gmail.com at 8/21/2007 4:33:31 PM
My basic situation is this - I ONLY want duplicates, so the opposite
of DISTINCT:
I have two tables. Ordinarily, Table1ColumnA corresponds in a one to
one ratio with Table2ColumnB through a shared variable. So if I query
TableB using the shared variable, there really should only be on
record ... more >>
Need help w/ a script
Posted by click37 NO[at]SPAM gmail.com at 8/21/2007 9:28:07 AM
Is there a query that will let me see what SQL users has what access
to which DBs and what lvl access they have?
... more >>
ssis EXEC command
Posted by gelangov NO[at]SPAM hotmail.com at 8/21/2007 8:38:27 AM
I have 2 variables, one is the column name of the table and the other
one is the table name and I need to write this in the "Execute SQL
task" of a "For each loop" container in a ssis package like this:
Truncate table <tableName>
Insert into <tableName>
Exec (' select [' + ?+ '] from '+ ?)
... more >>
Problem with DB_OWNER role..
Posted by monty at 8/21/2007 7:13:20 AM
Hi All,
I am facing a problem while executing a statement through C++ code
using OLEDB API of Sql server.
There is a problem with DB_OWNER role. If I will enable the DB_OWNER
everything is going fine but if I will remove this role than I am
getting error "DB_E_ERRORSINCOMMAND".
But if I w... more >>
MS SQL dealing with duplicate columns in rows?
Posted by Yas at 8/21/2007 2:04:21 AM
Hello,
Suppose I have the following table...
name employeeId email
--------------------------------------------
Tom 12345 tom@localhost.com
Hary 54321
Hary 54321 hary@localhost.com
I only want unique employeeIds return. If I use Distinct it will still
return all of the above as... more >>
A floating point exception occurred in the user process
Posted by Massa Batheli at 8/20/2007 6:55:24 PM
sql server 2000 sp4 build 2184
runs stats with maintenance plan
sp_msforeachtable
stored procedure updating full stats for each table and the results
are identical
A floating point exception occurred in the user process. Current
transaction is canceled.
all pointers are to move to late... more >>
SQL Server error
Posted by Leisses Loud at 8/20/2007 5:45:52 PM
Hi,
I was trying to restore my database and received the error described
in image.
http://img404.imageshack.us/my.php?image=errorestorebibliosescdb3.jpg
I just search for a solution but didn't found yet.
If someone could help me I'd be grateful.
... more >>
An expression of non-boolean type specified in a context where a condition is expected, near ')'.
Posted by pbd22 at 8/20/2007 1:10:56 PM
Hi,
I am trying to create an update statement
on a table with a foreign key to the Users
table (userid).
I am getting the error:
An expression of non-boolean type specified in a context where a
condition is expected, near ')'.
Below is the Update statement.
UPDATE LastLogin SET
... more >>
Dinamyc Function
Posted by aCe at 8/20/2007 10:27:41 AM
Hi all,
i wanna ask about dinamyc Function (FN).
This is my table :
CREATE TABLE [dbo].[unit](
[unitid] [int] IDENTITY(1,1) NOT NULL,
[unitname] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[description] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL,
[date_creat... more >>
Copy data from one table to another table with change in identity column values
Posted by satish at 8/20/2007 9:21:30 AM
HI,
I have a table
Create table test(a int identity(1,1), b int)
insert into test(b) values(12)
insert into test(b) values(30)
insert into test(b) values(65)
insert into test(b) values(78)
insert into test(b) values(36)
o/p
a b
1 12
2 30
3 65
4 78
5 36
i need to copy the ta... more >>
SQL Profiler - SPID
Posted by wesleym312 NO[at]SPAM gmail.com at 8/20/2007 12:28:04 AM
Hi,
What is the SPID column for in SQL Profiler?
I have many databases but I only want to view the transactions on one
particular database. What changes should I make to the filters inorder
to achieve this. I have tried database name but that doesnt work.
Thanks in advance
Wes
... more >>
How to check if a Table is <empty> ie doesnt contain any rows
Posted by Yas at 8/18/2007 7:52:35 AM
Hi, is there a way I can check if a table is empty and contains no
rows?
I have a Table1 which being dynamic can sometimes end up with now
columns what so ever. I'm using Table1 in one of my views along with 2
other tables and I would like put a condition at the...something like
AND Table1 IS... more >>
Inconsistent identity values
Posted by at 8/17/2007 7:04:36 PM
SQL Server 2005
We have a table where the current identity value is lower than the
maximum value. This is the first time I've seen such a thing. How
can this occur? I see postings about this problem but they seem to
concern older versions of SQL Server.
I did some tests on another table ... more >>
Combine record
Posted by dede at 8/17/2007 5:05:15 PM
Hi guys..
is there any query to do this action:
i want to combine view record into a single record.
exm.
table 1
Name A B
Jack 10 22
jack 12 21
jack ... ....
jack 1 11
ben 12 2
ben 3 2
ben ... ... more >>
TABLESAMPLE question
Posted by WhytheQ at 8/17/2007 3:31:13 PM
I have been using NewID but was advised to use TABLESAMPLE as it would
be more efficient - unfortunately I can get it to work properly.
This comes up with nothing:
'=====================
USE myDatabase
SELECT *
FROM myTable
TABLESAMPLE (1 ROWS)
'====================
....whereas this w... more >>
Unaccountable jump in Identity column value
Posted by teddysnips NO[at]SPAM hotmail.com at 8/17/2007 2:18:23 AM
And here's another thing that's gives me pause for thought (for other
information see the thread entitled "ODBC Timeout problems but very
hard to pin down")
In APP 1 (Access front end, SQL Server 2000 backend) there is an
operation to generate a discrepancy report. These are numbered
sequent... more >>
How to create an admin with some limitations?
Posted by bertainafederico NO[at]SPAM gmail.com at 8/16/2007 11:54:53 PM
I've a SQL 2005 with a certain number of db.
Until today i was the only admin of all dbs.
Now i need to give to another admin permission to manage one specific
db (but only that).
Ho censito un utente di sql con accessi abilitati solo a quel db.
If i connect to Enterprise manager with that limi... more >>
WHERE question
Posted by ceconix at 8/16/2007 9:19:02 PM
Hello all, I am still learning about SQL, and have a question. I have
two tables. I want to update table 2 with data from table 1. Table 1
has two columns. ID and NUM. In Table 2, I have an ID column and a
bunch more columns plus another NUM column. Table 1 was pulled in
from excel. I nee... more >>
Problem performing remote queries
Posted by rhaazy at 8/16/2007 12:14:22 PM
I am trying to a simple insert statement from a remote application
against a sql server 2005 database. To fix the problem I was having,
I had to grant the Login I was using the role of sysadmin. However I
don't want this user to have that kind of control, what would be the
best role to allow t... more >>
Blindare utente SQL amministratore
Posted by bertainafederico NO[at]SPAM gmail.com at 8/16/2007 8:31:57 AM
Ho un server SQL 2005 con N db.
Al momento ho sempre amministrato tutti i db autonomamente e dunque
con un singolo amministratore.
Ora mi =E8 sorta la necessit=E0 di dare a Tizio i permessi per
amministrare un certo db sul mio server, chiaramente facendo in modo
che possa solo vedere (e lavorar... more >>
Knowledgeable yet simple book for database modelling or database design
Posted by vicky at 8/16/2007 8:18:13 AM
Hi All,
Can u please suggest me some books for relational database design or
database modelling(Knowledgeable yet simple) i.e. from which we could
learn database relationships(one to many,many to one
etc.....),building ER diagrams,proper usage of ER diagrams in our
database(Primary key foreign ... more >>
ODBC Timeout problems but very hard to pin down
Posted by teddysnips NO[at]SPAM hotmail.com at 8/16/2007 5:51:29 AM
One of our clients has reported a problem. Everything was working
fine on Monday, but since Tuesday all is going wrong. The sysadmin
assures me that there have been no changes to the network, or the
servers.
Three applications, one back-end database server (SQL Server 2000 with
all service ... more >>
MS SQL copy new and modified rows from TABLE1 to TABLE2
Posted by Yas at 8/16/2007 5:15:46 AM
Hello,
I have 2 tables, Table1 and Table2. I have copied all data from Table1
to Table2.
However Table1 is dynamic it has new rows added and some old rows
modified everyday or every other day...
How can I continue to keep Table2 up to date without always having to
copy everything from Table1... more >>
data transfer from .csv file to sql server 2000
Posted by sachin shah at 8/16/2007 4:35:51 AM
Hi All,
1. i want to transfer the .csv file data into sql server table, i
tried with the DTS but while creating DSN it not prompt to attech
the .csv file. give me the proper steps to perform the data
transfer...
2. i want result of my query into excel or text file by using the sql
query(... more >>
wants sql query
Posted by sachin shah at 8/16/2007 3:46:13 AM
hi
my table having record
cust_name
sachin's
vishal's
sumeet
rajesh
i want the query which having ' (single quote)character....
result
sachin's
vishal's
... more >>
SELECT a random 10 records from table....easy newbie question
Posted by WhytheQ at 8/16/2007 3:39:49 AM
This doesn't work:
--****************************************
USE myDatabase
SELECT TOP 10 *
FROM myTable
WHERE NEWID()
--****************************************
...I know I need to use the function newID() to find random records -
just don't know where it fits in the query (suspect t... more >>
Creating database from stored proc with variable holding the database name
Posted by gancy26 NO[at]SPAM gmail.com at 8/16/2007 2:57:03 AM
Here is my code
ALTER PROCEDURE Test
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @From varchar(10)
DECLARE @To varchar(10)
DECLARE @DBName varchar
SELECT TOP 1 @From = CONVERT(char,CreateDate... more >>
month name from the sql query
Posted by sachin shah at 8/15/2007 11:48:37 PM
Hi all
i want result as month name from my query
i tried with the following query but it give result as month number
like (8)
select (month(getdate())) as expr
i want result as month name (Augest)..
give me the proper query...
from Sachin
... more >>
|