I have a scripted database SQL file that I need to execute inside Visual Studio to create a new database. I am so far unable to locate any function that allows me to do this.
If there are no begin and end statements in sql, the next statement is the only one that gets executed if the if condition is true...in the case below, is there anyway the insert statement will also get executed if the if condition is true?
IF (a > 1)
SET @b = 1 + 2
INSERT INTO #F (a, b, c) VALUES (1, 2, 3)
I want to transfer data from SQL Server table to Excel sheet using 3 tier architecture in asp.net 3.5. After user has made required changes in the Excel sheet I want Excel sheet to get uploaded and update data in the table with validation for proper data.
Hi all,
Well I have read ALOT of posts and I can't quite find the perfect answer to my question, (or I have and havn't realised it!:-))
I have a large csv file that I want to read into my program and sve it to a SQL database table.
I'm useing VB2008 and my dabase is SQL2008.
Any help would be appreciated.
Cheers Cookster
Hi
I have a MVC app that use Linq2Sql to access a SQL DB.
But I want create a distributed transaction to update
another DB on different local server.
Can I just wrap logic in TransactionScope class???
Malcolm
Very basic SQL question (DB is MySQL):
I want a table of number of transactions by users.
User ID Transaction count
1 43
2 213
3 0
4 23
5 0
In a table I have the two relevant records (user_id and buy_count).
How could I get the table I want?
Thanks,
Roberto
Hi,
I'm querying an SQL Server database using SQLAlchemy and need to cast a column to varbinary(max). The thing I am struggling with is the "max" part. I can get the cast to work for any actual number (say varbinary(20)), but I cannot find how to get it to work for the "max" size of the varbinary column.
Any pointers? Links? Solutions?
Regards,…
I have scheduled backups running through SQL Agent, with Full Backups nightly, and differential backups hourly. Is there a way to determine which of the backup files is the Full backup, and which is the latest differential?
Intuitively, it would seem the largest backup within 24 hours is the full, and the latest smaller backup is the partial. …
I have a table that describes which software versions were installed on a machine at various times:
machine_id::integer, version::text, datefrom::timestamp, dateto::timestamp
I'd like to do a constraint to ensure that no date ranges overlap, i.e. it is not possible to have multiple software versions installed on a machine at the same time.
How…
I have some questions about SQL 2K8 integrated full-text search.
Say I have the following tables:
Car with columns: id (int - pk), makeid (fk), description (nvarchar), year (int), features (int - bitwise value - 32 features only)
CarMake with columns: id (int - pk), mfgname (nvarchar)
CarFeatures with columns: id (int - 1, 2, 4, 8, etc.),…
I have a database which users should not be able to alter data in unless they use the specific app. I know best practice is to use windows authentication however that would mean that users could then connect to the database using any other data enabled app and change values which would then not be audited.
Unfortunately SQL 2008 with its…
I am in the middle of designing a highly-scalable application which must store a lot of data. Just for example it will store lots about users and then things like a lot of their messages, comments etc. I have always used MySQL before but now I am minded to try something new like couchdb or similar which is not SQL.
Does anyone have any…
Hi all,
I have a rather large database that has alot of decimal columns in alot of tables, the customer has now changed their mind and wants all the numbers (decimals) to have a precision of 3 d.p. instead of the original two. Is there any quick way of going through all the tables in a database and changing any decimal column in that…
Hi,
I'm thinking of developing the following but wondering if it already exists out there:
I need a SQL based solution for assigning and managing localization text values for an asp.net site instead of using RESX files. This helps maintain text on the site without having to take it down for deployment whenever an update is required.
…
Hi I have a really complicated dynamic query
that i want to use to retrieve data from the database
I am working in .net 3.5 sql server 2008
i created a stored procedure that accepts a varchar(max) as input parameter and does
execute (@SqlQuery)
it executes but does not return anything
I really would like to use LINQ as all my…
I have a DateTime object I want to compare against an sql datetime field in a where clause. I'm currently using:
"where (convert( dateTime, '" & datetimeVariable.ToString & "',103) <= DatetimeField)"
But I believe datetimeVariable.ToString will return a different value depending on the culture where the system is…
Checking few RDBMS I find that things like
SELECT COUNT (a), SUM (b)
FROM TABLE
are allowed (notice space between aggregate functions and parenthesis).
Could anyone provide a pointer to SQL standard itself where this is defined (any version will do)?
Hi everyone I am not clear with SQL reporting services can someone pls give me breef explanation or post some tutorial with examples and concept explanations. ]
Thanks a lot.
Hello all,
I have a table let's say in the form of: match(id, hometeam_id, awayteam_id) and team(id, name). How do I build my SQL query in order to get a result table in the form of (match_id, hometeam_name, awayteam_name), since they both (hometeam_id, awayteam_id) reference the same table (team)?
Thank you
Hi,
I have a tabel in an Sql Server 2005 database. I have the following column
IndPL INT DEFAULT 0 NULL
I want to change the column to be of the type NVARCHAR but I receive a constraint violation due to the fact that the column has a default value constraint attached to it.
I need to find out how to remove a default value…
In SQL server,How can i place the value of more than one column in variables using one query
Ex : My query is :
SELECT ET.ID,ET.Description,ET.DefaultTemplateText
FROM TBL_EMAILTEMPLATE ET
WHERE ET.NAME='OneWeekReminder'
I want to place the Column values in variables.
Thanks in advance for the help
I am messing around with one of my databases.. is there away for me to search for a string in ALL the tables.. and replace it with another everywhere it occurs?
I am looking for SQL
Hello,
I'm trying to build a facebook like search for my software.
I'd like to query the table customers.
I've set up a FULLTEXT Index and tried the next query
SELECT * FROM Customer where CONTAINS(*,'*ann*')
The query does return all the customers named Ann, but it doesn't return all the customers name Anne.
Is there a…