I'm wondering if using a CASE statement in SQLite (or other SQL engines) to replace data is not advised. For example lets say I have a query.
SELECT Users,
CASE WHEN Active = 0 THEN 'Inactive'
WHEN Active = 1 THEN 'Active'
WHEN Active = 2 THEN 'Processing'
ELSE 'ERROR' AS Active
FROM UsersTable;
When is it better to create a reference table and perform a JOIN. In this case I would create a Table 'ActiveStatesTable' with ActiveID, ActiveDescription and perform the JOIN.
What advice would you have for someone who wants to start in the BI (Business Intelligence) domain?
I where and what I should start with: Books, Blogs, WebCasts...
What I should pay attention to and what I should stay away from.
Are the Microsoft technologies worth while ?
Hi
Is it possible in hibernate to print generated sql queries with real values instead of question marks?
How would you suggest to print queries with real values if its not possible with hibernate api?
Umar
Trying the following code. But getting 'The argument 1 of the xml data type method "modify" must be a string literal' error. searched alot but cant find any solution for this problem
SET @Path = '/@ParentNodeName/@NodeName/child::*'
SET @x.modify('insert attribute status {sql:variable("@status")}
as first into (' + @Path + ')[1]')
I can select using or with the sql statement
select f.userid, f.friend_userid from friends f where userid = 1 or friend_userid = 1;
now in the output i have to merge the two rows(userid and friend_userid) into one row such that only the rows without 1 are displayed
I m using mysql....
Thanks
Pradyut
India
If I create a website that uses an mdf in App_Data with the connection string:
Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname; Trusted_Connection=Yes;
what do I need to do to run the site in a shared hosting environment? Do I need to copy the contents of my mdf to the main SQL Server engine of my host? Is there a way to use the non-SQLExpress engine of my host and still keep my mdf in my App_Data?
Given a table (id, col1, col2), does it make sense to create the following indexes:
Index1 (col1) not unique
Index2 (col1, col2) not unique
I am faced with a legacy database that is full of those.
Can I safely delete Index1? Anwser needed for SQL Server and Oracle.
Hello,
I have Full Text catalog created in SQL Server 2005, when I search the text like "Bolivia's History", it returns all the result matching to that, but if I use "Bolivias History", it does not return anything, I am very new to Full Text Search stuff, any lead how to ignore the special character ("'"), in Full Text Search?
Thanks in Advance,
Manoj
If I was going to put my site for the public's use, what are some security issues that I should be worried about?
I know of SQL injections.
What other hacks/injections should I be aware of?
I have a web site and a web service and I would like to host them somewhere.
I need to use it mostly for testing and so that a some friends who are developing some applications to use the service have access to it. Also the service is using a MS SQL 2008 database.
Could you suggest any good free or cheap web hosting service for this. I would need about 1-2 months of hosting.
I was wondering if there are any free / open source alternatives to RedGate's Data Generator. I do not care if the tool is script based, GUI based, written in anly language/platform. I should be able to target a SQL Server or MySQL schema and have test data generated for me which gets inserted into db directly or generate scripts for insertion.
i used to open sdf (sqlCE) files with visual-studio ?? or sql-server ??
i really don't remember.
now i can't open this sdf file
with what program do i need to open it ?
Hello everyone,
I am looking for some reference/samples about how to define good KPI for education industry. I want to define KPI from school/department management perspective to measure various school performance, students/faculty/others.
Any advice, referneces or documents are appreciated -- more appreciated if with the context of SQL Server 2005/2008.
thanks in advance,
George
Can a Timestamp (rowversion) column in a SQL Server table be queried? If so, how?
I'd like to do something like this:
Select * From MyTable Where MyTimestampColumn = "???"
But am not sure what to put in for "???"
Thanks - Randy
Is there a way to find out when a stored procedure or table was last modified? I tried checking the properties via SQL Management Studio, but only found the creation date.
Thanks!
I have a table named scores with the columns id and score. I want to access a specific record by its id as well as the 5 records before and after it. Is there a way in SQL to say "grab the score with the id of n and x items before and after it?"
There are 3 way for querying against conceptual model in EF :
LINQ to Entity
Entity SQL
Query Builder Methods
Which one is better for which situation? Is there any performance issues for these 3 type of querying?
I'm not used to working with PostgreSQL, but am using Zend_Db_Select to create my queries.
What does the error below mean?
SQL error:
ERROR: schema "il" does not exist
In statement:
SELECT il.count(*) AS "count" FROM "image_lite" AS "il"
INNER JOIN "exif_parse" AS "ex" ON il.image_id = ex.image_id
WHERE (ex.cam_make = 'apple')
I would like to find a way to create and populate a database during asp.net setup.
So, what I'm willing to do is:
Create the database during the setup
Populate the database with some initial data (country codes or something like that)
Create the appropriate connection string in the configuration file
I'm using .NET 3.5 and Visual Studio 2005, and the Database is SQL Server 2005.
Thanks in advance.
In SQL Server, there is the option to use query hints.
eg
SELECT c.ContactID
FROM Person.Contact c
WITH (INDEX(AK_Contact_rowguid))
I am in the process of getting rid of unused indexes and was wondering how I could go about determining if an index was used as a query hint. Does anyone have suggestions on how I could do this?
Cheers,
Joe
A cross join performs a cartesian product on the tuples of the two sets.
SELECT *
FROM Table1
CROSS JOIN Table2
Which circumstances render such an SQL operation particularly useful?
Ok, there are a million regexes out there for validating an email address, but how about some basic email validation that can be integrated into a TSQL query for Sql Server 2005?
I don't want to use a CLR procedure or function. Just straight TSQL.
Has anybody tackled this already?