I've got a sproc and some C# calling it. My problem is that both the (N)VARCHAR values only have the first character returned. Everything else is fine. Why would only the 1st character be returned?
So
Content = (string)cmd.Parameters["@SmsContent"].Value,
ToNumber = (string) cmd.Parameters["@ToNumber"].Value,
both only get the 1st ch...
I'm trying some of the ASP.NET MVC tutorials and one of them has the following steps:
Right-click on the "App_Data" folder, and choose "Add New item"
Choose "SQL Server Database" under the "Data" category.
However, once I do that, I get the following message from Visual Studio:
Connections to SQL Server files (*.mdf) require SQL ...
What's the best method to pass parameters to SQLCommand? You can do:
cmd.Parameters.Add("@Name", SqlDbType.VarChar, 20).Value = "Bob";
or
cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = "Bob";
or
cmd.Parameters.Add("@Name").Value = "Bob";
It seems like the first one might be somehow "better" either performance-wise or err...
How can we create a trigger to send an email on any insert or delete action on a table.It should send an email and also it should have the location of the server and the database. Please, let me know.
...
Hi,
I have an MS sql server database. There is a table with one of the column of the "image" type. Now, the customer wants to read the data from an MS access. He wants to display the images in a form.
I have never used access and have no idea of how to do simple things there. Any help will be greatly appreciate.
Thanks,
Ramjee
...
I have a large table with list of scores like this, one score per user:
user,score
------
matt,10
john,20
bill,30
I want to make a query that answers to question:
"John, you are faster than xx percent of others"
How to make such a query for Microsoft SQLServer 2000 with optimal performance.
...
Folks,
I'm trying to wrap my head around how to search for something that appears in the middle of a word / expression - something like searching for "LIKE %book% " - but in SQL Server (2005) fulltext.
How can I do that?? It almost appears as if both CONTAINS and FREETEXT really don't support wildcard at the beginning of a search expre...
Hello
Hopefully this a simple yes/no question..
Are SQL Server timeouts (SELECT queries, in particular) logged in the ERRORLOG file?
Background is a customer with a web site having occasional Request timeout messages, looking to me assuming that the timeout is caused by a database timeout. There are no timeout errors in the ERRORLOG in...
What is the best free way to get your maintenance plan-generated backups compressed?
I know there are non-free tools that will compress the backups, but I'm not interested in them.
Options:
Have a T-SQL task after the backups that will run a script through xp_cmdshell that compresses every non compressed backup.
???
Any other ideas...
Assume that you have a running SQL Server Express instance named (local)\SQLEXPRESS. Its database folder is c:\program files\Microsoft SQL Server\MSSQL.1\MSSQL\Data.
How can VBScript be used to retrieve that folder?
Maybe by using SMO? And if so, how? <- Forget that. SMO uses .NET. Only possible in PowerShell.
Update:
The reason f...
Hi all,
I have 2 tables event + event_artist
event
eventId | eventName
1 , gig1
2, gig2
event_artist
eventId, artistName
1, Led Zip
1, The Beatles
ie Led Zep and the Beatles are both playing @ Gig1
I need to create the SQl to bind to a gridview ( you necessarily need to know about gridviews to answers this )
The results that i ...
I have a SQL SELECT query which has a LIKE clause containing an underscore, which should specifically look for an underscore, not treat it as a wildcard:
SELECT * FROM my_table WHERE name LIKE '_H9%';
I understand that I can change the actual clause to '[_]H9%' for this to work as I expect, but the problem is that this clause is bein...
I'm curious, is there a way to tell the SQL Server that a specific group has access to the database only from a single location/application. I have an SQL Server and a Web Server. Our applications use stored procedures and access for each stored procedure is based on the role that is allowed to access it. Then user groups are assigned...
Hi,
I was wondering if it is possible to get a large, enterprise-scale sample Sql Server database? I am working with Sql Server 2005, and feel that looking at a large scale database would really improve my database design skills. I'm aware of, and have checked Nortwind and AdventureWorks, but these aren't large enough.
Also, when worki...
Aside from executing XP_CmdShell, which I have disabled in my SQL 2005 installation, what could a malicious user who gains DBO rights to my database do:
to my database,
to my server?
I'm assessing the worst-case security risk of someone obtaining DBO to justify running a "least-privileged" user account in an application. Some allege ...
There is a number of commercial products out there, that give you a windows based installers for configuring your app and the back end SQL Server DB. Typically it will ask if you want to connect to the DB with Windows or SQL Server authentication. Most of them make a recommendation to use Windows Auth and then configure your DB with the ...
My simplified and contrived example is the following:-
Lets say that I want to measure and store the temperature (and other values) of all the worlds' towns on a daily basis. I am looking for an optimal way of storing the data so that it is just as easy to get the current temperature in all the towns, as it is to get all the temperature...
I am sure making a silly mistake but I can't figure what:
In SQL Server 2005 I am trying select all customers except those who have made a reservation before 2 AM.
When I run this query:
SELECT idCustomer FROM reservations
WHERE idCustomer NOT IN
(SELECT distinct idCustomer FROM reservations
WHERE DATEPART ( hour, insertDate) ...
What are some recommended resources/books/blogs on SQL Server Integration Services?
Thanks.
...
Example
There is an application that measures temperature in each town of the world. Each measurement is taken every 5 minutes and written in to the Measurement table.
CREATE TABLE [dbo].[Measurement](
[MeasurementID] [int] IDENTITY(1,1) NOT NULL,
[Town] [varchar](50) NOT NULL,
[Date] [datetime] NOT NULL,
[Temp] [int] N...