I have the following code:
IEnumerable<Table> tables = dbtables.ToList()
.Where(x => x.Name.StartsWith("PartStats"));
foreach (var tbl in tables)
{
Table JoinTable = new Table(db, "ProductMaterial");
JoinTable.Columns.Add(tbl.Columns[0]);
string tblName = tbl.Columns[0].Name;
strin...
Hi all,
I'm having an issue with some SQL Server 2008 queries and I think I got it down to differences between the server and the local application. Here's a basic description of my scenario:
I'm using a local application that performs insert statements on a remote database. Everything works fine until I change the clock on the local m...
I'm trying to LEFT OUTER JOIN two tables and then INNER JOIN another table together in Access 2007.
SELECT RestaurantName,
StreetAddress,
City,
State,
Zip,
RestaurantWebsite,
MenuLink,
RestaurantTimes,
PhoneNumber,
PictureTi...
I have a database on Oracle 9i. Now I want to work on SQL Server 2008. I want to migrate the Oracle database to SQL Server, but how do I do that? Give me some syntax? Thanks for the help.
...
Hi everybody.
Recently I saw a presentation in which the reporting part of the software had a nice feature. When we hovered the mouse over the charts in the report, datailed information regarding that part of the chart appeared as a tooltip.
Is there such a feature in SQL Server reporing services 2005? If not, how can I add it?
Also ...
I am trying to pull back the top five instances of certain records loaded into a table. It is important to note that I am trying to get my results out of the same table and I think there is a problem that I can't quite figure out related to the fact that this is one table. Here is the example of my query:
Select * From (
Select Top 5 ...
Hi,
I'm trying to do the following:
using (var tx = sqlConnection.BeginTransaction())
{
var command = sqlConnection.CreateCommand();
command.Transaction = tx;
command.CommandText = "INSERT INTO TryDate([MyDate]) VALUES(@p0)";
var dateParam = command.CreateParameter();
dateParam.ParameterName = "@p0";
dateParam.DbType = DbType.Dat...
Hello, I'm trying to write Windows app to get data from From Fox Pro DB, and inset it to Sql Server 2008 db.
I wrote code, but it works very slow. rowsCount more than 1 million
My code below:
OleDbConnection cn = new OleDbConnection(foxProConnectionString);
SqlConnection cSql = new SqlConnection(sqlServerConnectionString);
cSql.Open();...
I have this SQL Server query
SELECT count(distinct [IP]) as GlobalUniqueIPcount,
--RangeUniqueIPcount
(SELECT count(distinct [IP]) FROM [tblSequence] WHERE SiteID = @siteID AND ([Timestamp] > DATEADD(dd, -@days, (LEFT(GETDATE(),12))))) as RangeUniqueIPcount,
--RangeUrlUniqueIPcount
(SELECT count(distinct [IP]) FROM [tbl...
I want to empty a temporary table, load it via bcp, and then modify its rows before moving to a production table. The commands would look something like this:
truncate table temp1
bcp db.schema1.temp1 in import1.txt -h "TABLOCK"
exec sp_modify_temp1_rows_move_to_production_table
My question is how can I execute all this as one transa...
I have an app where depending on the type of transaction being added or updated, the ticket number may or may not increment. I can't use a SERIAL datatype for ticket number because it would increment regardless of the transaction type, so I defined ticket number as an INT. So in a multi-user environment if user A is adding or updating a ...
How to change interface language in SQL Server Management Studio?
...
In SSMS, how can I get SSMS to show row numbers for a batch? I can get row numbers for a query window, but that does not help when an error occurs in batch statement. This feature would help me a lot to find errors from my code.
...
I am trying to query a SQL Server & Oracle database to get table data that would indicate if a column is auto increment or or not. I would assume you would look at the "information_schema.columns" and "user_tab_cols" tables but it doesn't seem to hold this information. Does anyone know where I can retrieve this information?
...
I have this SQL that works fine.
Want the my filter to return the LATEST unique SessionGuids with the highest UserSessionSequenceID.
Problem is performance sucks - even though I have good indexes.
How can I rewrite this - to omit the ROW_NUMBER line?
SELECT TOP(@resultCount) * FROM
(
SELECT
[UserSessionSequenceID]
...
Hi
Currently I have three tables.
GrandParent( tel int, G_Counter int, GField varchar(10));
Parent( tel int, G_Counter int, P_counter int, PField Varchar(5));
Child(tel int, G_counter int, P_counter int, C_Counter int, CField Varchar(3));
These tables are all flat tables. And these tables loop itself and the loop is determined by the...
Hi Guys,
I am not sure if I should do this in the code or do it in the query, but I will ask it here as I am interested in a sql solution for myself.
Say if I have the following table, and I need to get all the rows whose ParentSID is 1. But if any of these rows return have Null as FID then I also need to go fetch all rows whose Parent...
Much has been written about the difference between SQL Server, Unix, and Microsoft OLE Automation Time epochs. SQL Server treats 1/1/1900 as the epoch, while OLE treated it as 12/30/1899 for various reasons. I've read all the history, and it's fascinating, but doesn't help me solve my problem.
I find myself writing a lot of queries on...
We occasionally want to copy our production database with data and have it populate a corresponding database in our test environment so that we can reproduce production problems.
We currently wait for a maintenance window and do an Detach/Attach.
We're using SQL Server 2008 and both test and production databases are on the same server....
We are starting a new BI project in our company. We have at least three developers working with database design and development. Our tools include Sparks EA, SQL Server 2008 EE and undetermined reporting tools. What kind of tools one can use for database version control in SQL Server? What kind of version control systems there are availa...