Hi,
Currently my SQL statement is the following
SELECT NAME, ROUND([DR# BASE]/DAYS_WORKED,0) AS 'BASE/DAY'
FROM MYTABLE
And the output data looks like the following
NAME BASE/DAY
James 300
Jane 310
Jim 313
John 325
Jonah 400
Is there a SQL statement to make the Output look like the following?
NAME BUCKET BASE/DAY...
I'm trying to debug a stored procedure. I'm creating a logtable (just a regular table) and inserting the stored proc input values into it, however this is in the middle of transaction and my inserts are getting rolled back. Is there any way to commit my inserts that have them saved even when a rollback is issued.
Thanks
...
I was thinking to create something like linked server which i could read data from a remote server using SSIS. My question is, can i do that in SSIS which i will only need to read data from a remote server and join with local server tables in a view! How to do that in SSIS?? Servers i am using are SQL Server 2005.
...
I am working on a database that is very localized, for example sake:
Tables:
Product - Has non localized columns (item number, created, etc)
Product_Local - Has localized columns (description) and a language identifier column
I am using SQL 2008 and full text searching requires for its word breakers that I set the language per column. ...
Is it possible to check is there any stored proc currently running in SQL Server???
...
Hi I tried to execute the below query to get results as paging manner
but when i tried to execute i'm getting error like Invalid column name 'RowNum'
can you try it once
DECLARE @PageNum AS INT;
DECLARE @PageSize AS INT;
SET @PageNum = 2;
SET @PageSize = 10;
WITH videosrn AS
(
SELECT ROW_NUMBER() OVER(ORDER BY videoid) AS RowNum
...
I use Full-text indexing in SQL Server 2008.
I can't seem to find an answer to this question. Say that i have a full-text index on a table with the columns "Name" and "Description". I want to make the "Name" column much more important then the "Description" column.
So if you search for "Internet" the result with the name "Internet" wil...
I'm using SQL Server to build stored procedures, and I'm using cursors to loop through a select statement
I'm defining the cursor as follow:
DECLARE @c_col1 varchar(max);
DECLARE @c_col2 varchar(max);
DECLARE c as CURSOR FOR
SELECT col1, col2
FROM table;
OPEN c;
FETCH NEXT FROM c INTO
@c_col1, @c_col2;
SELECT @c_col1, @c_col2;
I...
I'd like to create a check constraint for a table in SQL 2008 which would allow A-Z characters (non case sensitive), numbers, hyphen (-), dot(.), space and underscore (_).
Below is my current expression:
([company_code] not like '%[^A-Za-z0-9_ .+]%').
It fulfills all the above requirements except for hyphen. How could I make the express...
I have made an SSIS package that uses the Excel source to extract data from an Excel 2003 file and inserts it into SQL Server. When executed on production machine it gives and error of 'productleveltoolow'. Excel is not installed on the server. Can this error be due to this reason?
...
I have written a CLR stored procedure that is in an assembly.
I have a build system that can auto-build and deploy .net application from our source control repository.
I want the two things to work together so I can redeploy the assembly that hosts the CLR stored proc.
However it looks like, unlike IIS, simply replacing the binaries ...
I want to save an object (of any type) into a field in a database in SQL Server 2005. Is it possible? Do I have to convert the object into something, like a byte array for example and cast it back when retrieving it?
...
I have three tables
[USER] --Master user table
[KEYWORD] --Master keyword table
[USER_KEYWORD] --[USER]-[KEYWORD] mapping table
Below is the structure in my db
GO
--master user table
CREATE TABLE [USER]
(
[USERID] INT IDENTITY,
[NAME] VARCHAR(50)
)
GO
--master keyword table
CREATE TABLE [KEYWORD]
(
[KEYWORDID] INT I...
Server in qustion is SQL Server 2008.
On the same note, I need to know what is the max length of the string parameter passed in SP?
...
I am using SQL Server Integration Services 2008 to put a certain boolean value in the database, and originally I used the SSIS type of DT_BOOL (boolean).
However, in the database, the boolean value is being stored as a tinyint field (for legacy reasons). A boolean value of TRUE would be saved in the database as 255 (all bits on), inste...
I searched for this for a while but came up empty ... hopefully someone here can help.
Is there a query I can run on a database (SQL Server 2005) that will return the number of rows in each table?
...
A question came up in relation to another question regarding DDL triggers. If I have a DDL trigger such as the one below that is meant to warn or rollback a change if the parameter list changes, is there a way to get the previous state of (for example) the parameter list? As you can see, the trigger already references the new parameter...
Public Sub cleanTables(ByVal prOKDel As Short)
Dim sqlParams(1) As SqlParameter
Dim sqlProcName As String
sqlProcName = "db.dbo.sp_mySP"
sqlParams(1) = New SqlParameter("@OKDel", prOKDel)
Try
dbConn.SetCommandTimeOut(0)
dbConn.ExecuteNonQuery(CommandType.StoredProcedure, sqlProcName, sqlParams)
...
I would like to write a procedure that creates a view depending on its parameter in SQL Server 2005.
Grossly, this should look like this :
CREATE PROCEDURE testprocedure
@clientid float
as
create view testview as
select * from deliveries where clientid=@clientid
(but this does not work, it gives the error : Incorrect syntax near t...
I have an SSRS matrix report that has 4 column groups with the last group set to hide some of its columns if they contain no data.
The report works perfectly, however when exported to excel an empty column header appears and all the headers shift right. It can happen multiple times on the same sheet.
For examples instead of seeing some...