Hi,
Say I have the following table:
ID|Read
-------
1|true
2|false
3|false
4|false
... and I need to read the smallest ID, that has [Read] == false; plus, update that I have now read it.
So if i execute my Stored Procedure dbo.getMinID, it will return ID: 2, and update [Read] -> true.
CREATE PROCEDURE [dbo].[getMinID]
(
@Quer...
Hello.
Is there an easy way to get if string is an integer number (consists only of digits) in MS SQL 2005?
Thank you for your help.
...
i have sql server 2005 installed in my local machine. when i installed it, i was able to connect to the local server which is named "MNTCON016".
After restarting the machine, I found out that i was not able to connect to the local server "MNTCON016". it gave me the following error.
A network related or instance specified error occured wh...
Is there a valid way in SQL Server 2005 to read a row of data into a string?
For example if my table looked like the following:
ID | First Name | Last Name | Color
-----------------------------------
1 | Timmy | Jones | pink
2 | Martha | Fisher | green
That I could get back as a result:
'1 Timmy Jones pink'
'2 Mart...
I need to pivot the following table named tblGameRoleName -
Game Role Name
VolleyBall Coach Sujatha
VolleyBall Player Rajendran
VolleyBall Player Juno
VolleyBall Player Indira
VolleyBall Player Ganesh
VolleyBall Player Vasanth
Tennis Coach Rajeshkumar
Tennis Player Vivek
Tennis Player Rubala
...
So I know this problem isn't a new one, but I'm trying to wrap my head around it and understand the best way to deal with scenarios like this.
Say I have a hypothetical table 'X' that looks like this:
GroupID ID (identity) SomeDateTime
--------------------------------------------
1 1000 1/1/01
1 1001 2/2/02
...
I need to query rows of XML data where a specific element contains more than 1 upper case character. Sounds like a job for RegEx --- but I can't find a reference to such a function in the XPath for SQL Server 2005.
I can't create a SQLCLR function on this server, so using .NET is not an option.
...
I am using OLE DB data source component as a part of data flow task, but I would like to keep the sql query in an external file and not embedded in the task itself. Is there an easy way to accomplish this?
...
When I run this query
SELECT CustomerId FROM Stocks.dbo.Suppliers
It gives me this error. Invalid column name 'CustomerId'. This error is valid as there is no column CustomerId in Suppliers table; but when I use same query in subquery it does not give any error E.g.
SELECT *
FROM SomeOtherDb.dbo.Customer
WHERE CustomerId In( SEL...
I have this query to display records based on date
Select *
From orders
Where CONVERT(VARCHAR(50), Orderdate, 101) = CONVERT(VARCHAR(50),'1/21/2010', 101)
Though there are orders for today, the query is failing because the date passed is not 01/21/2010
How can I fix this issue in the query itself as the date passed by the other ...
Below is a simplified version of a query that I have already created. The query works fine, but I cannot figure out how to get the XML declaration at the top of the generated XML. I've tried multiple things and searched far and wide on the Google, but alas I cannot seem to find out how to do this ... or even if it is possible.
select ...
I am getting an error when trying to create a relationship within two tables in Sql Server 2005. I am attempting to create the relationships using the database diagram feature. I have a Player table and a Message table. I want to create two relationships from the Message table to the Player table. I can successfully create the first rela...
select 2/3 how to result 0.67 via sql sever 2005
...
I have this script(dtsx file) on a sql 2005 server (made by some other technician), some stored procedures update tables with data from views. I can see that these views are based on other views, sometimes 4 to 5 layers thick before hitting the database tables. Would you recommend to improve this construction?
(when confronted with this...
We're using SQL Server 2005 with Reporting Services.
We have a number of reports, each containing a relatively simple SQL query - by "relatively" I mean that we do have a few joins, but nothing worse than that. We do not call any stored procedures in our queries - this is not a case of parameter sniffing.
When executing one of these re...
I'm fine tuning a web app that calls SOAP services backed by SQL stored procedure calls. Typically the stored procs generate XML that becomes part of the SOAP response, and that XML has many superfluous xmlns namespace declarations. In pathological cases this can be 30% or more of the char encoded XML measured in bytes, e.g.:
<GetFooRes...
I'm building a hash, using the house number from an address field. What SQL can I use to select only the numeric characters from the front of a varchar field?
EX:
12345 South 1st Street
I want the 12345. Thanks in advance.
...
hello !
I have a problem,I run application C# and I get a error
"A network-related or
instance-specific error occurred while
establishing a connection to SQL
Server. The server was not found or
was not accessible. Verify that the
instance name is correct and that SQL
Server is configured to allow remote
connections. (p...
I have several stored procedures that all use the same set of parameters. Is there a way to define and save the parameter list as a reusable block of code? Something like this:
CREATE PROCEDURE test
Using StoredParameterList
AS
BEGIN
SQL Statement
END
Is this possible? It would make code maintenance easier if a parameter n...
I'm unable to connect to SQL Server 2005 from .NET. I'm getting the error " A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider...