In SQL Server 2005, I'm trying to figure out why I'm not able to insert multiple fields into a table. The following query, which inserts one record, works fine:
INSERT INTO [MyDB].[dbo].[MyTable]
([FieldID]
,[Description])
VALUES
(1000,N'test')
However, the following query, which specifies more t...
I need to find a hosting company that provides a LAMP stack, the P being PHP.
Finding that is pretty easy, but I have a further requirement of unixODBC and FreeTDS or some equilant.
The project will require a remote connection to a Microsoft SQL 2005 database.
Most of the project will use a local MySQL database but it also requires d...
After getting such a great feedback from my last question. Maybe someone can help me with this problem also.
I have to rotate a given table from an SQL Server but a normal pivot just doesn't work (as far as i tried). So has anybody an idea how to rotate the table into the desired format?
Just to make the problem more complicated, the l...
Hi, I have an SQL CREATE PROCEDURE statement that runs perfectly in my local SQL Server, but cannot be recreated in production environment. The error message I get in production is Msg 102, Level 15, State 1, Incorrect syntax near '='.
It is a pretty big query and I don't want to annoy StackOverflow users, but I simply can't find a solu...
I am attempting to drop and recreate a database from my CI setup. But I'm finding it difficult to automate the dropping and creation of the database, which is to be expected given the complexities of the db being in use. Sometimes the process hangs, errors out with "db is currently in use" or just takes too long. I don't care if the db i...
I have the following requirements
I have relational content stored in a SQL Server 2005 database.
I want to retrieve this data, transform it and display it in an Excel 2007 document.
I would like this to be pulled from within Excel at the click of a button.
As far as I can tell I have the following options...
Create a view in...
With our product we have a simple backup tool for the sql server database. This tool should just make a full backup and restore to and from any folder.
Of course, the user (usually an administrator) needs permission to write to the target folder.
To avoid the problem of not being able to perform a backup to a network drive, I write the...
I have a stored procedure that runs custom backups for around 60 SQL servers (mixes 2000 through 2008R2).
Occasionally, due to issues outside of my control (backup device inaccessible, network error, etc.) an individual backup on one or two databases will fail. This causes this entire step to fail, which means any subsequent backup comm...
i.e. if I create a VARCHAR(50) field, what happens if I try to assign it a value that's 100 characters long?
Will SQL Server let me do this? Is it somehow less efficient?
...
I'm making an update to our datbase and would like to update rows that do not have existing items in another table. I can join the tables together, but am having trouble grouping the table to get a count of the number of rows
UPDATE dpt
SET dpt.active = 0
FROM DEPARTMENT dpt
LEFT JOIN DOCUMENTS doc on dpt.ID = doc.DepartmentID
GROUP ...
I have the following SQL to format a US address into each line for a mailing address but it is rather ugly. Is there a better way to solve this problem or does it have to be this ugly? Also, the problem with this code is that it always ends up with an extra new line at the end.
declare @NL varchar(2);
set @NL = char(13) + char(10);
sel...
When I run the this select '$(''test'')' in SQL Management Studio 2008 it returns $('test')
When I run sqlcmd -S SERVER -E -d DATABASE -q "select $(''test'')" on the command line it returns Sqlcmd: Error: Syntax error at line 1 near command '''.
If I remove the dollar sign it works. Is the "$" a special character?
Is this a sqlcmd ...
I am searching in resumes weather the word is exist or not
i am using the below query
Case1:
select top(10) c_resume_text from sntbl_candidates
where contains(c_resume_text,'"a/dm"')
in the above example only it is not working properly .It showing resumes even though there is no text like that.
In Messages i am getting the followi...
How can I Grant some users permission to drop and create a single table only in the SQL 2005 database accessed by our VB.net 2005 Win app?
Some articles suggest Granting Control rights to the table but I cannot make this work. If you think this is teh way to go, can you show me the correct syntax?
...
The following question seems to be haunting me more consistently than most other questions recently. What kinds of things would you suggest I suggest that they look for when trying to debug "performance issues" like this?
ok, get this - running this in query analyzer takes < 1 second
exec usp_MyAccount_Allowance_Activity '1/1/1900'...
Hello,
Can multiple SSRS share the same DB? We're getting into an SSRS customization scenario, which may adversely affect our existing SSRS features, and I wanted to see if it was possible.
Thanks.
...
The query is a single select containing a lot of grouping levels and aggragate operations.
With SET ARITHABORT ON is takes less than a second, otherwise it takes several minutes. We have seen this behavior on SQL Server 2000 and 2008.
...
I have this MDX query:
Exists([Group].[Group Hierarchy].allmembers,
{[Group].[Group Full Name].&[121 - Group A], [Group].[Group Full Name].&[700000 - Group C]})
... which works fine EXCEPT that it returns all of the ancestors of the specified groups as well. What I want is to return JUST the groups from the hierarchy with the spe...
I am getting a conversion error every time I try to submit a date value to sql server. The column in sql server is a datetime and in vb I'm using Date.today to pass to my parameterized query. I keep getting a sql exception
Conversion failed when converting datetime from character string.
Here's the code
Public Sub ResetOrder(ByVal con...
My problem is a bit hairy, and I may be asking the wrong questions, so please bear with me...
I have a legacy MySQL database which stores the user passwords & salts for a membership system. Both of these values have been hashed using the Ruby framework - roughly like this:
hashedsalt =
Digest::SHA1.hexdigest("--#{Time.now.to_s}--...