Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts

Tuesday, March 27, 2012

downloading database to local mdf file, sql dumb on SMSE

Hi,

I'm trying to work on a database when I'm not connected. I can't figure out how to get a local copy of a database.mdf that I created on the server, onto my hard drive, using SQL Management Studio Express. Does anyone have any suggestions? I'd be forever in your debt. Thanks

Hi,

You can backup/restore database or your detach/attach database.

Use sp_detach_db procedure and sp_attach_db procedure to achieve this.

For more information, check

http://msdn2.microsoft.com/en-us/library/ms188031.aspx
http://msdn2.microsoft.com/en-us/library/aa259611(SQL.80).aspx

HTH. If this does not answer your question, please feel free to mark the post as Not Answered and reply. Thank you!

Thursday, March 22, 2012

Download link still available for SQL Server 2000 Reporting Services from my SQL 2000?

Hi,
I can't seem to find the download link for SQL Server 2000 Reporting
Services from my SQL 2000. Where is it? I feel like an idiot.
Spin
I don't recall anything other than the Evaluation Edition ever being
downloadable from http://www.microsoft.com but you can find all the SQL
Server 2000 Reporting Services downloads at
http://www.microsoft.com/sql/technol...ownloads.mspx,
including the Evaluation Edition.
Sincerely,
Steve Dybing
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to the newsgroups only, thanks.
"Spin" <Spin@.spin.com> wrote in message
news:478crcFeau66U1@.individual.net...
> Hi,
> I can't seem to find the download link for SQL Server 2000 Reporting
> Services from my SQL 2000. Where is it? I feel like an idiot.
> --
> Spin
>

Sunday, March 11, 2012

double count

Hello
got a small group by problem, i cant figure out how to divide the count with
"total" count for "each" day :)
CREATE TABLE #Test (
A char(1) NOT NULL,
B char(1) NOT NULL,
Somedate datetime NOT NULL
)
INSERT INTO #Test(A,B)VALUES('A','A','2001-01-01')
INSERT INTO #Test(A,B)VALUES('A','A','2001-01-01')
INSERT INTO #Test(A,B)VALUES('A','B','2001-01-01')
INSERT INTO #Test(A,B)VALUES('A','C','2001-01-01')
INSERT INTO #Test(A,B)VALUES('A','C','2001-01-01')
INSERT INTO #Test(A,B)VALUES('B','A','2001-01-01')
INSERT INTO #Test(A,B)VALUES('B','A','2001-01-01')
INSERT INTO #Test(A,B)VALUES('B','B','2001-01-01')
INSERT INTO #Test(A,B)VALUES('B','A','2001-01-02')
INSERT INTO #Test(A,B)VALUES('B','A','2001-01-02')
INSERT INTO #Test(A,B)VALUES('B','B','2001-01-02')
SELECT * FROM #Test
/* A COUNT COUNT/TOTAL Somedate
A 2 0.40 2001-01-01
A 1 0.20 2001-01-01
A 2 0.40 2001-01-01
B 1 0.50 2001-01-01
B 1 0.50 2001-01-01
B 1 0.50 2001-01-02
B 1 0.50 2001-01-02
*/
DROP TABLE #TestSELECT
T.A,
T.B,
T.SomeDate,
COUNT(*),
(COUNT(*) * 1.0) / T1.theCount
FROM #Test T
JOIN
(
SELECT
A,
COUNT(*) AS TheCount
FROM #Test
GROUP BY A
) T1 ON T1.A = T.A
GROUP BY
T.A,
T.B,
T.SomeDate,
T1.theCount
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"Lasse Edsvik" <lasse@.nospam.com> wrote in message
news:OZIvJGnzFHA.908@.tk2msftngp13.phx.gbl...
> Hello
> got a small group by problem, i cant figure out how to divide the count
> with
> "total" count for "each" day :)
>
> CREATE TABLE #Test (
> A char(1) NOT NULL,
> B char(1) NOT NULL,
> Somedate datetime NOT NULL
> )
>
> INSERT INTO #Test(A,B)VALUES('A','A','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('A','A','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('A','B','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('A','C','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('A','C','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('B','A','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('B','A','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('B','B','2001-01-01')
> INSERT INTO #Test(A,B)VALUES('B','A','2001-01-02')
> INSERT INTO #Test(A,B)VALUES('B','A','2001-01-02')
> INSERT INTO #Test(A,B)VALUES('B','B','2001-01-02')
> SELECT * FROM #Test
> /* A COUNT COUNT/TOTAL Somedate
> A 2 0.40 2001-01-01
> A 1 0.20 2001-01-01
> A 2 0.40 2001-01-01
> B 1 0.50 2001-01-01
> B 1 0.50 2001-01-01
> B 1 0.50 2001-01-02
> B 1 0.50 2001-01-02
> */
> DROP TABLE #Test
>|||Fix your table to have a key so that there are no duplicates. That will save
you from dealing with complex formulations for simple queries in the first
place.
Anith

Wednesday, March 7, 2012

Dont know how to stop the duplication

Hi, Im still quite new to Crystal, and cant quite get my head around this one.. I'm using CR9

Ive attached a sample report to help demonstrate the problem.

I have three tables using the following fields:

Customers Tbl: DOB, Address 1, Address 2, Address 3, City + Postcode.

Folder Items Tbl: Voucher No, Tvl Date, Code, Client Name, Client Paid, Redeem Date.

Credit Card Tbl: Card Type, Card No.

Im trying to establish how many vouchers this client has ordered. On the example shown hes actually ordered 3 vouchers, but because he has two different credit cards listed in his profile, each item is duplicated, so it looks like hes made 6 orders.

If the card type equals DC, then we need to show what the card number is. If its any other card type, then we just show the two letter card code, and no other info. Which works fine when theres only one card in the profile.

I need to somehow say if there are two cards present only show the first one, and always select card type DC if there are two or more different types

Does anyone have any ideas? At the moment, I'm exporting the data into excell so I can delete the duplicates before submitting them, but the reports is getting bigger each week, and it's going to get out of hand very soon.

Thanks
LisaIn your Crystal query, use Distinct Keyword

Select Distinct columns from yourTable

Sunday, February 26, 2012

Domain user can't hit SQL Server

Hello,
I have a user on Windows 2000 running an application written in VB.net
that uses a config file with a connection string to hit a SQL 2000 DB
running on a Windows 2000 Server box. The connection string looks
something like this:
Provider=SQLOLEDB;Server=MyServer;Databa
se=MYDB;Persist Security
Info=False;User Id=shipio;
When the user tries to perform a task that requires a DB connection, a
message pops up saying that Domain\UserAccount does not have permissions
to access the SQL server. However, there is a sql server username and
password in the connection string. Why doesn't it user it?
The application works fine when it's installed on Win XP PCs, but it
doesn't work on a win 2000 PC. Does Win2000 have a different need for
connection strings? Or does it by default send the domain account to
the sql server?
Any thoughts are greatly appreciated.
Thanks
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!Connection strings that pass a username are for Standard SQL
Authentication. Not Windows Authentication.
Check the Authentication Mode of SQL. It appears to be set to Windows Auth
only. I you intend on using Standard SQL Security, then your
Server settings for SQL need to be changed to allow both.
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||This is actually only a problem on the Windows 2000 pc. The sql server
is set up for windows and sql server authentication. We have 20 other
users on Windows XP where this works fine. It's just the 2000 box that
gets the error.
Does the connection string maybe need some additional properties for it
to work on 2000?
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!|||Try connecting from the Windows 2000 client using Query Analyser or OSQL
with a Trusted Connection.
OSQL -SserverNameHere -E -Q"Select @.@.version"
Do you receive the same error?
Try using Standard Security.
OSQL -SserverNameHere -Uuserid -Ppassword -Q"Select @.@.version"
Thanks,
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.