Is it possible to programmatically find the database context from a tsql script? ie the context that changes when you add a USE . I ask because I am not using a USE, and would like to find the database name the script is running on.
...
I am trying to update one of my SQL tables with new columns in my source CSV file. The CSV records in this file are already in this SQL table, but this SQL table is lacking some of the new columns from this CSV file.
I already added the new columns to my SQL table structure via ALTER TABLE. But now I just need to import the data from t...
I have several jobs and several packages. In SQL Server 2005 we used to use DTS Packages, but they are now defunct (I know that I can re-enable them, but that's not what I'm after). I receive the following error by running one of my packages:
Message: SSIS Warning Code
DTS_W_MAXIMUMERRORCOUNTREACHED. The
Execution method succeed...
A have a string %c3%ad which decoded with UTF-8 is í, but decoded with ASCII is Ã.
I need to decode it using the UTF-8 encoding, how can I do that?
Here is a select of the value and what it should be...
SELECT
('%c3%81') as 'Á (81 = 129)',
('%c3%89') as 'É (89 = 137)',
('%c3%8d') as 'Í (8d = 141)',
('%c3%93') as 'Ó (93 = 147)',
('%c3%...
I don't have access to a SQL Server Express installation at the moment, but I know that the installer usually installs SQL Server Express with an instance name. What is the default instance name for SQL Server Express installations? I.e., how do you access such an installation by default? Is it localhost\SQLEXPRESS$ ? Is the same name us...
Getting this error:
System.Data.SqlClient.SqlException : The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
My Entity objects all line up to the DB objects.
I found only a single reference to this error via Google:
http://ramonaeid.spaces.live.com/blog/cns!A77704F1DB999BB0!182.entry
Af...
First, my development environment: Win7 laptop with Visual Studio Professional 2010. IIS is NOT installed.
I'm trying to turn on and set up some roles for user management via the ASP.NET Configuration Tool, as demonstrated in the MVCMusicStore tutorial. When I click on the 'Security' tab, I get the following error:
"There is a proble...
At work, we've working on SQL Server 2008 now, and my boss seems a little bit paranoid about security, so instead of having people be sysadmin (or whatever they need to be to own/modify jobs) he's been editing stored procs in MSDB (such as sp_update_job) and adding a role to the TSQL that checks for required permissions (such as adding S...
Hi
Based on the below tables
Table_A
Id RelatedId
---------------
1 1
1 2
1 3
2 4
2 5
2 2
3 7
3 8
4 9
Table_B
RelatedId Name
--------------
2 A
3 B
I want to get all the rows from Table_A which have atleast one matching relatedid in Table_B. The Ids from Table_A that do not have match in Table...
I have a SQL Server 2008 database that uses a default schema called "Arxame". How do I specify or change the default schema from "dbo" to "Arxame" in my connection string? I'm using C# and ADO.NET.
...
I have a Country table which has CountryName column. I need a ready made list in DDL to populate in the column CountryName.
The table resides in SQL Server 2008.
...
I am creating a comparison matrix and would like it to be dynamic. Take a look at this url:
http://cmsmatrix.org/matrix/cms-matrix/1work
This type of database design has really challanged me and every approach that i take to this may result in serious performance or maintenance issues. if you do not recommend a relational database for ...
What are Dynamic Management Functions (DMF) and Views (DMV) in SQL Server 2005/2008 ?
...
Do you need a specific version of Sql Server 2008 to have TVP (Table Value Parameters) or Table Types?
I don't have the folder under types and I get an error when trying to create one:
CREATE Type EntityTable AS TABLE
(EntityId int
,EntityName varchar(max)
,EntityFriendlyName varchar(max)
,IconPath varchar(max)
,EntityDescription ...
My application lists the available network SQL Servers using
Return SmoApplication.EnumAvailableSqlServers(false)
Until recently, I was running XP Pro, with SQL 2005, SQL 2008, and Visual Studio 2008.
All worked perfectly, correctly listing the default SQL05 server, and the SQL08 named instance.
I've now upgraded to Windows 7 x64, ...
We are using SQL Server 2008.
Our requirement is this -
We have about 4 tables related to transactions, which record orders placed by consumers, and their status of delivery.Once,the order is completed it has affect on inventory and finance.
Now,these tables will become huge.So,we want to archive every 6-8 months.But,after archiving t...
I want to do the SELECT / INSERT version of an UPSERT. Below is a template of the existing code:
// CREATE TABLE Table (RowID INT NOT NULL IDENTITY(1,1), RowValue VARCHAR(50))
IF NOT EXISTS (SELECT * FROM Table WHERE RowValue = @VALUE)
BEGIN
INSERT Table VALUES (@Value)
SELECT @id = SCOPEIDENTITY()
END
ELSE
SELECT @id = RowID ...
I am using NHibernate on a project. The database is required to have creation date and creator user fields on relation tables but I do not want to map the relations to domains. My db design is like:
school (id, name, credate, creuser)
student (id, name, credate, creuser)
school_student(id, school_id, student_id, credate, creuser)
For ...
Hi,
In T-SQL (Microsoft SQL 2008), how can I make a new database which will have the same schemas, tables, table columns, indexes, constraints, and foreign keys, but will not contain any data from the original database?
Note: making a full copy, then removing all data is not a solution in my case, since the database is quite big, and s...
SSRS report calls sproc from SQL 2008 and it takes 30 sec to render it.
If I call the same sproc with the same params it takes 3 sec to finish.
SQL server and SSRS are on the same box.
What can I do about it?
...