Hi,
I tried to google it, but din't find a way
I have a t-sql script that adds a new column to a table, then fills that columns with values depending on some other columns in the same table and finally removes some columns. This all works fine.
The problem occures when I want to run the script again. I have a if clause that checks if ...
Hi,
I'm looking for a program that can emulate, impersonate a MSSQL server and convert and write the queries to a MySQL database. Thus allowing me to configure client applications developed for MSSQL database systems only, to connect to the emulator and thus writing and reading the MySQL based records.
Any help will be highly appreciat...
Hi,
I've stumbled across some odd T-SQL code in SQL Server 2005, which I'm trying to understand how it could work.
If there are two tables called tblScenario in two separate schemas, one is in Cache schema and the other is in Dimension schema.
What would we expect to find when we query SELECT * FROM dbo.tblScenario? How does dbo map ...
Does the SQL Server build an index on primary keys by default?
If yes what kind of index? If no what kind of index is appropriate for selections by primary key?
I use SQL Server 2008 R2
Thank you.
...
My query needs to do a LIKE search over 3 columns.
SELECT * FROM Monkeys
WHERE [Name] LIKE '%pete%' OR [Desc] LIKE '%pete%' OR [Info] LIKE '%pete%';
I am looking to improve the performance of this query.
I can't use full-text catalogs, just simple tables. There are about 200,000 rows (SQL Server 2008 database) and it takes 3 to 6 sec...
I'm not a DBA by any means, but i need my SQL Server to perform "checks" everyday (say at midnight)
They're pretty simple (I think), e.g. - if a particular row's dateTime has passed, I'd like to delete that row and set the column in the reference table to NULL
Is this a database trigger?
Any sample code or links would be greatly appre...
how tosave an image data type to table using sql server 2005 who its in visual studio 2005.thanks
...
Hi
I have a bunch of stored procedure names. I want to export the create script for each of the stored procedure. What is the best way to do it?
Right now I am manually selecting the stored proc in SSMS and selecting "Script stored procedure as -> Drop and Create to". This seems tedious. I am hoping there is a better way to deal with ...
What do you guys think would be the best approach here?
I have about 30 SQL tables that is basically referenced by a [lookup] table. I have to do an insert in another table [FinalTable] for each row in the [lookup] table. Now the [lookup] table looks something like this.
ID, Zipcode, tableID
1, 60453, 1
2, 90210, 1
3, 60453, ...
I have a column in my select statement that looks like this:
SELECT CASE WHEN fu.SentOutDate IS NULL THEN '' ELSE fu.SentOutDate END
This returns 1900-01-01 00:00:00.000 for the ones that would otherwise be NULL
I know this because when I put in just fu.SentOutDate it comes up as NULL
Why does this happen and how can I just get it t...
I am using SQL Server 2005 with Windows authentication. My login has administrator rights. For my login I have a user mapped to a database with the default schema set to "my_schema". My login is not the owner of the database. When I log on though, and try to execute a simple select statement on a table in "my_schema" without specifyi...
Hello,
I am looking for a little help writing a T-SQL query. It's been a while since I've done something like this and my brain is forgetting what I need to do.
I have a table with the following data that I need a query to get Col1, Max(Col2), Min(Col3). So that's for each distinct col1 I want to get the max col2 and min col3.
Example...
I recently became involved with a new software project which uses SQL Server 2000 for its data storage.
In reviewing the project, I discovered that one of the main tables uses a clustered index on its primary key which consists of four columns:
Sequence numeric(18, 0)
Date datetime
Client varchar(9)
Hash tinyint
This ta...
I was a MySQL user. Now I'm migrating to SQL Server. But I have a problem. I can not find any way for specifiying the kind of index a table has. In MySQL I could easily say to build a BTree Index or Hash Index. How can I do that here?
The main problem is that I have two tables. one of them (named "posts") has a foreign key to the other ...
I'm working on creating a chart for my client and they want to get the total customer count over a 24 hour, 3 day, 1 week, 1 month, etc period. I'm honestly not the best with SQL, so generating these queries aren't my forte.
In regards to getting the customers over 24 hours, I've come across two "where" statements that may work, but I'...
I am working on a survey application. I have a sql server database holding upto 3000 survey questions.
I call database for a set of 10 questions. I have to make sure that none of the of the questions are repeated for the longest time possible.
What is the best possible approach I can take here? Write a custom randomization algorithm or S...
I have a project where I need to pull in a lot of records and modify them based on some criteria.
Basically, we have a system where users can upload documents. Those documents get tagged in the database for validation reasons from other users. We validate the files based on certain criteria and then mark them as being valid. So we have...
Due to an employee quitting, I've been given a project that is outside my area of expertise.
I have a product where each customer will have their own copy of a database. The UI for creating the database (licensing, basic info collection, etc) is being outsourced, so I was hoping to just have a single stored procedure they can call, p...
We have a feature that allows us to create SQL to get back data from one table based on a nested query that filters records based on matching criteria from another table. Now, we need to be able to get back data from the first table based on the top x records of the nexted query, rather than all matching records. For Example we want s...
I set up a site on my local system using PDO and a MySQL Database. I used PDO because when the site goes on the live server I have to user SQL Server and I was hoping PDO would take care of all my query conflicts.
Now that I'm up on the live server I get an error whenever the application uses the "LIMIT" function. I realize this is a My...