|
I don't see a connection limitation in SQL server express, but there are indeed tcp connection limitations in windows XP. (Microsoft wants you to buy the server if you're doing server work).
|
|
|
|
|
This[^] fixes that little problem.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
No, not really. This was introduced to limit the number of half-open connections (typically session in the SYN_WAIT state). A number of worms were rampant at that time, and they opened oodles of connections to systems simultaneously. P2P systems typically do likewise, so this patch was developed to allow P2P to run. I doubt that this is the OP's problem.
I was thinking more in the line of this[^], but MS seems to imply that they don't enforce the inbound connection limit, except for SMB operations. So if the SQL server is connecting though named pipes, yes it would be a problem, but normal TCP connections should be okay.
|
|
|
|
|
hi,
I was trying to update the Cyrillic characters · Serbian characters in sql server database, but everytime i shows ??? after updation
Please suggest something.
Thanks
|
|
|
|
|
Do you use VARCHAR or NVARCHAR? Only NVARCHAR will do!
|
|
|
|
|
Thanks for replying...
If I have to search for keyword abcurlф in the table
what should be the query in this case?
Presently it is not displaying any result if i search even only with ф
and displays those records which have ? character
|
|
|
|
|
In the Employees table of Northwind database, I changed the FirstName of an entry to "abcurlф". Now I do in SQL Enterprise Manager:
SELECT *
FROM Employees
WHERE (FirstName LIKE N'%ф%')
and that returns exactly the row where I made that change.
Note that an "N" is required before the search term - LIKE '%ф%' does not work.
|
|
|
|
|
I have a database with a master - detail relationshio between two tables. The database is basically a snapshot in time for each office. so imagine that my master table is:
id (auto increment), date, office_id
1 , 2010-4-1, 100
2 , 2010-4-2, 100
3 , 2010-4-3, 100
4 , 2010-4-4, 100
5 , 2010-4-1, 101
6 , 2010-4-2, 101
7 , 2010-4-3, 101
8 , 2010-4-4, 101
I want to get the id number for the last update date from the master table so I did the following:
SELECT id, max(upload_date) as upload_date, office_id from master group by office_id
What I want is the id number associated with the latest date, so I WANT
id, date, office
4, 2010-4-4,100
8, 2010-4-4,101
What I get is:
1, 2010-4-4,100
5, 2010-4-4,101
I get the max date, but the first id number. Normally I'd do a cursor in a procecure to get it, but the ISP has to grant the pivs each time the sp is modified so I am trying to do this in a simple query since it is called from php.
As a work around, I am doing a max(id) as well since I figured that the highest id would always be associated with the latest date, but I don't want to make that assumption.
Does anyone know how to build the query correctly to get the id associated with the latest date?
|
|
|
|
|
I'm not sure, I think you need to add some sorting, try "ORDER BY date DESC" on top of your grouping.
|
|
|
|
|
I'm little bit confused; are we trying to get the current inserted / updated data using the dateTime criteria?
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
No, I was suggesting to get things sorted within each group, but MySQL isn't accepting a "ORDER BY ... GROUP BY ..." qualification.
|
|
|
|
|
Yep, I got your point.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
You can try SQL SCOPE_IDENTITY function to get the last identity value inserted into an identity column in the same scope. Or you can also try in a trigger which something like:
DECLARE @id int = 0
SET @id = (SELECT id FROM INSERTED )
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I wasn't sure what MySQL supports so I kept out of it!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Try the following
select a.id
,a.upload_date
,a.office_id
from ( select max(m.upload_date) max_upload_date
,m.office_id office_id
from master m
group by m.office_id
) tmp
,master a
where a.upload_date = tmp.max_upload_date
and a.office_id = tmp.office_id
;
You need to be joining the table on itself, though it is more a view on itself.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Hi,
Is there any way to find all stored procedures which are being called inside the main procedure? This can go deeper at last level inside the main one. I have tried the available option for "right click" > "View Dependancies" but it does not show the procedures called by EXEC statement. Please correct me if I am wrong here.
My problem is - I have a procedure which calls multiple other procedures inside it. Also these called procedures again might have called other procedures inside them. Now I need to find a list of all such dependent procedures for my main procedure.
Thanks in advance for your inputs!
Anil
|
|
|
|
|
There is an answer to this on SQLServerCentral.com here[^]. You might have to sign up to view it, can't remember, but it is a reputable and useful site.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi
Try the following:
Link 1 : sql-server-get-the-list-of-object-dependencies-sp_depends-and-information_schema-routines-and-sys-dm_sql_referencing_entities/[^]
Or
DECLARE @StringToSearch NVARCHAR(MAX)
SET @StringToSearch = 'ENTER_SP_TO_SEARCH'
SELECT
[name],
(
SELECT
OBJECT_DEFINITION(obj2.object_id) AS [text()]
from sys.all_objects obj2
where obj2.object_id = obj1.object_id
FOR XML PATH(''), TYPE
) AS Obj_text,
[type] as ObjType
FROM sys.all_objects obj1
WHERE OBJECT_DEFINITION(object_id([name])) LIKE '%' + @StringToSearch + '%'
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Hello. I am getting the following error when trying to connect:
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)"
1) I tried seeing what services are running and nothing with SQL Server is listed.
2) I ran the Surface Area Configuration and the following message immediately pops up:
"No SQL Server 2005 components were found on the specified computer. Either no components are installed, or you are not an administrator on this computer. (SQLSAC)"
What in blazes is going on?
Thanks.
|
|
|
|
|
This tends to be a misleading, catch all error message. Assuming you actually have SQL installed and can see the database in SSMS then I would delete the credentials you are using and re create them. This may be cause by a restore from another server corrupting the user details.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I’m trying to display a list of shops each with 3 random items from their shop, if they have 3 or more listings, that are actively advertising. I have 3 tables: one for the shops – “Shops”, one for the listings – “Listings” and one that tracks active advertisers – “AdShops”.
Using the below statement, the listings returned are random however I’m not getting exactly 3 listings (rows) returned per shop.
SELECT AdShops.ID, Shops.url, Shops.image_url,
Shops.user_name AS shop_name, Shops.title, L.listing_id AS listing_id,
L.title AS listing_title, L.price as price,
L.image_url AS listing_image_url, L.url AS listing_url
FROM AdShops INNER JOIN
Shops ON AdShops.user_id = Shops.user_id INNER JOIN
Listings AS L ON Shops.user_id = L.user_id
WHERE (Shops.is_vacation = 0 AND Shops.listing_count > 2 AND
L.listing_id IN
(SELECT TOP 3 L2.listing_id
FROM Etsy_Listings AS L2
WHERE (L2.user_id = L.user_id)
ORDER BY NEWID()
)
)
ORDER BY Shops.shop_name
When 'ORDER BY NEWID()' is removed, I get exactly 3 rows returned per shop but it's the first 3 listings and not random - I’m stumped. Anyone have any ideas on how to fix it?
The ideal solution would be one record per store with the 3 listings (and associated data) were in columns and not rows – is this possible?
|
|
|
|
|
Thanks to Lieven stackoverflow.com[stackoverflow.com] for the key to solving the problem. Full solution is as follows:
SELECT AdShops.ID, Shops.url, Shops.image_url,
Shops.user_name AS shop_name, Shops.title, L.listing_id AS listing_id,
L.title AS listing_title, L.price as price,
L.image_url AS listing_image_url, L.url AS listing_url
FROM AdShops INNER JOIN
Shops ON AdShops.user_id = Shops.user_id INNER JOIN
Listings AS L ON Shops.user_id = L.user_id
WHERE (Shops.is_vacation = 0 AND Shops.listing_count > 2 AND
L.listing_id IN
(SELECT listing_id
FROM
(SELECT l2.user_id , l2.listing_id, RowNumber = ROW_NUMBER()
OVER (PARTITION BY l2.user_id ORDER BY NEWID())
FROM Listings l2 INNER JOIN
(SELECT user_id
FROM Listings
GROUP BY user_id
HAVING COUNT(*) >= 3
) cnt ON cnt.user_id = l2.user_id
) l2
WHERE l2.RowNumber <= 3 and L2.user_id = L.user_id
)
)
ORDER BY Shops.shop_name
Anyone have any ideas on how to merge the 3 rows into a single row with the 3 listings moved into columns (several colums per listing) ????
|
|
|
|
|
Here we go again, this article may be of use Pivot two or more columns in SQL Server 2005[^]
This query basically represents the "inner" query in the article, now you need to extract the column labels to be pivotted on and write the outer query. I would stuff this query into a table var or view and work from there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I've spent the last three hours trying to create a new connection to an Access file in Server Explorer, following the guidance in VS2008 Help. Nothing works. But out of sheer frustration I clicked on Test Connection with the Connection String box blank. It passed. Apparently Test Connection does absolutely nothing, so I can stop wasting my time clicking on it. Clicking on OK tells me that the "Format of the initialization string does not conform to specification starting at index 0" which makes perfect sense to me. Apparently it's just as clear to Microsoft, as when I search on the error message it returns 0 responses. I guess they never tried connecting to an Access DB with VS2008...
Crap! I'm so tired of Microsoft making simple tasks impossible! I've got a simple mdb file from work with meter readings from a now defunct reading system. All I wanted to do was load and display two or three columns from one table in the file, and print them so the accountant can enter the readings into the billing system. I thought this would take about two hours - based on past experience doing very similar things. This was easier using DOS and Paradox!
For the record, I searched on Creating a New Connection in Server Explorer, located the connection string for Access in the resulting example, copied and pasted it into the wizard, and changed the file path to match my database file. There were several results, and I tried them all. Nothing worked, except the error message Microsoft doesn't recognize.
How do you folks do this for a living? Hard drugs? Alcohol in vast quantities?
I did some more searching, with no positive results. But I did manage to find a link to provide Microsoft with some feedback, to wit:
<EDIT>
I found the following step to be confusing:
1. In the Database file name box, enter the path to the .mdb file, or click the Browse button to locate the database file.
There is no such box in VS2008, just a Connection String request that offers no clues. Using the connection string examples provided by MSDN, with appropriate modifications to point to the path of my Access database, did not help. By the way, if I Test Connection using a blank connection string, it passes, but clicking OK results in the entirely worthless message,
“Format of the initialization string does not conform to specification starting at index 0.”
Utterly useless, as always. Thanks for being consistent, if not useful. Over the past 20+ years I’ve been setting lower expectations for Microsoft assistance, and you’ve consistently managed to somehow fall short of the goal every year. That’s a heck of an achievement! Few companies are capable of falling so short of customer expectations and staying in business. Keep up the good work – I’m planning to sell MSFT short in a few years to fund my retirement.
Just as a side note, I used Bing to find this solution; Google was much faster, and provided many more examples, but none of them worked, either.
</EDIT>
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
<div class="modified">modified on Wednesday, April 28, 2010 1:20 AM</div>
|
|
|
|
|
Roger Wright wrote: How do you folks do this for a living? Hard drugs? Alcohol in vast quantities?
Yes... and a good deal of self loathing!!
|
|
|
|
|