Create a PassingURLParameter variable and assign the value into that for REPORT PATH GO TO the report Cell--> Go to its properties and select Action Property----> then Write down the following code into that.
="javascript:void(window.open('"+Globals!ReportServerUrl +Parameters!PassingURLParameterName.Value+"&Parval="+Right(Fields!parameter.UniqueName,Len(Fields!parametername.UniqueName )-23)+"&rc:Parameters=false&rc:ToolBar=false&rc:addressbar=false','welcome','width=310,Height=250,location=yes,status=no,toolbar=false,Vscrollbar=Yes,Hscrollbar=No,menubar=no,screenX=500,screenY=200,left=600,top=200'))"
Monday, February 28, 2011
Sunday, February 27, 2011
Script to Drop the Constraints
SELECT
'ALTER TABLE [' + OBJECT_NAME(f.parent_object_id) +
'] DROP CONSTRAINT [' + F.name + ']' + CHAR(10) +
'GO ' + CHAR(10)
FROM sys.foreign_keys AS f
INNER JOIN sys.foreign_key_columns AS fc
ON f.OBJECT_ID = fc.constraint_object_id
'ALTER TABLE [' + OBJECT_NAME(f.parent_object_id) +
'] DROP CONSTRAINT [' + F.name + ']' + CHAR(10) +
'GO ' + CHAR(10)
FROM sys.foreign_keys AS f
INNER JOIN sys.foreign_key_columns AS fc
ON f.OBJECT_ID = fc.constraint_object_id
Labels:
Script to Drop the Constraints
Thursday, February 24, 2011
SQL Server Data Types
Character strings:
char(n) Fixed-length character string. Maximum 8,000 characters
varchar(n) Variable-length character string. Maximum 8,000 characters
varchar(max) Variable-length character string. Maximum 1,073,741,824 characters
text Variable-length character string. Maximum 2GB of text data
Unicode strings:
nchar(n) Fixed-length Unicode data. Maximum 4,000 characters
nvarchar(n) Variable-length Unicode data. Maximum 4,000 characters
nvarchar(max) Variable-length Unicode data. Maximum 536,870,912 characters
ntext Variable-length Unicode data. Maximum 2GB of text data
Binary types:
bit Allows 0, 1, or NULL
binary(n) Fixed-length binary data. Maximum 8,000 bytes
varbinary(n) Variable-length binary data. Maximum 8,000 bytes
varbinary(max) Variable-length binary data. Maximum 2GB image Variable-length binary data. Maximum 2GB
Number types:
tinyint Allows whole numbers from 0 to 255
smallint Allows whole numbers between -32,768 and 32,767
int Allows whole numbers between -2,147,483,648 and 2,147,483,647
bigint Allows whole numbers between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807
decimal(p,s) Fixed precision and scale numbers.
Allows numbers from -10^38 +1 to 10^38 –1.
The p parameter indicates the maximum total number of digits that can be stored (both to the left and to the right of the decimal point). p must be a value from 1 to 38. Default is 18.
The s parameter indicates the maximum number of digits stored to the right of the decimal point. s must be a value from 0 to p. Default value is 0
numeric(p,s) Fixed precision and scale numbers.
Allows numbers from -10^38 +1 to 10^38 –1.
The p parameter indicates the maximum total number of digits that can be stored (both to the left and to the right of the decimal point). p must be a value from 1 to 38. Default is 18.
The s parameter indicates the maximum number of digits stored to the right of the decimal point. s must be a value from 0 to p. Default value is 0
smallmoney Monetary data from -214,748.3648 to 214,748.3647
money Monetary data from -922,337,203,685,477.5808 to 922,337,203,685,477.5807
float(n) Floating precision number data from -1.79E + 308 to 1.79E + 308.
The n parameter indicates whether the field should hold 4 or 8 bytes. float(24) holds a 4-byte field and float(53) holds an 8-byte field. Default value of n is 53.
real Floating precision number data from -3.40E + 38 to 3.40E + 38
Date types:
datetime From January 1, 1753 to December 31, 9999 with an accuracy of 3.33 milliseconds
datetime2 From January 1, 0001 to December 31, 9999 with an accuracy of 100 nanoseconds
smalldatetime From January 1, 1900 to June 6, 2079 with an accuracy of 1 minute
date Store a date only. From January 1, 0001 to December 31, 9999
time Store a time only to an accuracy of 100 nanoseconds
datetimeoffset The same as datetime2 with the addition of a time zone offset
timestamp Stores a unique number that gets updated every time a row gets created or modified. The timestamp value is based upon an internal clock and does not correspond to real time. Each table may have only one timestamp variable
Other data types:
sql_variant Stores up to 8,000 bytes of data of various data types, except text, ntext, and timestamp
uniqueidentifier Stores a globally unique identifier (GUID)
xml Stores XML formatted data. Maximum 2GB
cursor Stores a reference to a cursor used for database operations
table Stores a result-set for later processing
char(n) Fixed-length character string. Maximum 8,000 characters
varchar(n) Variable-length character string. Maximum 8,000 characters
varchar(max) Variable-length character string. Maximum 1,073,741,824 characters
text Variable-length character string. Maximum 2GB of text data
Unicode strings:
nchar(n) Fixed-length Unicode data. Maximum 4,000 characters
nvarchar(n) Variable-length Unicode data. Maximum 4,000 characters
nvarchar(max) Variable-length Unicode data. Maximum 536,870,912 characters
ntext Variable-length Unicode data. Maximum 2GB of text data
Binary types:
bit Allows 0, 1, or NULL
binary(n) Fixed-length binary data. Maximum 8,000 bytes
varbinary(n) Variable-length binary data. Maximum 8,000 bytes
varbinary(max) Variable-length binary data. Maximum 2GB image Variable-length binary data. Maximum 2GB
Number types:
tinyint Allows whole numbers from 0 to 255
smallint Allows whole numbers between -32,768 and 32,767
int Allows whole numbers between -2,147,483,648 and 2,147,483,647
bigint Allows whole numbers between -9,223,372,036,854,775,808 and 9,223,372,036,854,775,807
decimal(p,s) Fixed precision and scale numbers.
Allows numbers from -10^38 +1 to 10^38 –1.
The p parameter indicates the maximum total number of digits that can be stored (both to the left and to the right of the decimal point). p must be a value from 1 to 38. Default is 18.
The s parameter indicates the maximum number of digits stored to the right of the decimal point. s must be a value from 0 to p. Default value is 0
numeric(p,s) Fixed precision and scale numbers.
Allows numbers from -10^38 +1 to 10^38 –1.
The p parameter indicates the maximum total number of digits that can be stored (both to the left and to the right of the decimal point). p must be a value from 1 to 38. Default is 18.
The s parameter indicates the maximum number of digits stored to the right of the decimal point. s must be a value from 0 to p. Default value is 0
smallmoney Monetary data from -214,748.3648 to 214,748.3647
money Monetary data from -922,337,203,685,477.5808 to 922,337,203,685,477.5807
float(n) Floating precision number data from -1.79E + 308 to 1.79E + 308.
The n parameter indicates whether the field should hold 4 or 8 bytes. float(24) holds a 4-byte field and float(53) holds an 8-byte field. Default value of n is 53.
real Floating precision number data from -3.40E + 38 to 3.40E + 38
Date types:
datetime From January 1, 1753 to December 31, 9999 with an accuracy of 3.33 milliseconds
datetime2 From January 1, 0001 to December 31, 9999 with an accuracy of 100 nanoseconds
smalldatetime From January 1, 1900 to June 6, 2079 with an accuracy of 1 minute
date Store a date only. From January 1, 0001 to December 31, 9999
time Store a time only to an accuracy of 100 nanoseconds
datetimeoffset The same as datetime2 with the addition of a time zone offset
timestamp Stores a unique number that gets updated every time a row gets created or modified. The timestamp value is based upon an internal clock and does not correspond to real time. Each table may have only one timestamp variable
Other data types:
sql_variant Stores up to 8,000 bytes of data of various data types, except text, ntext, and timestamp
uniqueidentifier Stores a globally unique identifier (GUID)
xml Stores XML formatted data. Maximum 2GB
cursor Stores a reference to a cursor used for database operations
table Stores a result-set for later processing
Labels:
SQL Server Data Types
Wednesday, February 23, 2011
3 different ways to insert records in SQL Server 2008
insert into EMP (EMPID, FirstName,LastName)
values (11,'amit','kumar')
insert into EMP (EMPID, FirstName,LastName)
values (22, 'ajay','kumar')
OR
insert into EMP (EMPID, FirstName,LastName)
Select 11,'amit','kumar'
UNION
Select 22, 'ajay','kumar'
OR
insert into EMP (EMPID, FirstName,LastName)
values
(11,'amit','kumar'),
(22, 'ajay','kumar')
values (11,'amit','kumar')
insert into EMP (EMPID, FirstName,LastName)
values (22, 'ajay','kumar')
OR
insert into EMP (EMPID, FirstName,LastName)
Select 11,'amit','kumar'
UNION
Select 22, 'ajay','kumar'
OR
insert into EMP (EMPID, FirstName,LastName)
values
(11,'amit','kumar'),
(22, 'ajay','kumar')
Monday, February 21, 2011
To know about your database details
select * from sysfiles
OR
select * from sys.databases where name ='DatabaseName'
OR
select * from sys.databases where name ='DatabaseName'
Subscribe to:
Posts (Atom)