sql-server

Building Query from Multi-Selection Criteria

Hi All, I am wondering how others would handle a scenario like such: Say I have multiple choices for a user to choose from. Like, Color, Size, Make, Model, etc. What is the best solution or practice for handling the build of your query for this scneario? so if they select 6 of the 8 possible colors, 4 of the possible 7 makes, and ...

View MDX query generated while browsing a cube

In Sql Server Management Studio once I browse a cube I can drop column fields, row fields and filter fields. This displays the required data. I want to know if there is a way to view the MDX query being generated behind the scenes to display the data? Thanks. ...

Audit the target of a SQL Server login

I've recently inherited a SQL server (2008, not R2) where some users connect to the server using the computer name and some users connect using a DNS alias. There is only the default instance on this server. Is there any way I can log or audit the connection string or target of the connection to see whether a user is connecting using the...

SQL: how to check for a specific DateTime

i need to check for a specific DateTime value in my table from my code (VB.NET) and i don't know how to format the DateTime as a string. i've read that SQL Server will recognize my string if it's in either date, time, or date and time format. i mean: 'May 15, 2004' '5/15/2004' '20040515' '2004 4 am' will SQL Server recognize these str...

Classic ASP with COM throwing "Data source name not found and no default driver specified" on Windows Server 2008 R2

We have a classic ASP application that connects to a COM component. The COM component reads a connection string from the registry and connects to a datasource. We exported the COM package out of a 2003 box and imported into a 2008 R2 box. We've reviewed every setting to ensure its correct. When we hit the classic ASP site, we get the fol...

how can i copy a SQL server from one machine to another

i am accessing a SQL server db over a slow network. I have another machine with SQL server on it on a machine with a faster connection. Is there anyway i can easily get this database copied from one machine to another (both schema and data) ...

Text Qualifier in flat file connection

Hi All, I have business scenario as source files (text files) comes to load into SQL database so I used the flat file connection manager as normal process. My requirement as, we are getting source files with qualifier (") so we used the text qualifier property in the connection manager. For the same set of files we are getting withou...

Is there an alternative to joins to increase performance?

Is there an alternative to joins to increase performance? Edit (gbn): related to join-or-correlated-subquery-with-exists-clause-which-one-is-better Why didn't anyone mention about nested loop joins? ...

Update Table with auto incrementing dates in date column

hi, I want to update a Table with auto incrementing dates in date column in Sql server 2005. ...

Is there an elegant way to Invert a Bit value in an SQL insert Statement?

I'm converting some data in SQL Server: INSERT INTO MYTABLE (AllowEdit) (Select PreventEdit from SOURCETABLE) so I need to inverse the bit value from source table. I expected NOT to work, as this is how I would do it in code, but it doesn't. The most elegant way I can think of is: INSERT INTO MYTABLE (AllowEdit) (Select ABS(PreventEd...

I don't understand Collation? (Mysql, RDBMS, Character sets)

I Understand Character sets but I don't understand Collation. I know you get a default collation with every Character set in Mysql or any RDBMS but I still don't get it! Can someone please explain in layman terms? Thank you in advance ;-) ...

What is the best solution to retrieve large recordsets - more than 3000 rows

I have a SQL Server table with 3000 rows in it. When I retrieve those rows it is taking time using a Select Statement. What is the best solution to retrieve them? ...

SQL to LINQ simple query?

Hi below is a sql server table, which is used to hold users prediction for soccer matches. a user can predict either a home win, an away win or a draw/tie for a specific soccer match. how can i query this table to find the top 3 predictions, the top 3 games must be distinct gameId's either SQL or LINQ solution would be much appriciate...

When to use Sql Management Objects (SMO)

I'm working on a project that leverages database metadata. To date I've just queried the database catalog views (e.g. sys.tables) but I know this will be "easier" with SMO if I'm willing to add the dependency. What are the advantages to SMO over metadata queries? Any "gotchas" (e.g. needing to have additional SQL libraries on my local ...

any log about db queries executed in my site?

Hi, I own this site: www.gramma.ro. (asp.net/c#)... I've been working 2 days on doing improvements on UI using YSlow and PageSpeed. Well...at this moment the site seems to load ok...i mean from the UI point of view. (Page Speed improvments from 51 to 75; YSlow from F to D(C) ). BUT there is still "waiting" time between pressing a link...

LINQ to SQL Insert Failing because of Join

I've got two tables in my database Users and HealthMonitor. In the HealthMonitor table I have a UserID field that is mapped to the ID field in the Users table. Pretty straight forward so far... I left the UserID field in the HealthMonitor table as "Nullable" so that I can have the system insert a NULL value into the table if there is ...

How do you connect Flash Builder CS5 to IIS & Sql Server?

I'm having problems understanding exactly how you connect a Flash Builder 4 Project to IIS & subsequently, sql server. In trying to configure the Flash Builder 'Server', no matter what I put in as 'web application root' and 'Web application URL' and 'Output Folder' it won't validate my configuration. The documentation is maddeningly ne...

ASP.NET: connecting to a sql server database

(very newbie question, please help if you can) how do i connect visual web developer to sql server express 2008? in the Database Explorer, i right click on Data Connections, click Add Connection..., and in the Data source box i choose Microsoft SQL Server (sqlClient), which i'm guessing doesn't connect me to a database file, but to sql ...

SQL connection string for database on network

I want to connect to a database on a host except localhost, my DBMS is SQL Server and I'm using ado.net, like this: SqlConnection con = new SqlConnection(constr); con.Open(); SqlCommand cmd = new SqlCommand("insert into st (ID,Name) values ('"+cnt.ToString()+"','havijuri');", con); //some sql commands. con.Close(); what should I use a...

JDBC, INSERT MULTIPLE records obtained from query, into other table

I need to insert multiple records into mysql database at once. What I am doing is SELECT on one table, from my application with Prepared statement. What I must do is to insert those results into one other temporary table. String sqlquery = "select * from table1 where arg1 = ?"; PreparedStatement statement; statement = con.prepareStatem...