Here is some sample code:
DECLARE @sourceFile varchar(255), @testRows int
SELECT @sourceFile = @xmlInfo.value('(/SelectFile/DataSource)[1]', 'VARCHAR(255)')
EXEC sp_addlinkedserver 'SomeData', 'Excel', 'Microsoft.Jet.OLEDB.4.0', @sourceFile, '', 'Excel 8.0', ''
IF @xmlInfo.exist('/ConfigArgs/ParamsXml/ImportDealerData') = 1
...
Here is some sample code that worked fine in a 32-bit machine (SQL server 2005) and needs to be updated for a 64-bit... I know this is a common problem but have not been able to find how to fix it!
DECLARE @sourceFile varchar(255), @testRows int
SELECT @sourceFile = @xmlInfo.value('(/SelectFile/DataSource)[1]', 'VARCHAR(100)')
...
I have a feeling this question might have been asked before, but I am not able to find it. So here it goes:
I am searching through articles for words, phrases typed by users on a website
my articles have different columns for title, keywords, body, summary.
when I am searching I want the result to be more relevant if found in Title tha...
I have an app that is parsing the html page and extracts some text with foreign characters for example 'Felvidék Ma'. Now I want to enter this into my database but not in this format but the original format. So can I convert it into utf 8 before writing to a sql server database or even writing to a textfile. here is the original term ...
Hi,
Can anyone explain me how many constraints at most can be set on any given column of a table in SQL Server.
...
This question is a followup to This Question
The solution, clearing the execution plan cache seemed to work at the time, but i've been running into the same problem over and over again, and clearing the cache no longer seems to help. There must be a deeper problem here.
I've discovered that if I remove the .Distinct() from the query, ...
One thing that I've always hated more than just about anything in MS SQL Server is the way that security works. The security context constantly switches if you look at the server funny and it's often very hard (for me anyway) to predict or debug.
In dealing with an issue today, I though, "I wish I could just add a line to my code that w...
I've been assigned the task to create or research the implementation of Active Directory Group based access to a 2008 SQL Server.
Looking into it, I see implementations of creating a view of Active Directory Users allowed access using a linked server or tables that are renewed every night on the database populated from a script using t...
I have a stored procedure, which performs a database backup for a specific database.
The problem is, it does work on one server and does not work on another server (the servers are on different machines). The backup drive is a local drive of the server.
On the second server I get the exception "BACKUP DATABASE is terminating abnormally."...
Is there a way to search for fields that contain similar values in a sql db?
For example I have a table of over a million records where one column contains url values and is associated with a country column. Previously I tried to match urls that are equal where it contained a null value for the country as was able to update it using the...
In SQL Server 2008, I would like to add a column to a table and update it right after, but only if they column hasn't been created before. I do NOT want to run the update if the column has been created before.
IF NOT EXISTS (SELECT *
FROM [INFORMATION_SCHEMA].[COLUMNS]
WHERE [TABLE_NAME] = 'SETTINGS' AND [COL...
I am using Microsoft SSMS (SQL Server Management Studio) 2008. When I have the Object Explorer open and browse to the Programmability > Stored Procedures folder. If you right click on a stored proc and click Modify it opens the stored proc in a new window.
But then when you go back to Object Explorer it has now refreshed and it shows ...
hello Friends
How can I return Analysis Services properties which is stored in the XML using MDX??
...
i have an app written for 2008.
We are using linq to entities.
We've now had to switch the DB to 2005. I am getting the following error on linq SELECT queries:
Error - SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
The offending line is:
DateOfBirth = ((s.Date_Of_Birth == null) || (s.Date...
I have a table that is made of the following structure
id, source , url , country
now the url column contains urls that can consist of both the root url and children urls. For example we could have
http://post-journal.com USA
http://www.post-journal.com
http://post-journal.com/news
http://post-journal.com/sp...
I want a parameter to load available values from a query (or whatever) and "allow multiple values." When I do so the list begins with "Select All."
That's great, but there appears to be no way to default the parameter to "Select All" which is not acceptable in my case. This particular report will have 8 optional parameters and if htey ...
I have a legacy data-driven application with an extremely complicated data model (and hundreds of SQL stored procedures and functions with no clear delineation of responsibility) in SQL Server 2008.
We have both web app and reporting stored procedures and they are supposed to live side-by-side but there are examples where this rule wasn...
I am populating a table that acts as a cache. (This is needed because the data comes through a linked server and joins through the link are too expensive)
I've included pseudo code below that hopefully demonstrates what I'm trying to do. I really don't know if there's a way to lock a table down like this, or if I need to use transaction...
Hi All,
I have a situation where we want to prevent the update of a table for a specific scenario.
So for 95% of the updates I would want the update to flow through as normal and update the desired fields....for that other 5% I want to prevent the update from happening. This will be based on data passed in the update along with what i...
I know, is a very basic question, but I am in the process of re-learning sql stored procedures, and this is what happended:
I was practicing with some simple delete / insert routines, when encountered with this:
if I ONLY insert records:
1. dog
2. cat
3. t-rex
4. llama
all is ok, then I call a delete procedure, passing the colum...